Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
L moments

Subject: L moments

From: Anand Anand

Date: 25 Oct, 2010 15:36:04

Message: 1 of 4

How do i calculate the L moments for a given set of data using MATLAB?

Subject: L moments

From: Roger Stafford

Date: 27 Oct, 2010 00:17:04

Message: 2 of 4

"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/L-moment

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

Subject: L moments

From: Ross W

Date: 27 Oct, 2010 02:17:03

Message: 3 of 4

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ia7r20$pvg$1@fred.mathworks.com>...
> "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/L-moment
>
> 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

http://www.mathworks.com/matlabcentral/fileexchange/5874-lmom-m

Subject: L moments

From: Roger Stafford

Date: 27 Oct, 2010 02:40:06

Message: 4 of 4

"Ross W" <rosswoodskiwi@hotmail.com> wrote in message <ia822v$o01$1@fred.mathworks.com>...
> http://www.mathworks.com/matlabcentral/fileexchange/5874-lmom-m
- - - - - - - - -
  That's good to hear. This FEX program should answer your needs, Anand.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us