Solved – How to approximate the variance of a normal distribution

normal distribution

I am approximating a 1D normal distribution by performing many samples. I can approximate its mean by simply averaging out the samples.

However, how do I get the variance? This doesn't seem so simple.

Best Answer

Given that you have the mean,

  1. find the deviation of each of your samples from the mean
  2. square each of these
  3. sum these values
  4. divide by the number of samples you have - 1

so you have the estimated mean $\bar x$ and the samples in the vector $x$

the variance will be:

$\sigma^2 = \frac{\sum_{i=1}^{n} (x_i-\bar x)^2}{n-1}$

where $n$ is the number of samples

Related Question