
% BB Sep 05, 2007.
% BB Nov 21, 2006.
% BB Aug 28, 2005.

\documentclass[20pt,landscape,footrule]{foils}
\usepackage[dvips]{graphicx}
\usepackage[pdftex]{geometry}
\geometry{headsep=3ex,hscale=0.9}
\usepackage[pdftex]{color} % for the colored block
% \date{\color{blue} Leipzig University, December 16, 2004}
\date{\color{blue} FSU,  August 31, 2006}
\usepackage[ignore]{pause}
% \usepackage{pause}
\usepackage{background}
%\usepackage{pp4slide}
%\MyLogo{AV HEP,CSIT}
\LogoOff
\begin{document}
\def\r{\color{red}}
\def\b{\color{blue}}
\def\s{\color{black}}

\foilhead{\r Lecturenotes Statistics I -- Contents}\b \vskip 0.0pt
\begin{enumerate}
\item Uniform and General Distributions
\item Confidence Intervals, Cumulative Distribution Function and Sorting
\end{enumerate}
 
\foilhead{\r Uniform and General Distributions}\b \vskip -30.0pt
Uniform distribution (probability density):
$$\s u(x) = \cases{ 1~~{\rm for}~~0\le x < 1;\cr
                    0 ~~{\rm elsewhere}. } $$ \b
The corresponding (cumulative) distribution function is \s
$$ U(x) = \int_{-\infty}^x u(x')\,dx' = \cases{
   0~~{\rm for}~~x<0;\cr
   x~~{\rm for}~~0\le x\le 1;\cr 1~~{\rm for}~~x>1.} $$ \b
It allows for the construction of general probability distributions.  
Let \s
$$ y = F(x) = \int_{-\infty}^x f(x')\,dx'\ . $$ \b

\foilhead{\r } \b \vskip -50.0pt
For \s $y^r$ \b being a uniformly distributed random variable in 
\s $[0,1)$: $x^r = F^{-1} (y^r)$ \b is then distributed according 
to the probability density $\s f(x).$ \bigskip

{\r\bf Example:} Mapping of the uniform to the {\r Cauchy distribution.}
$$\s f_c(x) = {\alpha \over \pi\, (\alpha^2+x^2)} ~~{\rm and}~~ F_c(x) 
     = \int_{-\infty}^x f_c(x')\,dx' = {1\over 2} + {1\over\pi}\,
     \tan^{-1} \left( {x\over\alpha} \right),\ \alpha>0\, . $$
The Cauchy distributed random variable $\s x^r$ is generated from the 
uniform $\s y^r\in[0,1)$ through 
$$\s \frac{x^r}{\alpha} = \tan\left(\pi y^r-\frac{\pi}{2}\right)\ \
     \Leftrightarrow\ \ x^r = \alpha\,\tan (2\pi y^r)\,. $$

\begin{figure} \begin{center}
\includegraphics[height=0.7\textheight]{figures/gdf.pdf}
% \caption{\small Mapping of the uniform to the Cauchy distribution.}
\end{center} \end{figure}

In STMC/Forlib: {\tt rmacau.f}.

\foilhead{\r Gaussian Distribution}\vskip -20pt \b
The Gaussian or {\bf normal distribution} is of major 
importance. Its probability density is 
$$\s g(x) = {1\over \sigma \sqrt{2\pi}}\, e^{-x^2/(2\sigma^2)} $$
where $\s \sigma^2$ is the {\bf variance} and $\s \sigma > 0$ the
{\bf standard deviation}. The Gaussian distribution function 
$\s G(x)$ is related to that of variance $\s \sigma^2=1$ by 
$$\s G(x) = \int_{-\infty}^x g(x')\,dx' = {1\over \sqrt{2\pi}}
     \int_{-\infty}^{x/\sigma} e^{-(x'')^2/2}\, dx'' = {1\over 2} 
   + {1\over 2}\, {\rm erf} \left( {x\over \sigma\sqrt{2}} \right)\ .$$
\b In principle we could now generate {\bf Gaussian random numbers}. 
However, the numerical calculation of the inverse error function 
is slow and makes this an impractical procedure. Much faster is 
to express the product probability density of two independent 
Gaussian distributions in polar coordinates
$$\s {1\over 2\pi\,\sigma^2}\,e^{-x^2/(2\sigma^2)}\,e^{-y^2/(2\sigma^2)}
\, dx\,dy ={1\over 2\pi\,\sigma^2}\,e^{-r^2/(2\sigma^2)}\,d\phi\,rdr\,,$$
and to use the relations \s $x^r = r^r\, \cos \phi^r$, 
$y^r = r^r\, \sin \phi^r\,.$

% \begin{figure} \begin{center}
% \includegraphics[height=0.5\textheight]{figures/df.pdf}
% \end{center} \end{figure} 

\noindent {\r Assignments {\tt a0104\_01} and {\tt a0104\_02}:} \b

\noindent Probability densities and cumulative distribution functions
for the uniform in $\s [-1,+1)$, a Gaussian and a Cauchy distribution.


\foilhead{\r Confidence Intervals and Sorting}\b \vskip -20pt

\noindent One defines {\bf ${\bf q}$-tiles} (also {\bf quantiles} or 
{\bf fractiles}) $\s x_q$ of a distribution function by 
$$\s F(x_q)\ =\ q\ . $$
An example is the {\bf median} $\s x_{1\over 2}.$ The probability 
content of the {\bf confidence interval}
$$\s [x_q,x_{1-q}] ~~{\rm is}~~ p=1-2q\ .$$
Example: {\r Gaussian or normal distribution} of variance 
$\s \sigma^2:$
$$\s [-n\sigma,+n\sigma]\ \Rightarrow\ p=0.6827\ {\rm for}\ n=1,~~
     p=0.9545\ {\rm for}\ n=2\ .$$
The {\bf peaked distribution function} 
$$\s F_q(x) = \cases{ F(x)\ {\rm for}\ F(x) \le {1\over 2},\cr
                 1 - F(x)\ {\rm for}\ F(x) > {1\over 2}.} $$
provides a graphical visualization of probability intervals of
such a distribution:
%
\begin{figure} \begin{center}
\includegraphics[height=0.5\textheight]{figures/gqdf.pdf}
% \caption{\small Gaussian peaked distribution function and estimates 
% of $x_q$ for the 70\% (approximately $1\,\sigma$) and 95\% 
% (approximately $2\,\sigma$) confidence intervals.}
\end{center} \end{figure}

\noindent {\r Sorting} allows for an empirical estimate. Assume we 
generate $\s n$ random number $\s x_1,...,x_n$. We may re-arrange 
the $\s x_i$ in increasing order:
$$\s x_{\pi_1} \le x_{\pi_2} \le \dots \le x_{\pi_n} $$
where $\s \pi_1,\dots , \pi_n$ is a permutation of $\s 1,\dots ,n$.

\noindent An estimator for the distribution function $\s F(x)$ is 
then the {\bf empirical distribution function}
$$\s \overline{F} (x) = {i\over n}~~~{\rm for}~~~x_{\pi_i} \le x <
     x_{\pi_{i+1}},\ i=0, 1,\dots , n-1, n $$
with the definitions $\s x_{\pi_0}=-\infty$ and $\s x_{\pi_{n+1}} =
+\infty$. To calculate $\s \overline{F}(x)$ one needs an efficient way 
to {\bf sort} $n$ data values in ascending (or descending) order. In 
the STMC package this is provided by a {\bf heapsort} routine, which 
arrives at the results in $\s O(n\,\log_2 n)$ steps.

\noindent Example: {\r Gaussian distribution in assignment 
          {\tt a0106\_02}} (200 and 20,000 data). \vskip 20pt


\end{document}



