Independent events


Example


Example


Example: continued


Useful fact

We will use the following fact extensively in this class:

If a collection of random variables \( X_1, X_2, \ldots, X_n \) are independent, then their joint distribution is the product of their individual densities or mass functions

That is, if \( f_i \) is the density for random variable \( X_i \) we have that \[ f(x_1,\ldots, x_n) = \prod_{i=1}^n f_i(x_i) \]


IID random variables


Example


Correlation


Correlation

  1. \( -1 \leq Cor(X, Y) \leq 1 \)
  2. \( Cor(X, Y) = \pm 1 \) if and only if \( X = a + bY \) for some constants \( a \) and \( b \)
  3. \( Cor(X, Y) \) is unitless
  4. \( X \) and \( Y \) are uncorrelated if \( Cor(X, Y) = 0 \)
  5. \( X \) and \( Y \) are more positively correlated, the closer \( Cor(X,Y) \) is to \( 1 \)
  6. \( X \) and \( Y \) are more negatively correlated, the closer \( Cor(X,Y) \) is to \( -1 \)

Some useful results


The sample mean

Suppose \( X_i \) are iid with variance \( \sigma^2 \)

\[ \begin{eqnarray*} Var(\bar X) & = & Var \left( \frac{1}{n}\sum_{i=1}^n X_i \right)\\ \\ & = & \frac{1}{n^2} Var\left(\sum_{i=1}^n X_i \right)\\ \\ & = & \frac{1}{n^2} \sum_{i=1}^n Var(X_i) \\ \\ & = & \frac{1}{n^2} \times n\sigma^2 \\ \\ & = & \frac{\sigma^2}{n} \end{eqnarray*} \]


Some comments


The sample variance


The sample variance is unbiased

\[ \begin{eqnarray*} E\left[\sum_{i=1}^n (X_i - \bar X)^2\right] & = & \sum_{i=1}^n E\left[X_i^2\right] - n E\left[\bar X^2\right] \\ \\ & = & \sum_{i=1}^n \left\{Var(X_i) + \mu^2\right\} - n \left\{Var(\bar X) + \mu^2\right\} \\ \\ & = & \sum_{i=1}^n \left\{\sigma^2 + \mu^2\right\} - n \left\{\sigma^2 / n + \mu^2\right\} \\ \\ & = & n \sigma^2 + n \mu ^ 2 - \sigma^2 - n \mu^2 \\ \\ & = & (n - 1) \sigma^2 \end{eqnarray*} \]


Hoping to avoid some confusion


Example

data(father.son)
## Warning: data set 'father.son' not found
x <- father.son$sheight
## Error: object 'father.son' not found
n <- length(x)
## Error: object 'x' not found

## Error: object 'father.son' not found
round(c(sum((x - mean(x))^2)/(n - 1), var(x), var(x)/n, sd(x), sd(x)/sqrt(n)), 
    2)
## Error: object 'x' not found