Learn R Programming

NeuralEstimators (version 0.1.3)

mapestimate: Maximum a posteriori estimation

Description

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.

Usage

mapestimate(
  estimator,
  Z,
  prior = NULL,
  theta_grid = NULL,
  theta0 = NULL,
  use_gpu = TRUE
)

Value

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

Arguments

estimator

a neural likelihood-to-evidence-ratio estimator

Z

data; it's format should be amenable to the architecture of estimator

prior

the prior (default uniform), specified as a Julia or R function

theta_grid

a (fine) gridding of the parameter space, given as a matrix with p rows, where p is the number of parameters in the model

theta0

a vector of initial parameter estimates

use_gpu

a boolean indicating whether to use the GPU if it is available (default true)

See Also

sampleposterior(), mlestimate()