Skip to content
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

kprime: do not use small v2 (<=13). #12

Open
GerardTromp opened this issue Jun 21, 2019 · 4 comments
Open

kprime: do not use small v2 (<=13). #12

GerardTromp opened this issue Jun 21, 2019 · 4 comments
Assignees

Comments

@GerardTromp
Copy link

I was using the kprime functions and was able to generate random variates with v1 and v2 as small integers.

When I tried to generate the density variate (dkprime) I ran into problems (which I should have realized were due to the ratio algebra).

I ran a number of tests using the testf() in the vignette and when v2 <= 12 (perhaps 13) the theoretical distributions become unstable.
At v2 <=5 there are many values of NA or Inf, accompanied by warnings from lgamarat()
At v2 = 6 the density variate is a square wave form
At v2 = 7 the density variate is two separate unimodal distributions (separate from the centrality specification of 'a').
At v2 = 8 the density variate is a bimodal distribution with the dip centered at a.

Perhaps a warning in the documentation not to use v2 <= 13 would be helpful to other folk like me (and avoid questions).

@shabbychef
Copy link
Owner

Thanks for filing. At one point I implemented the density described by Lecoutre, and can dust that off again. I think k-prime is interesting enough to warrant a very small package to its "PDQR" functions. Tracking here.

@shabbychef shabbychef self-assigned this Jun 21, 2019
@shabbychef
Copy link
Owner

Quick question: do you need the density function? The CDF can be computed accurately via a series, and the quantile function can invert that with uniroot. The density however, would be some kind of convolution, I think.

@GerardTromp
Copy link
Author

GerardTromp commented Jun 22, 2019 via email

@shabbychef
Copy link
Owner

Starting a kprime package, based on Poitevineau and Lecoutre, though it may take some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants