distribution fitting

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

distribution fitting

Glazko, Galina
Dear list,

 

Does anyone know how to fit the power law distribution?

I have the empirical distribution and would like to check whether it fits

the power law (with the power estimated from the data).

 

Any hints are appreciated.

 

Tanks a lot!

Galina

 



        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: distribution fitting

Adelchi Azzalini
On Wed, 15 Feb 2006 14:39:53 -0500, Glazko, Galina wrote:

GG> Dear list,
GG>
GG>  
GG>
GG> Does anyone know how to fit the power law distribution?
GG>
GG> I have the empirical distribution and would like to check whether
GG> it fits
GG>
GG> the power law (with the power estimated from the data).
GG>


you can you fitdistr() from MASS, as indicated below

notice that the so-called "exponential power" (Subbotin, 1923)
distribution has been used with many different sort of parametrizations;
the form used below is proportional to  exp(-|x|^p/p).

best regards,
Adelchi Azzalini
--
library(MASS)
dep<- function(x,location,scale,tail) # Exponential power (=Subbotin)
{
  const<- 2*tail^(1/tail-1) *gamma(1/tail)
  z<- (x-location)/scale
  exp(-abs(z)^tail/tail)/(scale*const)
}


x <- rt(100,df=3)
a <- fitdistr(x, dep, start=list(location=0, scale=1, tail=1.5))
print(a$estimate)
print(a$sd)

--
Adelchi Azzalini  <[hidden email]>
Dipart.Scienze Statistiche, Università di Padova, Italia
tel. +39 049 8274147,  http://azzalini.stat.unipd.it/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html