Skip to content

Discrete Prior Selection #906

Answered by michaeldeistler
Saheli2001 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there,

generally, sbi does not yet support discrete density estimators (and thereby also no discrete priors).

As a workaround, you can simply use a continuous density estimator and get the best-possible continuous approximation to the discrete posterior. When doing this, do not pass the prior at initialization (see below). Also, I would recommend to use an NSF as density estimator for this:

inference = SNPE(density_estimator="nsf") # Do not pass prior
_ = inference.append_simulations(theta, x).train()
posterior = inference.build_posterior()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Saheli2001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants