Skip to contents

The top-level function constructs an instance of an ErnestSampler, containing the necessary information for nested sampling. Currently, nested_sampling relies on the user to specify R functions for both the log-likelihood and prior transform.

Usage

nested_sampling(x, ...)

# Default S3 method
nested_sampling(x, ...)

# S3 method for class '`function`'
nested_sampling(
  x,
  prior_transform,
  ptype,
  sampler = rwmh_cube(),
  n_points = 500,
  update_interval = 1.5,
  verbose = getOption("verbose"),
  ...
)

Arguments

x

Function returning the log-likelihood given a n_dim-length vector of parameters.

...

If x is a function, then these must be empty.

prior_transform

Function translating a point in the unit cube to the prior parameter space. This function should accept a n_dim-length vector of points where each value is in the range \([0, 1]\) and return a same-length vector where each point represents a parameter.

ptype

Either a single integer, a vector of character strings giving variable names, or a zero-row tibble::tibble() that defines the name of each variable and the dimensionality of the prior space.

sampler

An ernest_lrps object, which is a list specifying a given likelihood-restricted prior sampler.

n_points

Number of live points to use during the nested sampling run. Defaults to 500L.

update_interval

Number of likelihood calls that are performed between updates to the sampler. Either an integer or a double, in which case the parameter is cast to an integer by first_update * n_points.

verbose

Whether to print progress messages to the console. Defaults to the value of getOption("verbose").

Value

An ernest_sampler object.