MCMCenviron-class | R Documentation |
"MCMCenviron"
A generic interface for MCMC sampler objects implementing Bayesian models. Methods provide access to underlying functionality implemented in C++. The underlying implementation provides basic functionality for controlling the chain, and a 'tracing buffer' for storing and retrieving the samples.
All reference classes extend and inherit methods from "envRefClass"
.
(All fields are read-only.)
pointer
:external pointer to the C++ object
blobsize
:size (in bytes) of the raw object data for serialization. (currently not implemented.)
seed
:seed of the internal random number generator.
GENERAL METHODS
Init_Model(output = TRUE, seed=c('auto', 'r.seed'))
:Initializes the sampler.
output:
logical. Print messages to the screen?
seed:
integer. Seed of the internal RNG. Additionally, seed='auto'
autogenerates the seed from the internal clock; seed='r.seed'
autogenerates the seed from the current state of the .Random.seed
variable.
Update(num_iter, output = TRUE)
: Runs num_iter
iterations of the sampler. Set output = FALSE
to suppress console output.
Get_Iteration()
:Retrieves the current number of iterations the sampler.
Get_Param_List()
:Retrieves the names of the parameters of the model.
Get_Param(param)
: Retrieves the current value of the parameter param
.
Set_Seed(seed)
:Seeds the internal random number generator. It does not affect R's internal RNG.
Get_Status():
Retrieves the current state of the chain
iteration
numeric. Current iteration
initialized
logical. Is the sampler initialized?
buffer_size
numeric. Capacity (in samples) of the tracing buffer.
buffer_used
numeric. Number of samples currently stored in the tracing buffer.
tracing
character. Names of the variables currently traced.
thinning
numeric. Thinning interval of the tracing buffer.
METHODS FOR CONTROLLING THE TRACING BUFFER
Get_Trace_List()
:Retrieves the names of the parameters being currently traced.
Activate_Tracing()
: Activates the tracing buffer. Traced variables will be stored in the buffer when generated with Update()
.
Deactivate_Tracing()
: Deactivates the tracing buffer. Calls to Update()
will not store samples in the buffer.
Set_Trace(traces)
:Adds parameters to tracer.
param
: character vector. Names of the parameters to trace. To list the available parameters for tracing use the Get_Param_List()
method.
Get_Trace(param)
:Retrieves samples stored in the tracing buffer.
param
: character. Name of the parameter to retrieve.
An array. The first dimension indexes the sample; the rest correspond to the original dimensions of the parameter as defined in the model.
Reset_Traces()
:Deletes the content of the tracing buffer.
Change_SubSamp(new_subsamp)
:Changes the sub-sampling period (thinning) of the tracing buffer.
This operation deletes the current content of the tracing buffer.
Get_Trace_Size()
:Retrieves the size (in number of samples) of the trace buffer.
Change_Trace_Length(new_length)
:Changes the size (in number of samples) of the tracing buffer.
This operation deletes the current content of the tracing buffer.
This class is not designed to be used directly, but as a generic interface for samplers implementing specific models.
Daniel Manrique-Vallier
showClass("MCMCenviron")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.