Expected value

The expected value of a random variable is the sum of all the values it can take on, weighted by their probability (i.e., a weighted average):

If we have a set of numbers , and assign them equal probability , then the expected value is equal to the standard average which sums all the numbers in and divides by its size:

Expected value and minimizing squared error

Consider a set of numbers . What number minimizes the mean squared error among this set of numbers?

It turns out that the solution is the average, , which is related to expected values as shown above. To prove this, we can find a local minimum by taking the derivative of the above equation w.r.t and set it equal to 0, and then solve for :

Variance

Variance of a random variable is average squared distance from samples of the random variable and its expected value:

Standard deviation

Standard deviation is the square root of variance:

Todo

  • Do similar derivation for conditional expectations.
  • Covariance
  • Covariance matrix
  • Pearson correlation coefficient