ex-1: change ε to 0.88 and write the correct results
This commit is contained in:
parent
7f5ffa5949
commit
1833ab0613
@ -150,7 +150,7 @@ double gauss_kde(double x, void * params) {
|
|||||||
* by the sample variance times a factor which
|
* by the sample variance times a factor which
|
||||||
* depends on the number of points and dimension.
|
* depends on the number of points and dimension.
|
||||||
*/
|
*/
|
||||||
double bw = 0.4 * p.var * pow((double)p.n*3.0/4, -2.0/5);
|
double bw = 0.777 * p.var * pow((double)p.n*3.0/4, -2.0/5);
|
||||||
|
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
for (size_t i = 0; i < p.n; i++)
|
for (size_t i = 0; i < p.n; i++)
|
||||||
|
@ -289,10 +289,10 @@ where $\mathcal{N}$ is the kernel and the parameter $\varepsilon$, called
|
|||||||
determined in several ways. For simplicity, it was chosen to use Silverman's
|
determined in several ways. For simplicity, it was chosen to use Silverman's
|
||||||
rule of thumb [@silverman86], which gives:
|
rule of thumb [@silverman86], which gives:
|
||||||
$$
|
$$
|
||||||
\varepsilon = 0.63 \, S_N
|
\varepsilon = 0.88 \, S_N
|
||||||
\left(\frac{d + 2}{4}N\right)^{-1/(d + 4)}
|
\left(\frac{d + 2}{4}N\right)^{-1/(d + 4)}
|
||||||
$$
|
$$
|
||||||
where the $0.63$ factor was chosen to compensate for the distortion that
|
where the $0.88$ factor was chosen to compensate for the distortion that
|
||||||
systematically reduces the peaks height, which affects the estimation of the
|
systematically reduces the peaks height, which affects the estimation of the
|
||||||
mode, and:
|
mode, and:
|
||||||
|
|
||||||
@ -303,13 +303,13 @@ With the empirical density estimation at hand, the FWHM can be computed by the
|
|||||||
same numerical method described for the true PDF. Again this was bootstrapped
|
same numerical method described for the true PDF. Again this was bootstrapped
|
||||||
to estimate the standard error giving:
|
to estimate the standard error giving:
|
||||||
$$
|
$$
|
||||||
\text{observed FWHM: } w_o = \num{4.06 \pm 0.08}
|
\text{observed FWHM: } w_o = \num{4.11 \pm 0.07}
|
||||||
$$
|
$$
|
||||||
Applying the $t$-test to these two values gives
|
Applying the $t$-test to these two values gives
|
||||||
|
|
||||||
- $t=0.495$
|
- $t=1.338$
|
||||||
- $p=0.620$
|
- $p=0.181$
|
||||||
|
|
||||||
which shows a very good agreement and proves the estimator is robust.
|
which shows a good agreement and proves the estimator is robust. For reference,
|
||||||
For reference, the initial estimation based on an histogram gave a rather
|
the initial estimation based on an histogram gave a rather inadequate \si{4 \pm
|
||||||
inadequate \si{4 \pm 2}.
|
2}.
|
||||||
|
Loading…
Reference in New Issue
Block a user