Given data Z
, a neural likelihood-to-evidence-ratio estimator
, and a prior
, draws samples from the implied approximate posterior distribution
Currently, the sampling algorithm is based on a fine-gridding theta_grid
of the parameter space. The approximate posterior density is evaluated over this grid, which is then used to draw samples. This is very effective when making inference with a small number of parameters. For models with a large number of parameters, other sampling algorithms may be needed (please feel free to contact the package maintainer for discussion).
sampleposterior(
estimator,
Z,
theta_grid,
N = 1000,
prior = NULL,
use_gpu = TRUE
)
a p × N
matrix of posterior samples, where p is the number of parameters in the model. If multiple data sets are given in Z
, a list of posterior samples will be returned
a neural likelihood-to-evidence-ratio estimator
data; it's format should be amenable to the architecture of estimator
a (fine) gridding of the parameter space, given as a matrix with p rows, where p is the number of parameters in the model
number of samples to draw (default 1000)
the prior (default uniform), specified as a Julia or R function
a boolean indicating whether to use the GPU if it is available (default true)
mlestimate()
, mapestimate()