Skip to content

Lower and Upper bound not working for multivariate distributions #1847

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

Closed
sachinruk opened this issue Mar 2, 2017 · 4 comments
Closed

Lower and Upper bound not working for multivariate distributions #1847

sachinruk opened this issue Mar 2, 2017 · 4 comments

Comments

@sachinruk
Copy link
Contributor

This is bit of a feature request than anything. I was wondering if it would be possible to implement the bounds of a distribution similar to what is done in stan. eg:

parameters{
  real<lower=0,upper=1> sigma;
}

The only way I can think of doing this in pymc3 is using densityDist. Lastly if this were to be implemented would it affect ADVI?

@fonnesbeck
Copy link
Member

You can already do this by wrapping any continuous distribution in Bound.

@sachinruk sachinruk reopened this Mar 2, 2017
@sachinruk
Copy link
Contributor Author

How would this work in the Multivariate case? I wish to change the following line:

innov_like = pm.MvNormal.dist(mu=x_im1 + mu, tau=tau).logp(x_i)

to

BoundedNormal = pm.Bound(pm.MvNormal, lower=0)
innov_like = BoundedNormal.dist(mu=x_im1 + mu, tau=tau).logp(x_i)

The above chucked a dimensionality mismatch error. Any thoughts?

Also with regards to using VB, anything I ought to be cautious about when using bounded distributions?

@twiecki
Copy link
Member

twiecki commented Mar 2, 2017

We don't have tests for bounds on multivariate distributions so I'm not surprised it isn't working.

There should be no issue with VB though.

@twiecki twiecki changed the title Lower and Upper bound on all distributions Lower and Upper bound not working for multivariate distributions Mar 2, 2017
@domenzain
Copy link
Contributor

#1843 There are some pitfalls when sampling.

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

4 participants