nimble-dev / nimble

The base NIMBLE package for R
http://R-nimble.org
BSD 3-Clause "New" or "Revised" License
158 stars 24 forks source link

Addition of `prior_samples` MCMC sampler #1343

Closed danielturek closed 11 months ago

danielturek commented 1 year ago

Adding a new prior_samples MCMC sampler, which allows defining the prior distribution of a model node using a set of numeric values. Values are provided either as a vector (in the scalar case), or as a matrix (in the multidimensional case).

Draws from this numeric structure are taken either sequentially (the default), or drawn randomly, as controlled by the randomDraws control-list argument.

prior_samples samplers are (by default) reordered to operate first among MCMC samplers, however this is controlled by a new system option MCMCorderPriorSamplesSamplersFirst.

prior_samples samplers are able to operate on non-stochastic nodes, in particular on RHSonly nodes.

Documentation and testing added.

See roxygen in MCMC_samplers.R for full details.