# Statistics: Method of moments

This is part of the course “Probability Theory and Statistics for Programmers”.

Imagine that we have a population with a specific distribution. As we already know distribution density function have the number of parameters. There is a large number of distribution functions and each of them has a different number of parameters, however most of the time one or two. For example, normal distribution has two parameters — μ and σ, which is mean and variance, however, Poisson distribution has only one parameter — λ, which is the rate. As always in statistics task, we have data sample from this population and need to make some estimation. Since we have data sample we can calculate sample moments(numerical characteristics of statistical distribution). The most used moments are first — expected value and second — variance. Also sometimes can be used third and fourth central moments. They are — skewness and kurtosis.

**The method of moments** solves such task: calculate the parameters of the population distribution function having a distribution function and a sample data. Let’s take the distribution from one of the previous articles, calculate parameters and compare an actual distribution with one calculated with the method of moments.

As you can see from the example we obtain result close to actual distribution with a small sample. In this example, we calculate only two moments since the population has a normal distribution, which has two parameters.

**The generic approach** for calculating parameters of population distribution function with *k *parameters by using the method of moments:

- find
*k*sample moments. - calculate parameters of population distribution function by solving equations by using previously calculated moments.

Reach the next level of focus and productivity with increaser.org.