simulate.ebnm: Sample from the posterior of a fitted EBNM model

View source: R/ebnm_methods.R

simulate.ebnmR Documentation

Sample from the posterior of a fitted EBNM model

Description

The simulate method for class ebnm. Extracts the posterior sampler from an object of class ebnm and returns a specified number of samples.

Usage

## S3 method for class 'ebnm'
simulate(object, nsim = 1, seed = NULL, ...)

Arguments

object

The fitted ebnm object.

nsim

The number of posterior samples to return per observation.

seed

Either NULL or an integer that will be used in a call to set.seed before simulating. If set, the value is saved as the "seed" attribute of the returned value. The default, NULL, will not change the random generator state.

...

Additional arguments to be passed to the posterior sampler function. Since ebnm_horseshoe returns an MCMC sampler, it takes parameter burn, the number of burn-in samples to discard. At present, no other samplers take any additional parameters.

Value

A matrix of posterior samples, with rows corresponding to distinct samples and columns corresponding to observations.


ebnm documentation built on Oct. 13, 2023, 1:16 a.m.