"Anand Anand" <tranand3@gmail.com> wrote in message <ia4853$ofq$1@fred.mathworks.com>...
> How do i calculate the L moments for a given set of data using MATLAB?
          
I see no matlab functions for directly computing L moments, not even in the Statistics Toolbox. However there are formulas given in the two websites below for computing them for a given data sample using two differing forms. The first site gives a direct formula whereas the second computes them by way of "probability weighted moments".
http://en.wikipedia.org/wiki/Lmoment
http://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/lmoment.htm
You could check your work by comparing results from the two equivalent formulas.
In each case it is necessary to first sort your discrete data values in ascending sizes. As long as the number of points in the data is not excessively large you could use the 'nchoosek' function with a scalar input number to directly compute the binomial coefficients used in the formulas. If that gives you trouble, you may have to generate these using the matlab 'prod' function in such a way as not to produce intermediate overflows.
Do you plan to go much beyond the first four moments? If not that will simplify matters for you. The formulas become more awkward to realize for the later moments.
Roger Stafford
