slides: improve median and mode sections

This commit is contained in:
Michele Guerini Rocco 2020-06-12 00:07:41 +02:00
parent 31240a030a
commit b639fdeea3
3 changed files with 48 additions and 35 deletions

View File

@ -10,6 +10,7 @@ institute:
theme: metropolis theme: metropolis
themeoptions: themeoptions:
- titleformat=allcaps - titleformat=allcaps
- block=fill
aspectratio: 169 aspectratio: 169
fontsize: 12pt fontsize: 12pt
@ -70,6 +71,10 @@ header-includes: |
\setbeamerfont{section title}{series=\mdseries} \setbeamerfont{section title}{series=\mdseries}
\setbeamerfont{frametitle}{series=\mdseries} \setbeamerfont{frametitle}{series=\mdseries}
% trick to put markdown inside LaTeX
\let\Begin\begin
\let\End\end
% workaround issue matze/mtheme#371 % workaround issue matze/mtheme#371
\def\sectionpage{ \def\sectionpage{
\centering \centering

View File

@ -19,25 +19,45 @@
. . . . . .
\begin{center} \begin{center}
No closed form for \textcolor{cyclamen}{ANYTHING} No closed form for \alert{ANYTHING}
\end{center} \end{center}
## Landau median ## Landau median
The median of a PDF is defined as: ::::: {.columns}
$$ :::: {.column width=50%}
m = Q \left( \frac{1}{2} \right)
$$
. . . ::: incremental
- The median of $f$ is defined by
$$
F(m) = \int_{-\infty}^m fdx = \frac{1}{2}
$$
- Equivalently
$$
m = F^{-1}\left(\frac{1}{2}\right)
$$
- Numerical integration or QDF is needed
:::
::::
::: {.column width=50%}
![](images/median.pdf)
:::
:::::
## Landau median
- CDF computed by numerical integration - CDF computed by numerical integration
- QDF computed by numerical root-finding (Brent) - QDF computed by numerical root-finding
\setbeamercovered{} \setbeamercovered{}
\begin{center} \begin{center}
\begin{tikzpicture}[remember picture] \begin{tikzpicture}[remember picture]
\node at (0,0) (here) {$m_L\ex = 1.3557804...$}; \node at (0,0) (here) {$m_L\ex = 1.3557804...$};
@ -77,7 +97,6 @@ We need to compute the maximum:
$$ $$
L_{\text{max}} = L(\mu_L) L_{\text{max}} = L(\mu_L)
$$ $$
$$ $$
\text{FWHM} = w = x_+ - x_- \with L(x_{\pm}) = \frac{L_{\text{max}}}{2} \text{FWHM} = w = x_+ - x_- \with L(x_{\pm}) = \frac{L_{\text{max}}}{2}
$$ $$

View File

@ -18,29 +18,16 @@ How to estimate sample median, mode and FWHM?
## Sample median ## Sample median
:::: {.columns align=bottom} \Begin{block}{Algorithm}
::: {.column width=50%} ::: incremental
$$ 1. Sort sample in ascending order
F(m) = \frac{1}{2} 2.
$$ Take middle element if odd
\vspace{20pt} Take average of two middle elements if even
. . .
- Sort points in ascending order
. . .
- Middle element if odd
Average of the two central elements if even
::: :::
::: {.column width=50%} \End{block}
![](images/median.pdf)
:::
::::
\setbeamercovered{} \setbeamercovered{}
\begin{center} \begin{center}
@ -80,17 +67,19 @@ How to estimate sample median, mode and FWHM?
## Sample mode ## Sample mode
Half Sample Mode[@robertson74] **Half Sample Mode** [@robertson74]
\Begin{block}{Algorithm}
- Find the smallest interval containing half points ::: incremental
- Repeat 1. Find the smallest interval containing half points
- If the sample has less than three points, take average 2. Repeat on the new interval (called modal)
3. If the interval has less than three points, take average
:::
\End{block}
. . . . . .
\setbeamercovered{} \setbeamercovered{}
\begin{center} \begin{center}
\begin{tikzpicture}[remember picture, >=Stealth] \begin{tikzpicture}[remember picture, >=Stealth]
% line % line