No BSD License  

5.0

5.0 | 3 ratings Rate this file 48 Downloads (last 30 days) File Size: 809 Bytes File ID: #5874

lmom.m

by

 

14 Sep 2004 (Updated )

Calculates any number of l-moments.

| Watch this File

File Information
Description

This m-file calculates any number of l-moments for given data vector X. It uses probability weighted moments (can actually edit the file to give any number of pwm's) and the coefficients of the shifted Legendre polynomial to calculate the l-moments.

MATLAB release MATLAB 6.5 (R13)
Other requirements FILE REQUIRED: % LegendreShiftPoly.m by Peter Roche, 12-08-2004. This file is available on the Matlab File Exchange. Thanks to Peter for his work.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
07 Sep 2012 Kun

T4 calculation is correct. Actually the estimate of T4 is random variable by itself, which follows normal distribution asymptotically.

Following code illustrate the idea, and the sample mean T4 approach 0.1226 in the long run.

N = 10000;
ks = ones(N,1);
for i=1:N
x = randn(1000,1);
l = lmom(x,4);
ks(i) = l(4)/l(2);
end
hist(ks,100);
title(sprintf('Avg.T4=%.4f',mean(ks)));

26 Apr 2011 Luca

I tried this code:
x = randn(100000,1);
L = lmom(x,4)
L =
0.0038 0.5650 0.0005 0.0685

In fact L4 != 0.1226 !!!

but you can evaluate:
T4 = L4/L2 = 0.1213

21 Apr 2011 Luca  
21 Apr 2011 Luca

ok, I found it

25 Nov 2010 Anand Anand

I generated 1000 random nos from normal distribution(5,0.2)..i tried lmom(x)...the first three moments are right but the 4 moment kurtosis comes around 0.0137 while L4 for a normal dist is 0.1226...What is causing this discrepancy?

12 Apr 2006 Steven Gray

Fast and very useful.

Contact us