Now using (5) we solve for α and λ using the calculated values for and from the data as shown in (3). This is another example, suppose we have data we want to fit to a Gamma distribution, hence we know that for a Gamma distribution and that hence we have If the fit is not good, we can try to fit the data to a different distribution.
#Method of moments pdf#
We can now plot this selected pdf using the calculated parameters on top of the histogram of the data and see how good the fit is. Hence the solution from above gives an estimate of the pdf parameters from the data itself.
Now we determine an estimate for and from the data, or the sample, and substitute in the above and solve for μ and It is easier to re - write the above as follows Suppose to want to fit the data to a normal distribution, then we know that the first moment is given by and that the second moment is given by. Next we calculate the moments from the data itself and set these to be equal to the moments for the pdf and solve for the. This will give us n equations expressed as functions of the , These are known analytical expressions for the selected pdf and can be looked up or derived from the assumed pdf. We start by writing down the n probability moments, called for the selected pdf we want to fit the data to. We call these, so for the case of fitting to a normal distribution n=2, and. we want to fit the data to some distribution which is defined using n parameters). Let us assume there are n parameters to be determined (i.e. But if we wanted to fit the data to Poisson distribution, then we only need one equation since the Poisson pdf is defined in terms on one parameter λ as in f(x)= If we have to determine 2 parameters (as in the above 2 cases) then we need 2 equations. If we want to fit the population to the Gamma distribution, then we need to determine the parameters since the Gamma distribution is is fully specified by these 2 parameters.
For each one of these Choice we need to determine the relevant distribution parameters to be able to fully specify the pdf.įor example, if we want to fit the population data to the normal distribution, then we need to determine the mean and variance of the data since the normal pdf is fully specified by these 2 parameters The idea of this method is as follows: Assume that the data was generated according to some distribution, say Normal or Gamma or Poisson, etc. We call the given data the population data. In other words, we want to determine the best probability distribution function by which the given data could have been generated according to. The problem to solve : Given some data, we seek to fit a probability law to the data. Mathematics 502 probability and statistics, CSUF, Fall 2007 Method_of_moments (Wolfram Mathematica 6.0 for Students - Personal Use Only)Ī small note on the statistical method of moments for fitting a probability model to data