Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: L moments Date: Wed, 27 Oct 2010 02:17:03 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 19 Message-ID: <ia822v$o01$1@fred.mathworks.com> References: <ia4853$ofq$1@fred.mathworks.com> <ia7r20$pvg$1@fred.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-03-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1288145823 24577 172.30.248.38 (27 Oct 2010 02:17:03 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Wed, 27 Oct 2010 02:17:03 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2386204 Xref: news.mathworks.com comp.soft-sys.matlab:681573 "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