spec / statistics.texon commit [spec] add statistics notes up to 15E (a11aed7)
   1\documentclass[a4paper]{article}
   2\usepackage[a4paper, margin=2cm]{geometry}
   3\usepackage{array}
   4\usepackage{amsmath}
   5\usepackage{amssymb}
   6\usepackage{tcolorbox}
   7\usepackage{fancyhdr}
   8\usepackage{pgfplots}
   9\usepackage{tabularx}
  10\usepackage{keystroke}
  11\usepackage{listings}
  12\usepackage{xcolor} % used only to show the phantomed stuff
  13\definecolor{cas}{HTML}{e6f0fe}
  14\usepackage{mathtools}
  15
  16\pagestyle{fancy}
  17\fancyhead[LO,LE]{Unit 4 Specialist --- Statistics}
  18\fancyhead[CO,CE]{Andrew Lorimer}
  19
  20\setlength\parindent{0pt}
  21
  22\begin{document}
  23
  24  \title{Statistics}
  25  \author{}
  26  \date{}
  27  \maketitle
  28
  29  \section{Linear combinations of random variables}
  30
  31  \subsection*{Continuous random variables}
  32
  33  A continuous random variable \(X\) has a pdf \(f\) such that:
  34
  35  \begin{enumerate}
  36    \item \(f(x) \ge 0 \forall x \)
  37    \item \(\int^\infty_{-\infty} f(x) \> dx = 1\)
  38  \end{enumerate}
  39
  40  \[ \Pr(X \le c) = \int^c_{-\infty} f(x) \> dx \]
  41
  42  \subsubsection*{Linear functions \(X \rightarrow aX+b\)}
  43
  44  \begin{align*}
  45    \Pr(Y \le y) &= \Pr(aX+b \le y) \\
  46    &= \Pr\left(X \le \dfrac{y-b}{a}\right) \\
  47    &= \int^{\dfrac{y-b}{a}}_{-\infty} f(x) \> dx
  48  \end{align*}
  49
  50  \begin{align*}
  51    \textbf{Mean:} && \operatorname{E}(aX+b) & = a\operatorname{E}(X)+b \\
  52    \textbf{Variance:} && \operatorname{Var}(aX+b) &= a^2 \operatorname{Var}(X) \\
  53  \end{align*}
  54
  55  \subsection*{Linear combination of two random variables}
  56
  57  \begin{align*}
  58    \textbf{Mean:} && \operatorname{E}(aX+bY) & = a\operatorname{E}(X)+b\operatorname{E}(Y) \\
  59    \textbf{Variance:} && \operatorname{Var}(aX+bY) &= a^2 \operatorname{Var}(X) + b^2 \operatorname{Var}(Y) \tag{if \(X\) and \(Y\) are independent}\\
  60  \end{align*}
  61
  62  \section{Sample mean}
  63
  64  \[ \overline{x} = \dfrac{\Sigma x}{n} \]
  65
  66  where \(n\) is the size of the sample (number of sample points)
  67
  68  \subsubsection*{\colorbox{cas}{On CAS:}}
  69
  70  \begin{enumerate}
  71    \item Spreadsheet
  72    \item In cell A1: \verb;mean(randNorm(sd, mean, sample size));
  73    \item Edit \(\rightarrow\) Fill \(\rightarrow\) Fill Range
  74    \item Input range as A1:An where \(n\) is the number of samples
  75    \item Graph \(\rightarrow\) Histogram
  76  \end{enumerate}
  77
  78  \subsubsection*{Sample size of \(n\)}
  79
  80  \[ \overline{X} = \sum_{i=1}^n \frac{x_i}{n} = \dfrac{\sum x}{n} \]
  81
  82  Sample mean is distributed with mean \(\mu\) and sd \(\frac{\sigma}{\sqrt{n}}\)
  83  
  84
  85
  86\end{document}