

I am looking for generating samples from the stable Levy family with Distributions.jl, but I cannot find it. https://en.wikipedia.org/wiki/Stable_distribution
Did I miss it, or there is a reason why it is not yet implemented ?
Best


This is extremely difficult to do right, which is why we don't support it yet.
John On Friday, August 19, 2016 at 9:26:19 AM UTC7, Mirmu wrote: I am looking for generating samples from the stable Levy family with Distributions.jl, but I cannot find it. <a href="https://en.wikipedia.org/wiki/Stable_distribution" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fen.wikipedia.org%2Fwiki%2FStable_distribution\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGppOLHljg0fVPX1mRD1cNBdOkfw';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fen.wikipedia.org%2Fwiki%2FStable_distribution\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGppOLHljg0fVPX1mRD1cNBdOkfw';return true;">https://en.wikipedia.org/wiki/Stable_distribution
Did I miss it, or there is a reason why it is not yet implemented ?
Best


It's available in R. Look up the package ' stabledist'. It has function rstable(n, alpha, beta, gamma, delta, pm)
Stable distributions are difficult to generate because the pdf does not have a closed form.
For the Levy distribution, alpha=0.5, beta=1. I wanted to do the generation in R, and the MLE optimization in Julia, but didn't get round to it.


Unfortunately the R package is GPL, so we can't use it as a template for a Julia implementation. But RCall will let you call that package from Julia to get draws from those distributions, so you should be able to do what you suggested pretty easily.
John On Friday, August 19, 2016 at 1:44:06 PM UTC7, Rock Pereira wrote: It's available in R. Look up the package ' stabledist'. It has function rstable(n, alpha, beta, gamma, delta, pm)
Stable distributions are difficult to generate because the pdf does not have a closed form.
For the Levy distribution, alpha=0.5, beta=1. I was trying to answer a question on StackOverflow <a href="http://stackoverflow.com/questions/38774913/fbasicsfitstableworkingsuspiciously" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F38774913%2Ffbasicsfitstableworkingsuspiciously\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNERQKstDXECYKespNMwShQzj63w';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F38774913%2Ffbasicsfitstableworkingsuspiciously\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNERQKstDXECYKespNMwShQzj63w';return true;">http://stackoverflow.com/questions/38774913/fbasicsfitstableworkingsuspiciously I wanted to do the generation in R, and the MLE optimization in Julia, but didn't get round to it.


Ok, after a glance at the literature, I understand those distributions are quite tricky to sample from.
Using RCall might be a bit overkill. Maybe http://prac.im.pwr.wroc.pl/~hugo/publ/AWeronRWeron95_LNP.pdf would be an easy (if slow) way ? (although I am not a statistician so I cannot judge its accuracy). I could give it a shot for the package if you feel it's worthy
Best


RCall is a simple twostep process: Write the R script inside Julia's R macrostrings
 Copy the objects in R as objects in Julia
Search (press F3) for 'stable' to find other packages.
If you're dealing only with draws from the Levy distribution (and not the whole family of stable distributions)
using Distributions x = rand(Levy(u, c), numSamples)


Thx a lot ! Le lundi 22 août 2016 23:19:11 UTC+2, Rock Pereira a écrit : RCall is a simple twostep process: Write the R script inside Julia's R macrostrings
 Copy the objects in R as objects in Julia
The documentation is just one page. <a href="http://juliastats.github.io/RCall.jl/latest/gettingstarted/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fjuliastats.github.io%2FRCall.jl%2Flatest%2Fgettingstarted%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHqjs_UvYMTxJKqDX2i3GP1Sj_Vw';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fjuliastats.github.io%2FRCall.jl%2Flatest%2Fgettingstarted%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHqjs_UvYMTxJKqDX2i3GP1Sj_Vw';return true;">http://juliastats.github.io/RCall.jl/latest/gettingstarted/
R has a massive collection in its Distributions Task View <a href="http://lib.stat.cmu.edu/R/CRAN/web/views/Distributions.html" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Flib.stat.cmu.edu%2FR%2FCRAN%2Fweb%2Fviews%2FDistributions.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG2xmo57L4oCWvMZL5V7bQCMwlQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Flib.stat.cmu.edu%2FR%2FCRAN%2Fweb%2Fviews%2FDistributions.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG2xmo57L4oCWvMZL5V7bQCMwlQ';return true;">http://lib.stat.cmu.edu/R/CRAN/web/views/Distributions.html Search (press F3) for 'stable' to find other packages.
If you're dealing only with draws from the Levy distribution (and not the whole family of stable distributions) you can do it in Julia: <a href="http://distributionsjl.readthedocs.io/en/latest/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fdistributionsjl.readthedocs.io%2Fen%2Flatest%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF0udIkxO40pL3sjIURdpWLKUTtJA';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fdistributionsjl.readthedocs.io%2Fen%2Flatest%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF0udIkxO40pL3sjIURdpWLKUTtJA';return true;">http://distributionsjl.readthedocs.io/en/latest/
using Distributions x = rand(Levy(u, c), numSamples)

