Got Questions? Get Answers.
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:
Best Iterative Procedure

Subject: Best Iterative Procedure

From: edward kabanyas

Date: 22 Nov, 2010 11:16:05

Message: 1 of 2

Hi All,

I'm calculating the parameters of gamma distribution using L-Moment method. As we know that we need only two L-Moments (l1 aand l2) to calculate two parameters of gamma distribution (mu, Lambda). From l2/l1, we can calculate "mu" by using an iterative procedure.

l2/l1 = (1/sqrt(pi))*(gamma(mu+1.5)/gamma(mu+2));
l2 and l1 are known !

Itry to find the best "mu" as follow:

==============
function result = reclmom(l1, l2)
mu = 0.1:0.1:100; % assuming mu in this interval
iter=1;dcnorm=1.;
while dcnorm>1E-4 & iter<1000
% alpha is l2/l1
 alpha(iter) = (1/sqrt(pi))*(gamma(mu(iter)+1.5)/gamma(mu(iter)+2));
     
 dcnorm=abs((l2/l1)-alpha(iter));
 iter=iter+1;
 P1=[iter-1 dcnorm alpha(iter-1) mu(iter-1)];
 end
result =[P1(1,4)];

=======================

I found the above iteration procedure is not so accurate to get 'mu' if I compare with 'mu' calculated by maximum likelihood method. Do you have any alternative iterative procedure instead of the above one ?

Thanks for sharing and hlep...

Cheers
Edward..

Subject: Best Iterative Procedure

From: Torsten Hennig

Date: 22 Nov, 2010 11:43:24

Message: 2 of 2

> Hi All,
>
> I'm calculating the parameters of gamma distribution
> using L-Moment method. As we know that we need only
> two L-Moments (l1 aand l2) to calculate two
> parameters of gamma distribution (mu, Lambda). From
> l2/l1, we can calculate "mu" by using an iterative
> procedure.
>
> l2/l1 = (1/sqrt(pi))*(gamma(mu+1.5)/gamma(mu+2));
> l2 and l1 are known !
>
> Itry to find the best "mu" as follow:
>
> ==============
> function result = reclmom(l1, l2)
> mu = 0.1:0.1:100; % assuming mu in this interval
> iter=1;dcnorm=1.;
> while dcnorm>1E-4 & iter<1000
> % alpha is l2/l1
> alpha(iter) =
> =
> (1/sqrt(pi))*(gamma(mu(iter)+1.5)/gamma(mu(iter)+2));
>
> dcnorm=abs((l2/l1)-alpha(iter));
> iter=iter+1;
> P1=[iter-1 dcnorm alpha(iter-1) mu(iter-1)];
> end
> result =[P1(1,4)];
>
> =======================
>
> I found the above iteration procedure is not so
> accurate to get 'mu' if I compare with 'mu'
> calculated by maximum likelihood method. Do you have
> any alternative iterative procedure instead of the
> above one ?
>
> Thanks for sharing and hlep...
>
> Cheers
> Edward..

You could use 'fzero' or 'fsolve' to get the root
of the equation
1/sqrt(pi)*gamma(x+1.5)/gamma(x+2)- l2/l1 = 0

Best wishes
Torsten.

Tags for 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