diff --git a/Lectures_my/MC_2016/Lecture5/images/test1.png b/Lectures_my/MC_2016/Lecture5/images/test1.png new file mode 100644 index 0000000..82be93a --- /dev/null +++ b/Lectures_my/MC_2016/Lecture5/images/test1.png Binary files differ diff --git a/Lectures_my/MC_2016/Lecture5/mchrzasz.aux b/Lectures_my/MC_2016/Lecture5/mchrzasz.aux index d9acde1..5a5fe7d 100644 --- a/Lectures_my/MC_2016/Lecture5/mchrzasz.aux +++ b/Lectures_my/MC_2016/Lecture5/mchrzasz.aux @@ -58,13 +58,49 @@ \pgfsyspdfmark {pgfid18}{0}{0} \pgfsyspdfmark {pgfid19}{0}{0} \HyPL@Entry{5<>} -\pgfsyspdfmark {pgfid20}{23867907}{17900937} +\pgfsyspdfmark {pgfid22}{23867907}{17900937} \@writefile{nav}{\headcommand {\slideentry {0}{0}{6}{6/6}{}{0}}} \@writefile{nav}{\headcommand {\beamer@framepages {6}{6}}} -\pgfsyspdfmark {pgfid21}{0}{0} -\pgfsyspdfmark {pgfid22}{0}{0} -\@writefile{nav}{\headcommand {\beamer@partpages {1}{6}}} -\@writefile{nav}{\headcommand {\beamer@subsectionpages {1}{6}}} -\@writefile{nav}{\headcommand {\beamer@sectionpages {1}{6}}} -\@writefile{nav}{\headcommand {\beamer@documentpages {6}}} -\@writefile{nav}{\headcommand {\def \inserttotalframenumber {5}}} +\pgfsyspdfmark {pgfid23}{0}{0} +\pgfsyspdfmark {pgfid24}{0}{0} +\HyPL@Entry{6<>} +\pgfsyspdfmark {pgfid25}{23867907}{17900937} +\@writefile{nav}{\headcommand {\slideentry {0}{0}{7}{7/7}{}{0}}} +\@writefile{nav}{\headcommand {\beamer@framepages {7}{7}}} +\pgfsyspdfmark {pgfid26}{0}{0} +\pgfsyspdfmark {pgfid27}{0}{0} +\HyPL@Entry{7<>} +\pgfsyspdfmark {pgfid31}{23867907}{17900937} +\@writefile{nav}{\headcommand {\slideentry {0}{0}{8}{8/8}{}{0}}} +\@writefile{nav}{\headcommand {\beamer@framepages {8}{8}}} +\pgfsyspdfmark {pgfid32}{0}{0} +\pgfsyspdfmark {pgfid33}{0}{0} +\HyPL@Entry{8<>} +\pgfsyspdfmark {pgfid34}{23867907}{17900937} +\@writefile{nav}{\headcommand {\slideentry {0}{0}{9}{9/9}{}{0}}} +\@writefile{nav}{\headcommand {\beamer@framepages {9}{9}}} +\pgfsyspdfmark {pgfid35}{0}{0} +\pgfsyspdfmark {pgfid36}{0}{0} +\HyPL@Entry{9<>} +\pgfsyspdfmark {pgfid37}{23867907}{17900937} +\@writefile{nav}{\headcommand {\slideentry {0}{0}{10}{10/10}{}{0}}} +\@writefile{nav}{\headcommand {\beamer@framepages {10}{10}}} +\pgfsyspdfmark {pgfid38}{0}{0} +\pgfsyspdfmark {pgfid39}{0}{0} +\HyPL@Entry{10<>} +\pgfsyspdfmark {pgfid40}{23867907}{17900937} +\@writefile{nav}{\headcommand {\slideentry {0}{0}{11}{11/11}{}{0}}} +\@writefile{nav}{\headcommand {\beamer@framepages {11}{11}}} +\pgfsyspdfmark {pgfid41}{0}{0} +\pgfsyspdfmark {pgfid42}{0}{0} +\HyPL@Entry{11<>} +\pgfsyspdfmark {pgfid43}{23867907}{17900937} +\@writefile{nav}{\headcommand {\slideentry {0}{0}{12}{12/12}{}{0}}} +\@writefile{nav}{\headcommand {\beamer@framepages {12}{12}}} +\pgfsyspdfmark {pgfid44}{0}{0} +\pgfsyspdfmark {pgfid45}{0}{0} +\@writefile{nav}{\headcommand {\beamer@partpages {1}{12}}} +\@writefile{nav}{\headcommand {\beamer@subsectionpages {1}{12}}} +\@writefile{nav}{\headcommand {\beamer@sectionpages {1}{12}}} +\@writefile{nav}{\headcommand {\beamer@documentpages {12}}} +\@writefile{nav}{\headcommand {\def \inserttotalframenumber {11}}} diff --git a/Lectures_my/MC_2016/Lecture5/mchrzasz.log b/Lectures_my/MC_2016/Lecture5/mchrzasz.log index ac00b76..6c8ccbd 100644 --- a/Lectures_my/MC_2016/Lecture5/mchrzasz.log +++ b/Lectures_my/MC_2016/Lecture5/mchrzasz.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2015.4.1) 13 MAR 2016 14:30 +This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2015.4.1) 19 MAR 2016 21:05 entering extended mode restricted \write18 enabled. %&-line parsing enabled. @@ -2852,7 +2852,8 @@ [5 ] -\c@framenumberappendix=\count453 +File: images/test1.png Graphic file (type QTm) + File: images/BG_lower.png Graphic file (type QTm) Overfull \vbox (19.18185pt too high) has occurred while \output is active [] @@ -2874,6 +2875,143 @@ [6 ] +File: images/BG_lower.png Graphic file (type QTm) + +Overfull \vbox (19.18185pt too high) has occurred while \output is active [] + +................................................. +. fontspec info: "no-scripts" +. +. Font Trebuchet MS does not contain any OpenType `Script' information. +................................................. +................................................. +. fontspec info: "defining-font" +. +. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options +. [Mapping=tex-text,]. +. +. This font family consists of the following shapes: +................................................. + +[7 + +] +File: images/BG_lower.png Graphic file (type QTm) + +Overfull \vbox (19.18185pt too high) has occurred while \output is active [] + +................................................. +. fontspec info: "no-scripts" +. +. Font Trebuchet MS does not contain any OpenType `Script' information. +................................................. +................................................. +. fontspec info: "defining-font" +. +. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options +. [Mapping=tex-text,]. +. +. This font family consists of the following shapes: +................................................. + +[8 + +] + +Package amsmath Warning: Foreign command \atopwithdelims; +(amsmath) \frac or \genfrac should be used instead +(amsmath) on input line 453. + + +Overfull \hbox (9.57285pt too wide) in paragraph at lines 453--453 +[] + [] + +File: images/BG_lower.png Graphic file (type QTm) + +Overfull \vbox (19.18185pt too high) has occurred while \output is active [] + +................................................. +. fontspec info: "no-scripts" +. +. Font Trebuchet MS does not contain any OpenType `Script' information. +................................................. +................................................. +. fontspec info: "defining-font" +. +. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options +. [Mapping=tex-text,]. +. +. This font family consists of the following shapes: +................................................. + +[9 + +] +File: images/BG_lower.png Graphic file (type QTm) + +Overfull \vbox (19.18185pt too high) has occurred while \output is active [] + +................................................. +. fontspec info: "no-scripts" +. +. Font Trebuchet MS does not contain any OpenType `Script' information. +................................................. +................................................. +. fontspec info: "defining-font" +. +. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options +. [Mapping=tex-text,]. +. +. This font family consists of the following shapes: +................................................. + +[10 + +] +File: images/BG_lower.png Graphic file (type QTm) + +Overfull \vbox (19.18185pt too high) has occurred while \output is active [] + +................................................. +. fontspec info: "no-scripts" +. +. Font Trebuchet MS does not contain any OpenType `Script' information. +................................................. +................................................. +. fontspec info: "defining-font" +. +. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options +. [Mapping=tex-text,]. +. +. This font family consists of the following shapes: +................................................. + +[11 + +] +\c@framenumberappendix=\count453 +File: images/BG_lower.png Graphic file (type QTm) + +Overfull \vbox (19.18185pt too high) has occurred while \output is active [] + +................................................. +. fontspec info: "no-scripts" +. +. Font Trebuchet MS does not contain any OpenType `Script' information. +................................................. +................................................. +. fontspec info: "defining-font" +. +. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options +. [Mapping=tex-text,]. +. +. This font family consists of the following shapes: +................................................. + +[12 + +] \tf@nav=\write11 \openout11 = `mchrzasz.nav'. @@ -2883,23 +3021,23 @@ \tf@snm=\write13 \openout13 = `mchrzasz.snm'. -Package atveryend Info: Empty hook `BeforeClearDocument' on input line 367. -Package atveryend Info: Empty hook `AfterLastShipout' on input line 367. +Package atveryend Info: Empty hook `BeforeClearDocument' on input line 506. +Package atveryend Info: Empty hook `AfterLastShipout' on input line 506. (./mchrzasz.aux) -Package atveryend Info: Empty hook `AtVeryEndDocument' on input line 367. -Package atveryend Info: Empty hook `AtEndAfterFileList' on input line 367. +Package atveryend Info: Empty hook `AtVeryEndDocument' on input line 506. +Package atveryend Info: Empty hook `AtEndAfterFileList' on input line 506. Package logreq Info: Writing requests to 'mchrzasz.run.xml'. \openout1 = `mchrzasz.run.xml'. -Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 367. +Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 506. ) Here is how much of TeX's memory you used: - 50360 strings out of 493918 - 987745 string characters out of 6150564 + 50392 strings out of 493918 + 988370 string characters out of 6150564 1340072 words of memory out of 5000000 - 52623 multiletter control sequences out of 15000+600000 + 52654 multiletter control sequences out of 15000+600000 37184 words of font info for 148 fonts, out of 8000000 for 9000 1144 hyphenation exceptions out of 8191 - 55i,17n,77p,10405b,1435s stack positions out of 5000i,500n,10000p,200000b,80000s + 55i,18n,77p,10405b,1453s stack positions out of 5000i,500n,10000p,200000b,80000s -Output written on mchrzasz.pdf (6 pages). +Output written on mchrzasz.pdf (12 pages). diff --git a/Lectures_my/MC_2016/Lecture5/mchrzasz.nav b/Lectures_my/MC_2016/Lecture5/mchrzasz.nav index 8159baa..480bb26 100644 --- a/Lectures_my/MC_2016/Lecture5/mchrzasz.nav +++ b/Lectures_my/MC_2016/Lecture5/mchrzasz.nav @@ -12,8 +12,20 @@ \headcommand {\beamer@framepages {5}{5}} \headcommand {\slideentry {0}{0}{6}{6/6}{}{0}} \headcommand {\beamer@framepages {6}{6}} -\headcommand {\beamer@partpages {1}{6}} -\headcommand {\beamer@subsectionpages {1}{6}} -\headcommand {\beamer@sectionpages {1}{6}} -\headcommand {\beamer@documentpages {6}} -\headcommand {\def \inserttotalframenumber {5}} +\headcommand {\slideentry {0}{0}{7}{7/7}{}{0}} +\headcommand {\beamer@framepages {7}{7}} +\headcommand {\slideentry {0}{0}{8}{8/8}{}{0}} +\headcommand {\beamer@framepages {8}{8}} +\headcommand {\slideentry {0}{0}{9}{9/9}{}{0}} +\headcommand {\beamer@framepages {9}{9}} +\headcommand {\slideentry {0}{0}{10}{10/10}{}{0}} +\headcommand {\beamer@framepages {10}{10}} +\headcommand {\slideentry {0}{0}{11}{11/11}{}{0}} +\headcommand {\beamer@framepages {11}{11}} +\headcommand {\slideentry {0}{0}{12}{12/12}{}{0}} +\headcommand {\beamer@framepages {12}{12}} +\headcommand {\beamer@partpages {1}{12}} +\headcommand {\beamer@subsectionpages {1}{12}} +\headcommand {\beamer@sectionpages {1}{12}} +\headcommand {\beamer@documentpages {12}} +\headcommand {\def \inserttotalframenumber {11}} diff --git a/Lectures_my/MC_2016/Lecture5/mchrzasz.pdf b/Lectures_my/MC_2016/Lecture5/mchrzasz.pdf index e44a233..ca23074 100644 --- a/Lectures_my/MC_2016/Lecture5/mchrzasz.pdf +++ b/Lectures_my/MC_2016/Lecture5/mchrzasz.pdf Binary files differ diff --git a/Lectures_my/MC_2016/Lecture5/mchrzasz.synctex.gz b/Lectures_my/MC_2016/Lecture5/mchrzasz.synctex.gz new file mode 100644 index 0000000..6b84b75 --- /dev/null +++ b/Lectures_my/MC_2016/Lecture5/mchrzasz.synctex.gz Binary files differ diff --git a/Lectures_my/MC_2016/Lecture5/mchrzasz.tex b/Lectures_my/MC_2016/Lecture5/mchrzasz.tex index ae4623c..ed2894d 100644 --- a/Lectures_my/MC_2016/Lecture5/mchrzasz.tex +++ b/Lectures_my/MC_2016/Lecture5/mchrzasz.tex @@ -46,7 +46,7 @@ \usepackage{graphicx} \usepackage[export]{adjustbox} -\usepackage{amsmath, amssymb} +\usepackage{amsmath, amssymb} \usepackage{amsmath} \usepackage{amsfonts} @@ -354,6 +354,145 @@ \end{frame} +\begin{frame}\frametitle{Overlaping-pairs-sparse-occupancy} + \begin{footnotesize} +\ARROW The OPSO (G.Marsaglia 1984)is an analysis of pairs obtained from random number generator.\\ +\begin{exampleblock}{} +$X_1,X_2,...,X_n$ - $n$ random numbers obtained from generator. From each number we take $b$ bits from which we construct a second series: $I_1, I_2,...,I_n$, where $I_j \in \left[0,1,...,2^b-1 \right]$.\end{exampleblock} +\ARROW Next we create the pair series: +\begin{align*} +(I_1,I_2),(I_2,I_3),...(I_{n-1}, I_n) +\end{align*} +\ARROW $Y$ - number of pairs from : ${ (i,j):i,j=0,1,...,2^b-1}$, which DIDN'T occur in the above series. +\begin{center} +\includegraphics[width=0.35\textwidth]{images/test1.png} +\end{center} +\ARROW This kind of test can be exteded to triple-pairs, and quadro-pairs.\\ +\ARROW See DIEHARD G.Marsgalia 1993 \href{http://stat.fsu.edu/pub/diehard/}{http://stat.fsu.edu/pub/diehard/} + + \end{footnotesize} + \end{frame} + +\begin{frame}\frametitle{Kolomogorox-Smirnow} + \begin{footnotesize} +\ARROW The K-S test is used to check if a Random variable has pdf of a distribution $F$. The test is based on the difference between the two distributions: +\begin{align*} +D_n=\sup_{-\infty < x<\infty} \vert F_n(x) -F(x) \vert,~~~~~F_n =\dfrac{1}{n}\sum_{j=1}^n \Theta(x-X_j). +\end{align*} +\ARROW If the random generator is from the $F$ distribution then the $D_n \to 0$ with the probability 1.\\ \ARROW Large values of $D_n$ exclude the generator. +\ARROW The critical values of the test $D_n(\alpha)$ can be find in the mathematical tables for every $\alpha$: +\begin{align*} +\mathcal{P}[D_n0 +\end{align*} +for which the critical values $\lambda_{\alpha}(\mathcal{P}\lbrace\sqrt{n}D_n>\lambda_{\alpha}$ can be found in the mathematical tables.\\ +\ARROW Commonly the $\lambda_{0.1}=1.224$, $\lambda_{0.05}=1.358$, $\lambda_{0.01}=1.628$ are used. + + + + \end{footnotesize} +\end{frame} + +\begin{frame}\frametitle{Statistic distributions test- sum test} + \begin{footnotesize} +\ARROW The $h$ function has the form: +\begin{align*} +y=x_1+x_2+x_3...x_m. +\end{align*} +\ARROW the random variables form the new pdf: +\begin{align*} +g_m(y)=\begin{cases} +\dfrac{1}{m-1} \left[ y^{m-1} - {m \choose 1}(y-1)^{m-1} +{m \choose 2}(y-2)^{m-1}-.. \right]~~&{\rm for} 0\leq y\leq m,\\ +0~~&{\rm else} +\end{cases} +\end{align*} +where you stop when $y-m$ is negative. +\ARROW For $m=2$ we have the triangle pdf: +\begin{align*} +g_2(y) =\begin{cases} +y,~{\rm for}~0 \leq y \leq 1\\ +2-y,~{\rm for}~0 \leq y \leq 1\\ +\end{cases} +\end{align*} +\ARROW For $m=3$ we have the triangle pdf: +\begin{align*} +g_3(y) =\begin{cases} +\dfrac{1}{2} y^2,~{\rm for}~0 \leq y \leq 1\\ +\dfrac{1}{2} \left[y^2-3(y-1)^2\right],~{\rm for}~1 \leq y \leq 2\\ +\dfrac{1}{2} \left[y^2-3(y-1)^2 3(y-2)^2 \right],~{\rm for}~2 \leq y \leq 3\\ +\end{cases} +\end{align*} +\ARROW For large $m$ the $g_m$ approaches the normal distribution. + + \end{footnotesize} +\end{frame} + +\begin{frame}\frametitle{Statistic distributions test- $d^2$} + \begin{footnotesize} +\ARROW for $m=4$ we define the $h$: + \begin{align*} + y=(x_1-x_3)^2 +(x_2-X_4)^2 + \end{align*} +aka the square distance between $(x_1,x_2)$ and $(x_3,x_4)$.\\ +\ARROW If the $X_1$, $X_2$, $X_3$, $X_4$ are from $\mathcal{U}(0,1)$ then: +\begin{align*} +d^2 = (X_1-X_3)^2+(X_2-X_4)^2 +\end{align*} +had a pdf given by the following formula: +\begin{align*} +\mathcal{P}(d^2-y) =\begin{cases} +\pi y - \dfrac{8}{3}y^{\dfrac{3}{2}} + \dfrac{1}{2} y^2 ~~ &{\rm for }~0 \leq y \leq1 \\ +-\dfrac{1}{2} y^2-4 {\rm arcsec} (y^{\dfrac{1}{2}})~~ &{\rm for}~ 1 \leq y \leq2 \\ +\end{cases} +\end{align*} +\ARROW Test is to check if the generated numbers have the aforementioned distribution. + + \end{footnotesize} +\end{frame} + + +\begin{frame}\frametitle{Statistic distributions test- pair distance} + \begin{footnotesize} +\ARROW Generate $n$ points from $(0,1)^m$. We take ${ n \choose 2}$ pairs of points and we calculate the distance between them.\\ +\ARROW If $D$ is the smallest distance between the pairs $\longmapsto$ for the $\mathcal{U}(0,1)^m$ the $T=n^2D^m/2$ has the exponential distribution with the mean $1/V_m$, where $V_m$ is the hiper volume of the unite ball.\\ +\ARROW In Patrice:\\ +\begin{itemize} +\item We generate $Nn$ points in the hipercube $(0,1)^m$, getting $N$ points in the $T$ statistics. +\item We compare the empirical distribution $T$ with the exponential distribution. +\item WARNING: the $N,n,m$ need to be choose smartly for the test to make sense. +\end{itemize} +\ARROW Linear generators usually fail this test! + \end{footnotesize} +\end{frame} + + + + \backupbegin