"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".
Daniel Manrique-Vallier
(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
iterationnumeric. Current iteration
initializedlogical. Is the sampler initialized?
buffer_sizenumeric. Capacity (in samples) of the tracing buffer.
buffer_usednumeric. Number of samples currently stored in the tracing buffer.
tracingcharacter. Names of the variables currently traced.
thinningnumeric. 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.