MATLAB: How to evaluate kth moment of a distribution created using ProbDistUnivParam

higherhigher-orderhosorderprobdistprobdistparametricstatisticsStatistics and Machine Learning Toolbox

I create a probability distribution using ProbDistUnivParam() and then I calculate mean and variance. I would like to evaluate the kth moment of my distribution.

Best Answer

The following is one simple way to calculate kth moments (and higher-order statistics in general) once a probability distribution is created using PROBDISTUNIVPARAM.
Assuming you have a probability distribution pd, for instance, obtained as follows:
pd = ProbDistUnivParam(DISTNAME,PARAMS);
It suffices to use the method PDF (which is part of the ProbDistUnivParam class) to obtain the probability density function (PDF) for the ProbDist object. For example:
Y = pdf(pd, X);
where X is a numeric array of values where you want to evaluate the PDF.
Then one could use the various MATLAB functions available to calculate higher-order statistics. For instance, kurtosis can be calculated as follows:
k = kurtosis(Y);