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

Get conditional kernel densities #72

Open
ClaudMor opened this issue Jan 30, 2021 · 0 comments
Open

Get conditional kernel densities #72

ClaudMor opened this issue Jan 30, 2021 · 0 comments

Comments

@ClaudMor
Copy link

Hello,

This may be more of a discussion topic, but I post it here as perhaps discussions have not been activated yet in this repo, and it could be more appropriate to have this here rather than on the discourse.

I was wondering if there is a method to get a conditional distribution out of a ::BallTreeDensity.

So say for example that I have the following code:

using KernelDensityEstimate, Distributions

# define number of samples
const n_samples = 500

# define two correlated variables
const x = randn(n_samples)
const y = x.^2 .+ rand(Uniform(-0.0005, 0.0005), n_samples) 

# and an uncorrelated one
const z = rand(Gamma(), n_samples);

# fit the kde
kde = kde!(Array((hcat(x,y,z)')))

And I would like to get the distribution of x and y conditioned to, say, z = 10.

How would you do it?

Thank you very much

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

1 participant