From 1833ab061372b5ce89c68fdcc65e5ffe30518396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gi=C3=B9=20Marcer?= Date: Mon, 8 Jun 2020 17:59:14 +0200 Subject: [PATCH] =?UTF-8?q?ex-1:=20change=20=CE=B5=20to=200.88=20and=20wri?= =?UTF-8?q?te=20the=20correct=20results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ex-1/bootstrap.c | 2 +- notes/sections/1.md | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ex-1/bootstrap.c b/ex-1/bootstrap.c index 9437bbd..3046015 100644 --- a/ex-1/bootstrap.c +++ b/ex-1/bootstrap.c @@ -150,7 +150,7 @@ double gauss_kde(double x, void * params) { * by the sample variance times a factor which * 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; for (size_t i = 0; i < p.n; i++) diff --git a/notes/sections/1.md b/notes/sections/1.md index b031cd1..6386413 100644 --- a/notes/sections/1.md +++ b/notes/sections/1.md @@ -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 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)} $$ -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 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 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 - - $t=0.495$ - - $p=0.620$ + - $t=1.338$ + - $p=0.181$ -which shows a very good agreement and proves the estimator is robust. -For reference, the initial estimation based on an histogram gave a rather -inadequate \si{4 \pm 2}. +which shows a good agreement and proves the estimator is robust. For reference, +the initial estimation based on an histogram gave a rather inadequate \si{4 \pm +2}.