CS1 · explained

The method of moments, and when maximum likelihood is worth the extra work

The oldest way to fit a distribution is to make its moments equal the sample moments and solve. This page shows the recipe, the divisor convention that quietly changes the answer, the case where the method returns an impossible estimate, and how to decide when to reach for likelihood instead.

CS1 · Actuarial Statistics · 12 min read

The problem it solves

You have a column of claim amounts and you want a distribution: not a histogram, an actual parametrised model you can price with, reserve with and simulate from. Which gamma? Which lognormal? Which negative binomial?

Maximum likelihood is the answer the syllabus spends most time on, and usually the right one. But it has a cost. You must write down the likelihood, differentiate it, and solve the resulting equations — and for several distributions that last step has no closed form at all, so you are into numerical iteration before you have an estimate.

The method of moments skips all of that. It is the oldest estimation method in statistics and the recipe is one line: make the distribution's moments equal the sample's moments, and solve for the parameters. It is the fastest route to a usable fit, it needs nothing but algebra, and it is examinable precisely because knowing when it is adequate and when it is not is a real professional judgement.

The recipe

Count the parameters. That is how many equations you need, and you take them in order, starting from the first moment:

E[X] = x̄     E[X²] = Σxi²/n     E[X³] = Σxi³/n    and so on

In words: the left-hand sides are formulae containing the unknown parameters; the right-hand sides are numbers you compute from the data. Solve the simultaneous equations and whatever comes out is the estimate.

In practice the second equation is almost always used in its central form instead — matching the variance rather than the raw second moment — because the formula for a distribution's variance is usually tidier than the formula for E[X²]. The two are equivalent, with one wrinkle covered below.

A warm-up with round numbers

An exponential distribution has one parameter and mean 1/λ. One equation:

1/λ = x̄   →   λ̂ = 1/x̄

If the sample mean of a set of waiting times is 4 days, the estimate is λ̂ = 0.25 per day. For the exponential this is also the maximum likelihood estimate, so there is nothing to choose between the methods. Same for the Poisson, where λ̂ = x̄ both ways. The two methods only start to part company when the distribution has a shape parameter as well as a scale.

The divisor convention, which quietly changes the answer

Matching the variance requires you to decide what "the sample variance" means, and there are two candidates:

m2 = Σ(xi − x̄)²/n     s² = Σ(xi − x̄)²/(n − 1)

The first is the second central sample moment, which is what "the method of moments" strictly means, and it is what you get automatically if you match raw moments and subtract. The second is the unbiased estimator, which is what a calculator's s-squared key and every software package will hand you.

They differ by the factor n/(n − 1), so the estimates differ too — by about 14 per cent at n = 8, 2 per cent at n = 50, and not at all in the limit. For a large sample it does not matter. For the eight-observation samples that turn up in exam questions it visibly does, and the worked example shows the fitted tail probability moving by a third because of it. State which one you used; both are defensible, and silence is not.

What the method is good at

It always produces an answer, fast. No iteration, no starting value, no convergence to worry about. For a gamma, whose likelihood equations involve the digamma function and cannot be solved in closed form, you get an estimate in two lines of algebra.

It is consistent. Sample moments converge to population moments as the sample grows, so moment estimators converge to the truth. That is the minimum any estimator must deliver and the method delivers it.

It gives maximum likelihood somewhere to start. Numerical likelihood maximisation needs an initial guess, and a moment estimate is a good one. This is how the two methods are usually used together in practice rather than in competition.

It is the natural method when only moments are available. Empirical Bayes credibility estimates its structural parameters from observed means and variances across risks, because the likelihood of the underlying risk parameters is not available to maximise. Fitting a dispersion parameter in a generalised linear model from a Pearson statistic is the same move.

What it is bad at

It can be inefficient. Maximum likelihood estimators attain the Cramér-Rao lower bound asymptotically; moment estimators generally do not, which means a larger standard error from the same data. You are paying for the convenience with precision, and for a fixed sample size that is a real cost.

It can return an impossible answer. Nothing in the method knows what values a parameter is allowed to take, so a negative variance or a shape parameter below zero can come out, and for a uniform distribution it can produce an upper limit smaller than an observation you already have. Part (b) of the worked example does exactly that. Maximum likelihood cannot do this, because a parameter value inconsistent with the data has likelihood zero and is never the maximum.

It leans on higher moments, which are badly estimated. A three-parameter fit needs a third sample moment, and third moments from small samples are extremely noisy. The more parameters, the worse the method behaves — the opposite of what you want.

It ignores everything about the data except the moments. Two samples with identical means and variances but entirely different shapes get the same fit. The likelihood would see the difference.

Where it is used after this topic

Fitting loss distributions. A quick gamma or lognormal fit to claim sizes, often as the first look before anything more careful.

Credibility. The structural parameters in empirical Bayes credibility are moment estimators, built from the means and variances of the risks in a portfolio.

Starting values for likelihood maximisation and for the iteratively reweighted least squares that fits a generalised linear model.

Where marks are lost

Matching the wrong number of moments. One equation per parameter. Two parameters and one equation leaves you with a family of answers; two parameters and three equations leaves you with a contradiction.

Mixing the central and raw forms in the same calculation. Either match E[X²] to Σx²/n, or match the variance to a sample variance. Matching E[X²] to a sample variance is a guaranteed wrong answer and it is an easy slip when the algebra gets long.

Not checking the answer is admissible. If a shape parameter comes out negative, or an upper limit comes out below the largest observation, the estimate is not an estimate. Say so and say why — that is the mark.

Claiming efficiency. Moment estimators are consistent. They are not generally efficient, and a question that asks you to compare the two methods is asking for exactly that distinction.

Forgetting that the fit only reproduces the moments you matched. A two-moment fit matches the mean and the variance and is under no obligation to match the skewness, and generally will not. The worked example shows a fitted skewness of 1.06 against a sample skewness of 0.60 from the same eight numbers.

Questions students ask

If maximum likelihood is better, why learn this at all?

Because "better" is asymptotic and conditional. Maximum likelihood is better when the model is right and the sample is reasonably large; its advantage is in efficiency, not in robustness. The method of moments is quicker, is sometimes the only thing available, and is what several of the estimators later in the syllabus actually are. And the comparison itself is examinable: being able to say which method you would use and why is the skill being tested.

Can the two methods ever disagree wildly?

Yes, and the uniform distribution is the standard demonstration: the moment estimate can be impossible while the likelihood estimate is obviously sensible. Less dramatically, for heavy-tailed distributions a moment estimator can be dragged a long way by one large observation, because a sample moment gives that observation weight proportional to its size squared. Likelihood is not immune, but it is less brutally leveraged.

Is the method of moments ever the only option?

Fairly often, in the form that matters: when you can observe means and variances but cannot write down a likelihood for the quantity you want. Credibility theory is the example in this paper. The structure that generates the risks is unobserved, so there is no likelihood to maximise, but there are observable moments to match.

A worked example

Three parts, because the method's behaviour is the lesson and one data set cannot show it. A gamma fit that works; a uniform fit that fails; and a Poisson fit where the method cannot even decide what its own answer is. All three data sets are invented for this page.

Part (a): fitting a gamma to eight claim amounts

Eight claims, in thousands of rupees: 15, 22, 28, 35, 44, 52, 60, 84.

The totals first. Σx = 340, so x̄ = 42.5. The squared deviations from 42.5 are 756.25, 420.25, 210.25, 56.25, 2.25, 90.25, 306.25 and 1722.25, adding to 3564.0.

Check that by the raw route: Σx² = 18014 and n x̄² = 8(1806.25) = 14450, and 18014 − 14450 = 3564. Agreed, so:

s² = 3564/7 = 509.1428571     m2 = 3564/8 = 445.5

A gamma with shape α and rate λ has mean α/λ and variance α/λ². Two parameters, two equations:

α/λ = 42.5     α/λ² = 509.1428571

Divide the second by the first and the α cancels, leaving 1/λ = 509.1428571/42.5, so

λ̂ = 42.5/509.1428571 = 0.0834736
α̂ = x̄λ̂ = 42.5²/509.1428571 = 1806.25/509.1428571 = 3.5476291

Keep the second one as the fraction rather than multiplying 42.5 by the rounded rate: 42.5 × 0.0834736 gives 3.5476280, and the sixth decimal has already been lost.

The check that matters. A moment fit must reproduce the moments it was built from, and if it does not, the algebra has gone wrong. Substituting the unrounded estimates back gives α̂/λ̂ = 42.5 and α̂/λ̂² = 509.1428571, both exactly. Do that check in fractions: α̂/λ̂ = (1806.25/509.1428571)/(42.5/509.1428571) = 1806.25/42.5 = 42.5, where everything cancels. Repeating it on the seven-decimal figures printed above returns 42.5000 and 509.1432, which is the rounding and not an error — but it is the reason to check in fractions where you can.

The same data, the other divisor

Match m2 = 445.5 instead — which is what matching the raw second moment Σx²/n = 2251.75 and subtracting x̄² = 1806.25 gives you automatically:

λ̂ = 42.5/445.5 = 0.0953984     α̂ = 1806.25/445.5 = 4.0544332

The ratio of the two shape estimates is 4.0544332/3.5476291 = 1.1428571, which is exactly 8/7 — the n over n minus 1 factor, showing up as cleanly as it can.

Does the difference matter? Price something with it and see. The fitted probability that a claim exceeds 100 thousand is 0.0205699 under the first fit and 0.0153442 under the second — the first is 34 per cent larger, on a quantity an excess-of-loss layer would be priced from. At n = 8 the choice of divisor is not a technicality.

What the fit does not match

Two moments were matched, so exactly two are reproduced. The third is not:

fitted skewness = 2/√α̂ = 2/√3.5476291 = 1.0618444
sample skewness = m3/m21.5 = 5601.375/445.51.5 = 0.5956938

These two numbers are not meant to agree and there is nothing wrong with either. The sample is more symmetric than any gamma with this mean and variance can be, which is information: it is a hint that a gamma may not be the right family, and it is the kind of check a goodness-of-fit test is for. The point to take away is that a two-moment fit is a statement about two moments only.

Part (b): the fit that is impossible

Five waiting times are recorded, in minutes: 0.2, 0.5, 0.9, 1.4, 6.0. A uniform distribution on the interval 0 to θ is proposed, so there is one parameter. Its mean is θ/2:

θ/2 = x̄ = 9.0/5 = 1.80   →   θ̂ = 3.6

But one of the observations is 6.0. The fitted distribution says nothing above 3.6 can ever happen, and the data contains something 2.4 minutes above that. The estimate is not merely poor, it is refuted by the sample it was computed from, and its likelihood is exactly zero.

Maximum likelihood cannot make this mistake. The likelihood of θ is 1/θn for every θ at least as large as the largest observation and zero below it, so it is maximised by making θ as small as it is allowed to be:

θ̂MLE = max(xi) = 6.0

Which is not perfect either, and for an instructive reason: the largest of five draws from a uniform averages only 5/6 of the way up the range, so the maximum likelihood estimator is biased downwards and 1.2 × 6.0 = 7.2 is the unbiased correction. But it is never impossible, and that is the difference the question is testing.

Part (c): where the method cannot choose between its own answers

Ten policies, with claim counts 0, 1, 0, 2, 1, 0, 1, 3, 0, 2. Fit a Poisson, which has one parameter.

Match the mean: λ̂ = 10/10 = 1.0. That is also the maximum likelihood estimate, so far so uncontroversial.

But a Poisson's variance also equals λ, so matching the variance is just as much "the method of moments", and the sample variance is 1.1111111. Two different estimates, both obtained by equating a population moment to its sample counterpart.

The convention resolves it — start at the first moment and use as many as you have parameters, so λ̂ = 1.0 — but notice what the disagreement is telling you. The gap between 1.0 and 1.1111111 is the beginning of a goodness-of-fit test: if the distribution really were Poisson those two numbers would be close, and when they are not, the data is informing you that the model is wrong rather than that the method is. With ten observations a ratio of 1.11 is well inside noise. With ten thousand it would not be, and the right response would be to fit a negative binomial instead.

Where this fits in CS1

This page explains one idea from CS1 Actuarial Statistics. The full CS1 syllabus, with what each part is examined on, sits on the course page, and past-paper style mock exams with full solutions are where you find out whether the idea has stuck under time pressure.

Other CS1 topics explained

Stuck on a term rather than the idea? The actuarial glossary defines the notation used above. If something here is wrong or unclear, tell us — these pages get corrected.