A posterior wraps a trained npe() fit together with (optionally) a default
observation x_obs. It knows how to draw posterior samples, evaluate the
posterior log-density, and find the maximum-a-posteriori (MAP) estimate. All
transforms between standardized training space and the original parameter
space are handled internally.
Arguments
- fit
An
nsbi_npeobject fromnpe().- x_obs
Optional default observation to condition on. If supplied it becomes the default
xforsample(),log_prob()andmap_estimate().
Details
For bounded priors, samples that fall outside the prior support are rejected
("leakage" correction), and log_prob() is renormalized by the estimated
acceptance probability so it integrates to one over the support.
