Method of Moments: Real Statistics Support

Worksheet Functions

Real Statistics Functions: The Real Statistics Resource Pack provides the following array functions that estimate the appropriate distribution parameter values (plus the MLE value) which provide a fit for the data in R1 based on the method of moments; R1 is a column array with no missing data values.

BETA_FITM(R1, lab, pure) = returns an array with the beta distribution parameter values alpha, beta, MLE.

CAUCHY_FITM(R1, lab, med, exc) = returns an array with the Cauchy distribution parameter values mu, sigma, MLE.

GAMMA_FITM(R1, lab, pure) = returns an array with the gamma distribution parameter values alpha, beta, MLE.

GEV_FITM(R1, lab, xguess, iter, prec, incr, pure) = returns an array with the Generalized Extreme Value distribution parameter values mu, sigma, xi, MLE

GUMBEL_FITM(R1, lab, pure) = returns an array with the Gumbel distribution parameter values mu, beta, MLE.

LAPLACE_FITM(R1, lab, pure) = returns an array with the Laplace distribution parameter values mu, beta, MLE.

LOGISTIC_FITM(R1, lab, pure) = returns an array with the logistic distribution parameter values mu, beta, MLE.

NEGBINOM_FITM(R1, lab, pure) = returns an array with the negative binomial distribution parameter values k, p, MLE. k doesn’t necessarily take an integer value.

PARETO_FITM(R1, lab) = returns an array with the Pareto distribution parameter values alpha, min, MLE. 

GPD_FITM(R1, mu, lab, pure) = returns an array with the Generalized Pareto distribution parameter values sigma, xi, MLE using the location parameter mu.

UNIFORM_FITM(R1, lab, pure) = returns an array with the uniform distribution parameter values alpha, beta, MLE.

WEIBULL_FITM(R1, lab, pure, iter, bguess) = returns an array with the Weibull distribution parameter values alpha, beta, MLE. iter is the number of iterations used in calculating the solution (default 20) and bguess is the initial guess used for the beta parameter (the default is 0, which means that the function uses an internal algorithm to make the initial guess).

Worksheet Function Parameters

If lab = TRUE, then an extra column of labels is appended to the output (default is FALSE). If pure = TRUE, then the pure method of moments is used (i.e. t2 is used as the estimator for the variance), while if pure = FALSE (default) then s2 is used as the estimator for the variance (and similarly for skewness for GEV_FITM). MLE is the likelihood estimate for the parameters that are output, as described elsewhere.

For CAUCHY_FITM, if med = TRUE then the median is used as the estimate for mu, while if med = FALSE (default) then the mean of the middle 24% of the sample is used as the estimate for mu. If exc = TRUE, then the exclusive version of the IQR is used; otherwise (default) the inclusive version is used.

For GEV_FITM, xguess is the initial guess for xi, iter (default 100) = the maximum number of iterations. The algorithm will terminate prior to iter iterations once the error is less than prec (default .0000001). incr is used to calculate the derivative of the log-likelihood function and defaults to .000001.

Method of Moments for Triangular and PERT distributions

You can use the TRIANG_FITM and PERT_FITM worksheet functions to fit data to the triangular and PERT distributions using the method of moments. These functions have a different format from the functions described above. You can obtain a complete description of these functions by clicking on the links associated with these functions. 

Examples

Note that the output from the array formula =BETA_FITM(A4:A21,TRUE) for Example 1 of Method of Moments: Beta Distribution is shown in range C12:D14 of Figure 1 of that webpage.

The output from the array formula =PARETO_FITM(A4:A21,TRUE) for Example 1 of Method of Moments: Pareto Distribution is shown in range C9:D11 of Figure 2 of that webpage.

Similarly, the output from the array formula =UNIFORM_FITM(B3:C12,TRUE) for Example 1 of Method of Moments: Uniform Distribution is shown in range E8:F10 of Figure 1 of that webpage.

The output from the array formula =GPD_FITM(D3:D22,2,TRUE) for Example 1 of Method of Moments: GPD is shown in range F12:G14 of Figure 1 of that webpage.

Finally, the use of the GEV_FITM function is illustrated in Example 2 of Fitting a GEV Distribution via MLE.

Maximum Likelihood Method

In Distribution Fitting using MLE we describe another method (based on the maximum likelihood estimator) for estimating the parameters of a distribution. When the estimations from this method are identical to those from the method of moments, Real Statistics only provides a function for the maximum likelihood estimates, although these can also be used as estimates from the method of moments.

Thus, the functions EXPON_FIT, GEOM_FIT, and LOGNORM_FIT for the exponential, geometric, and lognormal distributions, can also be used to supply the parameter estimates based on the method of moments.

Data Analysis Tool

Real Statistics Data Analysis Tool: The Real Statistics Distribution Fitting data analysis tool can be used to automate the fitting of a distribution to data using both the method of moments and the maximum likelihood approach. See Distribution Fitting Data Analysis Tool for details.

Reference

Wikipedia (2017) Method of moments (statistics)
https://en.wikipedia.org/wiki/Method_of_moments_(statistics)

Leave a Comment