Skip to content

Priors / limits #24

Closed
jspilker opened this Issue Apr 24, 2012 · 2 comments

2 participants

@jspilker

It's quite possible I haven't read enough to know this, but is there a way to enforce priors or limits on fitted parameters (eg, positive temperature or distance)? At the moment I'm just having my likelihood function return ludicrously low probabilities if any walkers stray into unphysical territory, but is there a better way? It only takes one thrown NaN from one stray walker to foul up subsequent analysis, so I'd just as soon set certain regions of the parameter space as off-limits from the beginning.

@dfm
Owner
dfm commented Apr 24, 2012

The best way to do this is to just return -numpy.inf from you lnposterior function whenever the proposal position is in the out of bounds region. This is exactly the same operation as having a prior probability of zero in that region and the sampler should deal with that without any problems.

Let me know if you run in to any other problems.

@jspilker

That makes sense, and seems to be working well. Thanks Dan.

@jspilker jspilker closed this Apr 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.