Given data Z
, a neural likelihood-to-evidence-ratio estimator
, and a prior
, computes the implied approximate maximum a posteriori (MAP) estimate
If a vector theta0
of initial parameter estimates is given, the approximate posterior density is maximised by gradient descent. Otherwise, if a matrix of parameters theta_grid
is given, the approximate posterior density is maximised by grid search.
mapestimate(
estimator,
Z,
prior = NULL,
theta_grid = NULL,
theta0 = NULL,
use_gpu = TRUE
)
a p × K matrix of MAP estimates, where p is the number of parameters in the statistical model and K is the number of data sets provided in Z
a neural likelihood-to-evidence-ratio estimator
data; it's format should be amenable to the architecture of estimator
the prior (default uniform), specified as a Julia or R function
a (fine) gridding of the parameter space, given as a matrix with p rows, where p is the number of parameters in the model
a vector of initial parameter estimates
a boolean indicating whether to use the GPU if it is available (default true)
sampleposterior()
, mlestimate()