File Exchange

image thumbnail

lmom.m

version 1.0 (809 Bytes) by

Calculates any number of l-moments.

12 Downloads

Updated

View License

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.

Comments and Ratings (6)

Kun

Kun (view profile)

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)));

Luca

Luca (view profile)

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

Luca

Luca (view profile)

Luca

Luca (view profile)

ok, I found it

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?

Steven Gray

Fast and very useful.

Updates

1.0

BSD license update

MATLAB Release
MATLAB 6.5 (R13)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video