-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RNG for alpha stable isn't correct #38
Comments
To expand a bit on the issue description, here is a script that elucidates what I meant. The plot is truncated so we can see the curves near the mode better, but the rng generates gigantic samples a lot more frequently than theoretically.
Afterwards, I will try to generate samples with what I think is the corrected formula, and post the same type of comparison as well. |
Here is the proposed version, using the same test case as above and the modified formula:
|
I was doing some numerical tests where I ended up comparing rng results from this package by using the characteristic function of the target distribution. At least for alpha in (1,2), the results here do not coincide with the results from inverting the cdf.
It has to do with the (1-alpha)/alpha exponent not being applied to the trignometric functions and also maybe with the generation of the exponential random variable. The formula here is definitely not correct.
I have made a few tests on my machine with some corrections and they seem to work, so I will submit a fix in the near future and we can evaluate the results.
I created this issue to raise awareness, as I plan to submit a fix to this in the next few days/weeks.
The text was updated successfully, but these errors were encountered: