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

ENH: random sampling, rvs, for asymmetric kernel density #7375

Open
josef-pkt opened this issue Mar 12, 2021 · 1 comment
Open

ENH: random sampling, rvs, for asymmetric kernel density #7375

josef-pkt opened this issue Mar 12, 2021 · 1 comment

Comments

@josef-pkt
Copy link
Member

josef-pkt commented Mar 12, 2021

followup to PR #7364
general issue #7346

see #7364 (comment)

I have this working for most kernels
invgauss and recipinvgauss raise a DomainError in scipy distribution when I try the reparameterization
all others look ok.

Without reference for this, we need a lot more checking. In one example it is difficult to tell what is random noise and what is a possible mistake in the approach.
I haven't tried more than a few random runs with it, generating either 1000 or 2000 random draws.

kde on generated data matches well the original theoretical pdf and the initial kde (kde_dgp), see example plot below
What needs more checking is whether the observations are bunched at values.
We need some measure of random noise comparing the noise in initial draw from the theoretical distribution, with the noise in the kde generated random variables.
At least some basic Monte Carlo, to see if sampling properties match.

plot is for nobs=5000 random draws

image

@josef-pkt
Copy link
Member Author

I cleaned up the notebook https://gist.github.com/josef-pkt/415845804f9622e7c48f8544b7ebabbf

recipinvgauss needs checking to see why it causes domain error, I guess we have a non-negativity constraint violated.

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

No branches or pull requests

1 participant