From: Andrew Lorimer Date: Fri, 23 Aug 2019 01:55:14 +0000 (+1000) Subject: [spec] normal distribution graph X-Git-Tag: yr12~58 X-Git-Url: https://git.lorimer.id.au/notes.git/diff_plain/774f1e17c8ce4d519877f744d951c2cf112df951?ds=inline [spec] normal distribution graph --- diff --git a/spec/statistics.pdf b/spec/statistics.pdf index 357175e..56f9c83 100644 Binary files a/spec/statistics.pdf and b/spec/statistics.pdf differ diff --git a/spec/statistics.tex b/spec/statistics.tex index 7c89068..0b6f4ce 100644 --- a/spec/statistics.tex +++ b/spec/statistics.tex @@ -45,7 +45,7 @@ \begin{align*} \Pr(Y \le y) &= \Pr(aX+b \le y) \\ &= \Pr\left(X \le \dfrac{y-b}{a}\right) \\ - &= \int^{\dfrac{y-b}{a}}_{-\infty} f(x) \> dx + &= \int^{\frac{y-b}{a}}_{-\infty} f(x) \> dx \end{align*} \begin{align*} @@ -68,7 +68,7 @@ where \(n\) is the size of the sample (number of sample points) and \(x\) is the value of a sample point - \subsubsection*{\colorbox{cas}{On CAS:}} + \begin{tcolorbox}[colframe=cas!75!black, title=On CAS] \begin{enumerate} \item Spreadsheet @@ -77,6 +77,7 @@ \item Input range as A1:An where \(n\) is the number of samples \item Graph \(\rightarrow\) Histogram \end{enumerate} + \end{tcolorbox} \subsubsection*{Sample size of \(n\)} @@ -84,8 +85,13 @@ Sample mean is distributed with mean \(\mu\) and sd \(\frac{\sigma}{\sqrt{n}}\) (approaches these values for increasing sample size \(n\)). - \colorbox{cas}{On CAS:} Spreadsheet \(\rightarrow\) Catalog \(\rightarrow\) \verb;randNorm(sd, mean, n); where \verb;n; is the number of samples. Show histogram with Histogram key in top left \\ - To calculate parameters of a dataset: Calc \(\rightarrow\) One-variable + \begin{tcolorbox}[colframe=cas!75!black, title=On CAS] + + \begin{itemize} + \item Spreadsheet \(\rightarrow\) Catalog \(\rightarrow\) \verb;randNorm(sd, mean, n); where \verb;n; is the number of samples. Show histogram with Histogram key in top left + \item To calculate parameters of a dataset: Calc \(\rightarrow\) One-variable + \end{itemize} + \end{tcolorbox} \section{Normal distributions} @@ -93,27 +99,44 @@ \[ Z = \frac{X - \mu}{\sigma} \] - Normal distributions must have are (total prob.) of 1 \(\implies \int^\infty_{-\infty} f(x) \> dx = 1\) + Normal distributions must have area (total prob.) of 1 \(\implies \int^\infty_{-\infty} f(x) \> dx = 1\) \pgfmathdeclarefunction{gauss}{2}{% \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% } -\begin{tikzpicture} +{\begin{center} \begin{tikzpicture} + \pgfplotsset{set layers} \begin{axis}[every axis plot post/.append style={ - mark=none,domain=-3:3,samples=50,smooth}, % All plots: from -2:2, 50 samples, smooth, no marks - axis x line*=bottom, % no box around the plot, only x and y axis - axis y line*=left, % the * suppresses the arrow tips + mark=none,domain=-3:3,samples=50,smooth}, + axis x line=bottom, + axis y line=left, enlargelimits=upper, - ytick={0.5}, + x=\textwidth/10, + ytick={0.55}, yticklabels={\(\frac{1}{\sigma \sqrt{2\pi}}\)}, xtick={-2,-1,0,1,2}, - xticklabels={\(\mu-2\sigma\), \(\mu-\sigma\), \(\mu\), \(\mu+\sigma\), \(\mu+2\sigma\)}, + x tick label style = {font=\footnotesize}, + xticklabels={\((\mu-2\sigma)\), \((\mu-\sigma)\), \(\mu\), \((\mu+\sigma)\), \((\mu+2\sigma)\)}, xlabel={\(x\)}, every axis x label/.style={at={(current axis.right of origin)},anchor=north west}, + every axis y label/.style={at={(axis description cs:-0.02,0.2)}, anchor=south west, rotate=90}, ylabel={\(\Pr(X=x)\)}] \addplot {gauss(0,0.75)}; \end{axis} -\end{tikzpicture} +\begin{axis}[every axis plot post/.append style={ + mark=none,domain=-3:3,samples=50,smooth}, + axis x line=bottom, + enlargelimits=upper, + x=\textwidth/10, + xtick={-2,-1,0,1,2}, + axis x line shift=30pt, + hide y axis, + x tick label style = {font=\footnotesize}, + xlabel={\(Z\)}, + every axis x label/.style={at={(axis description cs:1,-0.25)},anchor=south west}] + \addplot {gauss(0,0.75)}; +\end{axis} +\end{tikzpicture}\end{center}} \section{Central limit theorem}