Usage
sample.GDS(n.draws, log.phi, post.mode, fn.dens.post, fn.dens.prop, fn.draw.prop, prop.params, ..., max.tries = 1e+06, report.freq = 1, announce = FALSE, thread.id = 1, seed = .Random.seed)
Arguments
n.draws
number of draws to take from the target posterior
density.
log.phi
Vector of log.phi, as computed from the proposal
draws.
post.mode
Mode of the target posterior density (numeric
vector).
fn.dens.post
Function that returns the log posterior
density. Function should take the parameter vector as the first
argument. Additional arguments are passed as ...
fn.dens.prop
Function that returns the log density of the
proposal distribution. The first argument of the function should
take either a vector or a matrix. If the argument is a matrix,
each row is considered a sample. Additional parameters are passed
as a list, prop.params.
fn.draw.prop
Function that returns random samples from the
proposal density. This function should return a matrix, with each
row being a sample. Additional parameters are passed as a list,
prop.params.
prop.params
Object (list or vector) to be passed to both
fn.dens.prop and fn.draw.prop.Contains parameters for the proposal
distribution. See details.
...
Additional parameters to be passed to fn.dens.post.
max.tries
Maximum number of proposal draws to try, without a
success. This prevents the routine from being stuck in an endless
loop.
report.freq
The frequency that the function will report the
current iteration. For example, if report.freq=5, the function
will display a message after every fifth iteration.
announce
If TRUE, will print a message when a proposal is
accepted as a sample from the target posterior distribution.
thread.id
An identifier used in the announce function. This
is useful if running sample.GDS on multiple processors, to collect
multiple batches of samples. Defaults to 1.
seed
Sets a random seed within the call to sample.GDS.
Useful for assigning different seeds to calls to sample.GDS that
are running on different threads or processors. Defaults to
.Random.seed.