Skip to content
All library documents

Fitting Return Distributions from Sample Moments

Article Quant Q&A · Author: quant122

Summary

The document considers how to construct a probability density for portfolio returns when the sample mean, variance, skewness, and kurtosis are known. It collects several suggested routes: estimate parameters for a chosen distribution, use a generalized method of moments setup when distributional moments can be written as functions of parameters, or assess distributional fit with goodness-of-fit tests. It also mentions a Cornish–Fisher expansion as a way to adjust normal quantiles using skewness and excess kurtosis.

These are alternatives rather than a single recommended workflow. Parameter fitting depends on selecting a suitable distribution and on whether its parameters can match the desired moments; matching a few moments does not uniquely determine a density. The discussion does not compare methods empirically or establish that the resulting density is appropriate for portfolio analysis. The tests mentioned assess distributional similarity, while the quantile expansion is an approximation rather than a general density-fitting solution.

Key ideas

  • A finite set of sample moments does not by itself specify a unique return distribution.
  • Distribution parameters can be estimated by matching theoretical moments when their functional relationship is known.
  • Generalized method of moments is relevant when the available moment conditions outnumber the parameters.
  • Goodness-of-fit tests can assess whether observed data are consistent with a candidate distribution.
  • Cornish–Fisher adjusts normal quantiles using skewness and excess kurtosis, but is an approximation.

Tags

Full text
# How to fit probability density function from sample moments?


# How to fit probability density function from sample moments?












If I have calculated the sample mean, variance, skew and kurtosis of a set of data, how would I go about fitting a probability distribution to match these moments (i.e. choosing a probability distribution and optimizing its parameters to fit the sample moments). Are there any packages in R/MATLAB/etc. that are capable of this?

For context, I believe I can calculate these moments for a portfolio's return distribution, but I actually need a whole probability density function for the portfolio's returns in order to perform additional analysis.

## Answer by babelproofreader (score 2, accepted)

https://quant.stackexchange.com/a/3017

I asked an almost identical question on the Cross Validated site here. I think my accepted answer, given by Whuber, might be what you are looking for.

## Answer by Joshua Ulrich (score 4)

https://quant.stackexchange.com/a/3011

You should be able to do this with the `fitdistr` function in the MASS package. You will certainly be able to hold the mean and variance constant, but I'm less sure about skewness and kurtosis (they would need to be arguments to the density function).

The actuar package may also be useful, as it contains additional density functions.

## Answer by Vincent Zoonekynd (score 2)

https://quant.stackexchange.com/a/3015

If you have a formula giving you the moments as a function of the parameters of the distribution, you can use `gmm`, in the `gmm` package: there is a detailed example for the Gaussian distribution in the documentation.

(Of course, in this case, you are only solving a system of equations, and could probably do it by hand: the generalized method of moments (GMM) is typically used when there are more moments than parameters.)

## Answer by Max Li (score 2)

https://quant.stackexchange.com/a/3018

Often, we are interested to check if our data is close to normal, then you can use the Jarque-Bera test, where skewness and kurthosis are directly deployed. Look up Matlab implementation.

If you are not constrained to use the moments, you can calculate histogram and use Komogorov-Smirnov test, which can test similarity to any distribution, not necessarily normal. Look up Matlab implementation.

## Answer by Jean-Victor Côté (score 1)

https://quant.stackexchange.com/a/3019

It may never have been done, but it seems to me that the Cornish-Fisher expansion for moments up to 4 could be used to trace a density function from a tabulation of the percentiles of the normal distribution, for instance:

$$ w_{\alpha}\cong z_{\alpha}+\frac{1}{6}\left(z_{\alpha}^{2}-1\right)AS+\frac{1}{24}\left(z_{\alpha}^{3}-3z_{\alpha}\right)EKUR-\frac{1}{36}\left(2z_{\alpha}^{3}-5z_{\alpha}\right)AS^{2} $$ where $w_{\alpha}$ is the revised percentile, $z_{\alpha}$ is the percentile for the standard normal distribution, AS is the skewness coefficient and EKUR is the excess kurtosis coefficient (from a kurtosis coefficient of 3 for a normal distribution).

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.