From 9c181ee2413546f605f8c88f9d6513583dd96cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gi=C3=B9=20Marcer?= Date: Sun, 7 Jun 2020 14:32:03 +0200 Subject: [PATCH] sections: write a lot --- slides/sections/0.md | 17 ++++++++- slides/sections/1.md | 39 +++++++++++++++---- slides/sections/2.md | 36 +++++++++++------- slides/sections/3.md | 16 ++++---- slides/sections/4.md | 91 ++++++++++++++++++++++++++++++++++---------- slides/sections/5.md | 66 ++++++++++++++++++++++++++++++++ slides/sections/6.md | 0 7 files changed, 216 insertions(+), 49 deletions(-) create mode 100644 slides/sections/5.md create mode 100644 slides/sections/6.md diff --git a/slides/sections/0.md b/slides/sections/0.md index 610af6d..0185e0e 100644 --- a/slides/sections/0.md +++ b/slides/sections/0.md @@ -1,5 +1,5 @@ --- -title: Randomness tests of a non-uniform distribution +title: Title date: \today author: - Giulia Marcer @@ -45,9 +45,24 @@ header-includes: | \hspace{30pt} \Longrightarrow \hspace{30pt} } + % "and" in formulas + \DeclareMathOperator{\et}{% + \hspace{30pt} \wedge \hspace{30pt} + } + % "with" in formulas \DeclareMathOperator{\with}{% \hspace{30pt} \text{with} \hspace{30pt} } + + % "expected" in formulas + \DeclareMathOperator{\ex}{% + ^{\text{exp}} + } + + % "observed" in formulas + \DeclareMathOperator{\ob}{% + ^{\text{obs}} + } ``` ... diff --git a/slides/sections/1.md b/slides/sections/1.md index d77bb9a..cb1ccc3 100644 --- a/slides/sections/1.md +++ b/slides/sections/1.md @@ -3,20 +3,24 @@ ## Goal -What? +- Generate a sample $L$ of points from a Landau PDF +- Generate a sample $M$ of points from a Moyal PDF -- Generate a sample of points from a Moyal PDF -- Prove it truly comes from it and not from a Landau PDF +. . . -How? +- Implement a bunch of statistical tests -- Applying some hypothesis testings +. . . + +- Check if they work: + - the sample $L$ truly comes from a Landau PDF + - the sample $M$ does not come from a Landau PDF ## Why? -The Landau and Moyal PDFs are really similar. Historically, the latter distribution was utilized in -the approximation of the Landau Distribution. +The Landau and Moyal PDFs are really similar. Historically, the latter was +utilized in the approximation of the former. :::: {.columns} ::: {.column width=33%} @@ -53,6 +57,8 @@ the approximation of the Landau Distribution. ::: :::: +\vspace{10pt} + :::: {.columns} ::: {.column width=50%} ![](images/landau-pdf.pdf) @@ -63,6 +69,25 @@ the approximation of the Landau Distribution. ::: :::: + ## Two similar distributions ![](images/both-pdf.pdf) + + +## Statistical tests + +. . . + +- Parameters comparison: + - compatibility between expected and observed PDF parameters + +. . . + +- Kolmogorov - Smirnov: + - compatibility between expected and observed CDF + +. . . + +- Trapani test: + - compatibiity between expected and observed mean diff --git a/slides/sections/2.md b/slides/sections/2.md index cab1190..f3bee03 100644 --- a/slides/sections/2.md +++ b/slides/sections/2.md @@ -12,7 +12,7 @@ Because of its fat tail: . . . -No closed form for parameters. +No closed form for parameters $\thus$ Numerical estimations ## Landau median @@ -20,38 +20,48 @@ No closed form for parameters. The median of a PDF is defined as: $$ - Q_L(m) = \frac{1}{2} + m = Q \left( \frac{1}{2} \right) $$ . . . -- CDF computed by numerical integration, +- CDF computed by numerical integration - QDF computed by numerical root-finding (Brent) $$ - m_L = 1.3557804... + m_L\ex = 1.3557804... $$ ## Landau mode -- Maxmimum $\quad \Longrightarrow \quad \partial_x M(\mu) = 0$, +- Maxmimum $\quad \Longrightarrow \quad \partial_x L(\mu) = 0$ + +. . . + - Computed by numerical minimization (Brent) $$ - \mu_L = − 0.22278... + \mu_L\ex = − 0.22278... $$ ## Landau FWHM -$$ - \text{FWHM} = x_+ - x_- \with L(x_{\pm}) - = \frac{L_{\text{max}}}{2} = \frac{L(\mu_L)}{2} -$$ - -- Computed numerically (Brent) +We need to compute the maximum: $$ - \text{FWHM}_L = 4.018645... + L_{\text{max}} = L(\mu_L) +$$ + +$$ + \text{FWHM} = w = x_+ - x_- \with L(x_{\pm}) = \frac{L_{\text{max}}}{2} +$$ + +. . . + +- Computed by numerical root finding (Brent) + +$$ + w_L\ex = 4.018645... $$ diff --git a/slides/sections/3.md b/slides/sections/3.md index f9eb128..b0604b1 100644 --- a/slides/sections/3.md +++ b/slides/sections/3.md @@ -50,7 +50,7 @@ $$ Remembering the error function $$ - \text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x dy \, e^{-y^2}, + \text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x dy \, e^{-y^2} $$ one finally gets: $$ @@ -72,14 +72,14 @@ $$ ## Moyal median -Defined by $\text{CDF}(m) = 1/2$, or $m=\text{QDF}(1/2)$. +Defined by $F(m) = \frac{1}{2}$ or $m = Q \left( \frac{1}{2} \right)$: \begin{align*} M(z) - &\thus m_M = -2 \ln \left[ \sqrt{2} \, + &\thus m_M\ex = -2 \ln \left[ \sqrt{2} \, \text{erf}^{-1} \left( \frac{1}{2} \right) \right] \\ M_{\mu \sigma}(x) - &\thus m_M = \mu -2 \sigma \ln \left[ \sqrt{2} \, + &\thus m_M\ex = \mu -2 \sigma \ln \left[ \sqrt{2} \, \text{erf}^{-1} \left( \frac{1}{2} \right) \right] \end{align*} @@ -95,8 +95,8 @@ $$ $$ \begin{align*} - \partial_x M(z) = 0 &\thus \mu_M = 0 \\ - \partial_x M_{\mu \sigma}(x) = 0 &\thus \mu_M = \mu \\ + \partial_x M(z) = 0 &\thus \mu_M\ex = 0 \\ + \partial_x M_{\mu \sigma}(x) = 0 &\thus \mu_M\ex = \mu \\ \end{align*} @@ -129,7 +129,7 @@ $$ \begin{align*} M(z) - &\thus \text{FWHM}_M = a \\ + &\thus w_M^{\text{exp}} = a \\ M_{\mu \sigma}(x) - &\thus \text{FWHM}_M = \sigma \cdot a \\ + &\thus w_M^{\text{exp}} = \sigma \cdot a \\ \end{align*} diff --git a/slides/sections/4.md b/slides/sections/4.md index 599a309..5c87d35 100644 --- a/slides/sections/4.md +++ b/slides/sections/4.md @@ -1,35 +1,86 @@ -# Data sample +# Sample parameters estimation -## PDF parameters +## Sample parameters estimation -A $M(x)$ similar to $L(x)$ can be found by imposing: +Once the points are sampled, how to estimate their median, mode and FWHM? + +. . . + +- Binning data $\quad \longrightarrow \quad$ result depending on bin-width + +. . . + +- Alternative solutions + + +## Sample median -- equal mode $$ - \mu_M = \mu_L \approx −0.22278298... -$$ - -- equal width -$$ - \text{FWHM}_M = \text{FWHM}_L = \sigma \cdot a + m = Q \left( \frac{1}{2} \right) $$ . . . +- Sort points in ascending order + +. . . + +- Middle element if odd +- Average of the two central elements if even + + +## Sample mode + +Most probable value + +. . . + +HSM + +- Iteratively identify the smallest interval containing half points +- once the sample is reduced to less than three points, take average + + +## Sample FWHM + $$ - \implies \sigma_M \approx 1.1191486 + \text{FWHM} = x_+ - x_- \with L(x_{\pm}) = \frac{L_{\text{max}}}{2} $$ +. . . -## PDF parameters +KDE -:::: {.columns} -::: {.column width=50%} - ![](images/both-pdf-bef.pdf) -::: +- empirical PDF construction: -::: {.column width=50%} - ![](images/both-pdf-aft.pdf) -::: -:::: +$$ + f_\varepsilon(x) = \frac{1}{N\varepsilon} \sum_{i = 1}^N + G \left( \frac{x-x_i}{\varepsilon} \right) +$$ + +The parameter $\varepsilon$ controls the strenght of the smoothing + + +## Sample FWHM + +Silverman's rule of thumb: + +$$ + f_\varepsilon(x) = \frac{1}{N\varepsilon} \sum_{i = 1}^N + G \left( \frac{x-x_i}{\varepsilon} \right) + \with + \varepsilon = 0.63 \, S_N + \left( \frac{d + 2}{4}N \right)^{-1/(d + 4)} +$$ + +with: + +- $S_N$ is the sample stdev +- $d$ number of dimensions ($d = 1$) + +. . . + +\vspace{10pt} + +Numerical root finding (Brent) diff --git a/slides/sections/5.md b/slides/sections/5.md new file mode 100644 index 0000000..a250422 --- /dev/null +++ b/slides/sections/5.md @@ -0,0 +1,66 @@ +# MC simulations + + +## In summary + +----------------------------------------------------- + Landau Moyal +----------------- ----------------- ----------------- +median $m_L\ex$ $m_M\ex (μ, σ)$ + +mode $\mu_L\ex$ $\mu_M\ex (μ)$ + +FWHM $w_L\ex$ $w_M\ex (σ)$ +----------------------------------------------------- + + +## PDF parameters + +A $M(x)$ similar to $L(x)$ can be found by imposing: + +\vspace{15pt} + +- equal mode +$$ + \mu_M\ex = \mu_L\ex \approx −0.22278298... +$$ + +. . . + +- equal width +$$ + w_M\ex = w_L\ex = \sigma \cdot a +$$ + +$$ + \implies \sigma_M \approx 1.1191486 +$$ + + +## PDF parameters + +:::: {.columns} +::: {.column width=50%} + ![](images/both-pdf-bef.pdf) +::: + +::: {.column width=50%} + ![](images/both-pdf-aft.pdf) +::: +:::: + + +## Different medians + +This leads to more different medians: + +\begin{align*} + m_M = 0.787... \thus &m_M = 0.658... \\ + &m_L = 1.355... +\end{align*} + + +## Samples + +- Sample $L$: N = 50'000 points following $L_(x)$ +- Sample $M$: N = 50'000 points following $M_{\mu \sigma}(x)$ diff --git a/slides/sections/6.md b/slides/sections/6.md new file mode 100644 index 0000000..e69de29