From 1bd691a24bd2bf539cb2690babde4c39da393cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gi=C3=B9=20Marcer?= Date: Thu, 7 May 2020 23:18:59 +0200 Subject: [PATCH] ex-1: revised and typo-fixed --- ex-1/main.c | 1 + makefile | 4 +- notes/images/landau-hist.png | Bin 15947 -> 0 bytes notes/images/landau-histo.pdf | Bin 0 -> 14412 bytes notes/sections/1.md | 170 ++++++++++++++++------------------ 5 files changed, 84 insertions(+), 91 deletions(-) delete mode 100644 notes/images/landau-hist.png create mode 100644 notes/images/landau-histo.pdf diff --git a/ex-1/main.c b/ex-1/main.c index 112fd23..88b85ca 100644 --- a/ex-1/main.c +++ b/ex-1/main.c @@ -94,6 +94,7 @@ int main(int argc, char** argv) { pdf.function = &landau_pdf; pdf.params = NULL; + // number of bootstrap samples const size_t boots = 100; double mode_e = numeric_mode(min, max, &pdf, 1); diff --git a/makefile b/makefile index 292f168..fefd2f0 100644 --- a/makefile +++ b/makefile @@ -6,11 +6,13 @@ CCOMPILE = \ mkdir -p $(@D); \ $(CC) $(CFLAGS) $^ -o $@ -ex-1: ex-1/bin/main ex-1/bin/pdf +ex-1: ex-1/bin/main ex-1/bin/pdf ex-1/bin/histo ex-1/bin/main: ex-1/main.c ex-1/landau.c ex-1/tests.c ex-1/bootstrap.c $(CCOMPILE) ex-1/bin/pdf: ex-1/pdf.c $(CCOMPILE) +ex-1/bin/histo: ex-1/histo.c + $(CCOMPILE) ex-2: ex-2/bin/fancy ex-2/bin/fancier ex-2/bin/limit ex-2/bin/naive ex-2/bin/recip ex-2/bin/%: ex-2/%.c diff --git a/notes/images/landau-hist.png b/notes/images/landau-hist.png deleted file mode 100644 index 9c4b3b76f077ea0a4090eab4e5a29534f3be0ecd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15947 zcmeHucT^PFx^J7%5y3GaN;H6qXoHd@s|eU+$sj>Qa?YU%MosDY zkPIR@w1fs}Lcee0oH;XR=FB?xzW3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mIIsWpfEW=nL#fz6^(|O*>`F?O+ePKSj=DVa2ULL1FBLx zcvdK0OM;ACAGf|1+r-2KydMJuAglA@QdA1WlaMA2s{vUBCdd*vdp0*?>@z+Av_*7h z`}XZK9VjhvU7AjMNJ$G(K&2%nKliCC>X*aw{_0hp@o(46ay`QNtU924rh<+Q3q==1 zdMR)u0lahI8zJeLfwb3(Cp73~6IiYGJr?;%2?>?HT#|O^BPe#S=`9OB#5QCt%Sie$ zG(&S386Muuq=M+@tK&8&?j3@)n-<=DJq9!pGZ+k+8E9-;9p}rnAsqS3*3&nRY%_lC zwdcq!8Pu^l@~w3BVQkB=eVSKbuNHZ~+9ID@r2BYa9Of)g=NI@=kJM9 zGJP5HX6}I3pwc0hBGAUa6g34lvxTGs$c($Uc!WMG(9*h@{V3TK4tV6W%ggEZ1HQF0;V z_gShv-f6FET(lm%?dc0%V=+BpUK$B~7$fsfm=3b7+*-w(m zbx+56^A5ZW!VR?}J~2@mwmZ6a+@Bef zY|h7^n}@xaT)yrrftR#M--rDni!qcb0x79u$Bt2Z9)cGya$Ob-H_qnTLdH7<^69TZ zo>~Qw@ijR1x+s{~m2;}9UkpeN6{W}c& zWNl?OYWpDd#>NK1ap@&Xno!M6nqP^dEZJg}=tlFG^lE`C=7=^NiV_Q`9r5>EdtEXHC94u1t;vH2 z4-Nx$t(4{KyA8usxxc8Sv0HlWLv>%DP`v?3GWzS+uX{lhv>DY2aOkL~V8;Po>2`*- z_!Q6|y@!W~L}Qe&FTdUBVW{f;^L#4a?bf^$!K-wWW-RFDfr?+@i#^zagAderXk+`CylKv!{+r^4L4 z0=?#vk1Oa9L}&hVZ)N zbx89SCsJTIj{*ORsSuj`?~ DhesQM diff --git a/notes/images/landau-histo.pdf b/notes/images/landau-histo.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e5bef5fdb4f2fba7d3115cb84de00c7c5ffdc6b5 GIT binary patch literal 14412 zcmeHuc|4WD+qXnG_H2=KtdZsH=Qy^qlYL1F<>1J^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GxbaTeWPaD(5CKO9Ndbhavi?sRh zpxaBZ_ct(dX$mPF(9HGfD|r^sfnDG3$ZVLj=9=NQC^i~fk-fVQzrUtI)O!+>bKbM^ z{v7*u8ne^sB7`vMvW#K~ze;V)_#@RZ@bj09SzrfdDr=?ZHh|fbdbTdb*Jv z!39)m(T55>VgcIdMfP#_bby186cI%B@q{BhJplem3Gf7%5Dei6Zg#>Ej?Vs|&KH2F z2w$>4*#nMPgf78tP=r35NPr_qaD*L%sK5~pAOkR}Gq}hJoIL8E*#+p z0E0gfUjTOgLVN)_@EhX0dJw(>@%?e@73%pvLwuLT?|(sh7w@_P8(q30vD}ULze0L3 zK+pdu?@FW>;OEN`UT|~w7s87L2JoLCyh}dn|3`SK2;u)nc>i037g*Z=F2W1&ObGk^ z&k$Y!UIWnde}M3!f1+^1$q$;UffFnT1DNzsM`ww^r`Kf0V2Lw@&Ks* zV#yN@_A%;PXj=lOuhjCd-3&m|)Pa_5Y5)GCJV+k-SVd{V2eh&`Vog@5b9d!8t`h$D?r~@G#xF52j4o!r znk(v1&=Rwv4hLE3iaPl}#{-M(AMNlsaM5W+U;HZa5|Dq$fh3@jE9FHJFoZwrpu0dT zXb|MVy`vR%@<8H0>d=4AhddVG<170@_ls86$wLbv^!LkNh)}SQG7_wZe$ f(x_e) < f(x_\text{max}) $$ @@ -165,26 +160,26 @@ f(b)$ between $f(x_\text{min})$, $f(x_\text{min})$ and $f(x_e)$. The interval is reduced until it encloses the true minimum to a desired tolerance. The error of the result is estimated by the length of the final interval. -On the other hand, to compute the mode of the sample the half-sample mode (HSM) +On the other hand, to compute the mode of the sample, the half-sample mode (HSM) or *Robertson-Cryer* estimator was used. This estimator was chosen because makes -no assumptions on the underlying distribution and is not computationally expensive. -The HSM is obtained by iteratively identifying the half modal interval, which -is the smallest interval containing half of the observation. Once the sample is -reduced to less that three points the mode is computed as the average. The -special case $n=3$ is dealt with by averaging the two closer points. +no assumptions on the underlying distribution and is not computationally +expensive. The HSM is obtained by iteratively identifying the half modal +interval, which is the smallest interval containing half of the observation. +Once the sample is reduced to less that three points the mode is computed as the +average. The special case $n=3$ is dealt with by averaging the two closer points +[@robertson74]. To obtain a better estimate of the mode and its error the above procedure was -bootstrapped. The original sample is treated as a population and used to build -other samples, of the same size, by *sampling with replacements*. For each one -of the new samples the above statistic is computed. By simply taking the -mean of these statistics the following estimate was obtained +bootstrapped. The original sample was treated as a population and used to build +100 other samples of the same size, by *sampling with replacements*. For each one +of the new samples, the above statistic was computed. By simply taking the +mean of these statistics the following estimate was obtained: $$ \text{observed mode: } m_o = \SI{-0.29 \pm 0.19}{} $$ -In order to compare the values $m_e$ and $x_0$, the following compatibility +In order to compare the values $m_e$ and $m_0$, the following compatibility t-test was applied: - $$ p = 1 - \text{erf}\left(\frac{t}{\sqrt{2}}\right)\ \with t = \frac{|m_e - m_o|}{\sqrt{\sigma_e^2 + \sigma_o^2}} @@ -198,29 +193,28 @@ In this case: - p = 0.311 Thus, the observed mode is compatible with the mode of the Landau distribution, -however the result is quite imprecise. +although the result is quite imprecise. -### Median +#### Median The median is a central tendency statistics that, unlike the mean, is not very sensitive to extreme values, albeit less indicative. For this reason -is well suited as test statistic in a pathological case such as the -Landau distribution. -The median of a real probability distribution is defined as the value -such that its cumulative probability is $1/2$. In other words the median -partitions the probability in two (connected) halves. -The median of a sample, once sorted, is given by its middle element if the -sample size is odd, or the average of the two middle elements otherwise. +is well suited as test statistic in a pathological case such as the Landau +distribution. +The median of a probability distribution is defined as the value such that its +cumulative probability is $1/2$. In other words, the median partitions the +probability in two (connected) halves. The median of a sample, once sorted, is +given by its middle element if the sample size is odd, or the average of the two +middle elements otherwise. The expected median was derived from the quantile function (QDF) of the Landau distribution[^1]. -Once this is know, the median is simply given by $\text{QDF}(1/2)$. -Since both the CDF and QDF have no known closed form they must -be computed numerically. The cumulative probability has been computed by -quadrature-based numerical integration of the PDF (`gsl_integration_qagiu()` -function in GSL). The function calculate an approximation of the integral - +Once this is know, the median is simply given by $\text{QDF}(1/2)$. Since both +the CDF and QDF have no known closed form, they must be computed numerically. +The cumulative probability was computed by quadrature-based numerical +integration of the PDF (`gsl_integration_qagiu()` function in GSL). The function +calculate an approximation of the integral: $$ I(x) = \int_x^{+\infty} f(t)dt $$ @@ -229,58 +223,57 @@ $$ because the quantile had been already implemented and was initially used for reverse sampling. - -The $CDF$ is then given by $p(x) = 1 - I(x)$. This was done to avoid the +The CDF is then given by $p(x) = 1 - I(x)$. This was done to avoid the left tail of the distribution, where the integration can sometimes fail. -The integral $I$ is actually mapped beforehand onto $(0, 1]$ by -the change of variable $t = a + (1-u)/u$, because the integration +The integral $I$ was actually mapped beforehand onto $(0, 1]$ by +the change of variable $t = x + (1-u)/u$, because the integration routine works on definite integrals. The result should satisfy the following accuracy requirement: $$ |\text{result} - I| \le \max(\varepsilon_\text{abs}, \varepsilon_\text{rel}I) $$ -The tolerances have been set to \SI{1e-10}{} and \SI{1e-6}{}, respectively. -As for the QDF, this was implemented by numerically inverting the CDF. This is -done by solving the equation +where the absolute and relative tolerances $\varepsilon_\text{abs}$ and +$\varepsilon_\text{rel}$ were set to \SI{1e-10}{} and \SI{1e-6}{}, +respectively. +As for the QDF, this was implemented by numerically inverting the CDF. This was +done by solving the equation; $$ p(x) = p_0 $$ -for x, given a probability value $p_0$, where $p(x)$ is again the CDF. -The (unique) root of this equation is found by a root-finding routine -(`gsl_root_fsolver_brent` in GSL) based on the Brent-Dekker method. This -algorithm consists in a bisection search, similar to the one employed in the -mode optimisation, but improved by interpolating the function with a parabola -at each step. The following condition is checked for convergence: +for x, given a probability value $p_0$, where $p(x)$ is the CDF. The (unique) +root of this equation was found by a root-finding routine +(`gsl_root_fsolver_brent` in GSL) based on the Brent-Dekker method it too. +The following condition was checked for convergence: $$ |a - b| < \varepsilon_\text{abs} + \varepsilon_\text{rel} \min(|a|, |b|) $$ where $a,b$ are the current interval bounds. The condition immediately gives an upper bound on the error of the root as $\varepsilon = |a-b|$. The tolerances -here have been set to 0 and \SI{1e-3}{}. - +here were set to 0 and \SI{1e-3}{}. The result of the numerical computation is: $$ \text{expected median: } m_e = \SI{1.3557804 \pm 0.0000091}{} $$ -while the sample median, obtained again by bootstrapping, was found to be +while the sample median, obtained again by bootstrapping, was found to be: $$ \text{observed median: } m_e = \SI{1.3605 \pm 0.0062}{} $$ -Applying again the t-test from before to this statistic: +As stated above, the median is less sensitive to extreme values with respect to +the mode: this lead the result to be much more precise. Applying again the +aforementioned t-test to this statistic: - $t=0.761$ - $p=0.446$ -This result is much more precise than the mode and the two values show -a good agreement. +Hence, the two values show a good agreement. -### FWHM +#### FWHM For a unimodal distribution (having a single peak) this statistic is defined as the distance between the two points at which the PDF attains half the maximum @@ -292,58 +285,55 @@ $$ f(x_\pm) = \frac{f_\text{max}}{2} $$ -The function $f'(x)$ was minimized using the same minimization method -used for finding $m_e$. Once $f_\text{max}$ is known, the equation +The function derivative $f'(x)$ was minimized using the same minimization method +used for finding $m_e$. Once $f_\text{max}$ was known, the equation: $$ f'(x) = \frac{f_\text{max}}{2} $$ -is solved by performing the Brent-Dekker method (described before) in the -ranges $[x_\text{min}, m_e]$ and $[m_e, x_\text{max}]$ yielding the two -solutions $x_\pm$. With a relative tolerance of \SI{1e-7}{} the following +was solved by performing the Brent-Dekker method (described before) in the +ranges $[x_\text{min}, m_e]$ and $[m_e, x_\text{max}]$ yielding the two +solutions $x_\pm$. With a relative tolerance of \SI{1e-7}{}, the following result was obtained: - $$ \text{expected FWHM: } w_e = \SI{4.0186457 \pm 0.0000001}{} $$ \vspace{-1em} -![Example of a Moyal distribution density obtained by - the KDE method described above. The rug plot shows the original - sample used in the reconstruction.](images/landau-kde.pdf) +![Example of a Moyal distribution density obtained by the KDE method. The rug + plot shows the original sample used in the reconstruction. The 0.6 factor + compensate for the otherwise peak height reduction.](images/landau-kde.pdf) On the other hand, obtaining a good estimate of the FWHM from a sample is much -more difficult. In principle it could be measured by binning the data and +more difficult. In principle, it could be measured by binning the data and applying the definition to the discretised values, however this yields very poor results and depends on an completely arbitrary parameter: the bin width. -A more refined method to construct an nonparametric empirical PDF function from +A more refined method to construct a nonparametric empirical PDF function from the sample is a kernel density estimation (KDE). This method consist in -convolving the (ordered) data with a smooth symmetrical kernel, in this cause a -standard gaussian function. Given a sample $\{x_i\}_{i=1}^N$, the empirical PDF -is thus constructed as +convolving the (ordered) data with a smooth symmetrical kernel: in this case a +standard Gaussian function. Given a sample of values $\{x_i\}_{i=1}^N$, the +empirical PDF is defined as: $$ f_\varepsilon(x) = \frac{1}{N\varepsilon} \sum_{i = 1}^N \mathcal{N}\left(\frac{x-x_i}{\varepsilon}\right) $$ -where $\varepsilon$ is called the *bandwidth* and is a parameter that controls -the strength of the smoothing. This parameter can be determined in several -ways: bootstrapping, cross-validation, etc. For simplicity it was chosen -to use Silverman's rule of thumb, which gives +where $\mathcal{N}$ is the kernel and the parameter $\varepsilon$, called +*bandwidth*, controls the strength of the smoothing. This parameter can be +determined in several ways: bootstrapping, cross-validation, etc. For +simplicity, it was chosen to use Silverman's rule of thumb [@silverman86], +which gives: $$ \varepsilon = 0.63 S_N \left(\frac{d + 2}{4}N\right)^{-1/(d + 4)} $$ -where - - - $S_N$ is the sample standard deviation. - - - $d$ is ne number of dimensions, in this case $d=1$ - -The $0.63$ factor was chosen to compensate for the distortion that +where the $0.63$ factor was chosen to compensate for the distortion that systematically reduces the peaks height, which affects the estimation of the -mode. +mode, and: + + - $S_N$ is the sample standard deviation, + - $d$ is the number of dimensions, in this case $d=1$. 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