Skip to contents

Monte Carlo estimate of the GABC likelihood of Wilkinson (2014) eq. (1) and the bootstrap variance that is used as the GP's nugget.

Usage

gabc_log_likelihood(
  sim,
  obs,
  theta,
  n_sim = 50L,
  epsilon = 1,
  summary = NULL,
  kernel = "gaussian",
  seed = 0L,
  bootstrap = 25L
)

Arguments

sim

Simulator, signature (theta, rng).

obs

Observed data.

theta

Parameter vector.

n_sim

Number of Monte Carlo samples.

epsilon

Acceptance tolerance.

summary

Optional summary function.

kernel

Acceptance kernel, "gaussian" or "uniform".

seed

Random seed.

bootstrap

Number of bootstrap replications for the nugget.

Value

List log_lik, nugget_variance.

Examples

sim <- function(theta, e) theta + c(-0.5, 0, 0.5)
gabc_log_likelihood(sim, obs = c(0.5, 1, 1.5), theta = 1, n_sim = 5L, epsilon = 0.5)$log_lik
#> [1] 0