Skip to content

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

Open

Description

@josef-pkt

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

Activity

  1. josef-pkt commented on Mar 12, 2021

    @josef-pkt
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions