Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HELP] Computation of Q2 and cR #20

Open
antoinecollet5 opened this issue Nov 20, 2024 · 0 comments
Open

[HELP] Computation of Q2 and cR #20

antoinecollet5 opened this issue Nov 20, 2024 · 0 comments

Comments

@antoinecollet5
Copy link
Collaborator

@jonghyunharrylee

I am working on a deep refactoring of the code that I am hosting here for now: https://github.com/antoinecollet5/pyrtid/blob/master/pyrtid/inverse/solvers/pcga/pcga.py
I will push the code when it is ready and entirely tested.

I have a general question regarding the computation of Q2 and cR for model validation.

I guess the main reference is Kitanidis PK. Introduction to Geostatistics: Applications in Hydrogeology. Cambridge University Press; 1997.

If I understand correctly, Q2 is given by (6.67):

$$ Q_2 = \dfrac{1}{n-p} \sum^{n}_{k=p+1} \dfrac{\delta_k^2}{\sigma_k^{2}} $$

And we target $Q_2 = 1$

Whereas cR which we seek as small as possible is given by 4.30:

$$ cR = Q_2 \exp \left( \dfrac{1}{n-p} \sum^{n}_{k=p+1} \ln\left(\sigma_k^{2}\right) \right) $$

Question 1:

In the code, $Q_2$ is defined as

Q2_all[:, i : i + 1] = np.dot(b[:n].T, xi) / (n - p)

which I understand as

$$ Q_2 = \dfrac{1}{n-p}\left(\mathbf{y} - h(\mathbf{\overline{s}}) + \mathbf{H}\overline{\mathbf{s}}\right)^{\mathrm{T}} \overline{\boldsymbol{\xi}} $$

Where is this expression coming from ? Do you have any reference explaining the derivation ?

Question 2, how is cR derived ? Or more specifically $\sigma^{2}$ ? In the code, tt is only implemented if $\mathbf{R}$ is a single element and I am not sure how to define the variance of residuals in the context.

Thank you in advance for your reply.

Best

Antoine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant