ex-4: χ² minimization results reported

This commit is contained in:
Giù Marcer 2020-04-27 23:53:23 +02:00 committed by rnhmjoj
parent ba55f1b57b
commit 365b239701
2 changed files with 29 additions and 8 deletions

View File

@ -160,7 +160,10 @@ int main(int argc, char **argv)
}
double result = x;
printf("p_max: %.7f\n", result);
double res_chi = chi2(result, &params);
printf("Results:\n");
printf("χ² = %.3f\n", res_chi);
printf("p_max = %.3f\n", result);
// Compute the second derivative of χ² in its minimum for the result error.
//
@ -189,7 +192,7 @@ int main(int argc, char **argv)
error = error + A + B;
};
error = 1/error;
printf("ΔP_max: %.7f\n\n", error);
printf("ΔP_max = %.3f\n\n", error);
// Free memory.

View File

@ -151,13 +151,16 @@ $$
Finally, putting all the pieces together, the average value of $|P_v|$ can now
be computed:
$$
\langle |P_v| \rangle = \int
\begin{align*}
\langle |P_v| \rangle &= \int
\limits_{- \sqrt{P_{\text{max}}^2 - P_h}}^{\sqrt{P_{\text{max}}^2 - P_h}}
f (P_v | P_h = x) = [ \dots ] =
x \, \frac{\ln \left( \frac{P_{\text{max}}}{x} \right)}
{\text{atan} \left( \sqrt{ \frac{P_{\text{max}}}{x^2} - 1} \right)}
$$
f (P_v | P_h = x)
\\
&= [ \dots ]
\\
&= x \, \frac{\ln \left( \frac{P_{\text{max}}}{x} \right)}
{\text{atan} \left( \sqrt{ \frac{P^2_{\text{max}}}{x^2} - 1} \right)}
\end{align*}
Namely:
@ -218,3 +221,18 @@ $$
The following result was obtained:
![Histogram of the obtained distribution.](images/dip.pdf)
In order to check wheter the expected distribution properly metches the
produced histogram, a chi-squared minimization was applied. Being a simple
one-parameter fit, the $\chi^2$ was computed without a suitable GSL function
and the error of the so obtained estimation of $p_{\text{max}}$ was given as
the inverese of the $\chi^3$ second derivative in its minimum, according to the
Cramér-Rao bound.
The following results were obtained:
$$
p_{\text{max}} = 10 \pm 0.016 \with \chi^2 = 0.072
$$
which allows to assert that the sampled points actually follow the predicted
distribution.