1
$\begingroup$

Can someone help me figure out how I can get parameter estimates for a levy distribution using R? Unlike the normal distribution and Student T distribution which has functions nFit(x) and stdFit(x) respectively, the Levy distribution doesn't seem to have the same ability. I am trying to fit my data set to the levy distribution so I need a function in R that will give me good estimates for the delta and gamma parameters.

Thanks in advance!

$\endgroup$

1 Answer 1

1
$\begingroup$

There aren't any nFit nor stdFit functions in the distribution of R. Are you talking about some package? Please also define what the $\delta$ and $\gamma$ parameters are in your parameterization. For example, wikipedia gives $\mu$ and $c$ instead - how do they correspond?

Failing that, please at least give the cdf or the density for your form so we can see how it's parameterized.

You can probably use fitdistr from MASS to fit it, you just need to supply the density (which is simple) and some start values.

$\endgroup$
4
  • $\begingroup$ Yes, nFit is from the package fBasics and stdFit is from the package fGarch. So, I was able to use those two packages to calculate the parameters(mu and sigma) for a normal distribution and (mu, sd, and nu) for a symmetric student T distribution. Now I am looking to calculate the following parameters for a Levy distribution : delta and gamma.Delta is the location parameter which is μ in wikipedia. gamma is c in wikipedia which I believe is the scale parameter. Can you help? $\endgroup$
    – Cware
    Oct 11, 2014 at 1:40
  • $\begingroup$ I am still learning a lot about the levy distribution however, according to R, the formula is the following: f(y;gamma,delta) = sqrt(gamma / (2 pi)) exp( -gamma / (2(y - delta))) / (y - δ)^{3/2}. I got this from typing in "?levy" in R which also showed me the following: levy(delta = NULL, link.gamma = "loge", idelta = NULL, igamma = NULL)... but I don't know how to use that to get the parameters. It is under the package VGAM. $\endgroup$
    – Cware
    Oct 11, 2014 at 1:40
  • $\begingroup$ I tried to take your advice and did the following: test.fit<-function(x,delta,gamma) dt(sqrt(gamma / (2*pi)) * exp( -gamma / (2*(x - delta))) / (x - delta)^{3/2}) fitdistr(x,test.fit,list(delta=0,gamma=1,)).. however, now I am stuck. I keep getting error messages at "fitdistr()". Assuming there is no built in function for the Levy distribution, any ideas how to proceed? Thanks $\endgroup$
    – Cware
    Oct 11, 2014 at 3:58
  • $\begingroup$ any ideas on how I can move forward with this? $\endgroup$
    – Cware
    Oct 14, 2014 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.