![]() |
Stan
2.10.0
probability, sampling & optimization
|
mcmc_writer writes out headers and samples More...
#include <mcmc_writer.hpp>
Public Member Functions | |
mcmc_writer (SampleWriter &sample_writer, DiagnosticWriter &diagnostic_writer, MessageWriter &message_writer) | |
Constructor. More... | |
void | write_sample_names (stan::mcmc::sample &sample, stan::mcmc::base_mcmc *sampler, Model &model) |
Outputs parameter string names. More... | |
template<class RNG > | |
void | write_sample_params (RNG &rng, stan::mcmc::sample &sample, stan::mcmc::base_mcmc &sampler, Model &model) |
Outputs samples. More... | |
void | write_adapt_finish (stan::mcmc::base_mcmc *sampler) |
Prints additional info to the streams. More... | |
void | write_diagnostic_names (stan::mcmc::sample sample, stan::mcmc::base_mcmc *sampler, Model &model) |
Print diagnostic names. More... | |
void | write_diagnostic_params (stan::mcmc::sample &sample, stan::mcmc::base_mcmc *sampler) |
Print diagnostic params to the diagnostic stream. More... | |
template<class Writer > | |
void | write_timing (double warmDeltaT, double sampleDeltaT, Writer &writer) |
Internal method. More... | |
void | write_timing (double warmDeltaT, double sampleDeltaT) |
Print timing information to all streams. More... | |
mcmc_writer writes out headers and samples
Model | Model class |
SampleWriter | Class for recording samples |
DiagnosticWriter | Class for diagnostic samples |
Definition at line 26 of file mcmc_writer.hpp.
|
inline |
Constructor.
sample_writer | samples are "written" to this stream (can abstract this?) |
diagnostic_writer | diagnostic information is "written" to this stream |
message_writer | messages are written to this stream |
Definition at line 44 of file mcmc_writer.hpp.
|
inline |
Prints additional info to the streams.
Prints to the sample stream
sampler | sampler |
Definition at line 131 of file mcmc_writer.hpp.
|
inline |
Print diagnostic names.
sample | unconstrained sample |
sampler | sampler |
model | model |
Definition at line 149 of file mcmc_writer.hpp.
|
inline |
Print diagnostic params to the diagnostic stream.
sample | unconstrained sample |
sampler | sampler |
Definition at line 177 of file mcmc_writer.hpp.
|
inline |
Outputs parameter string names.
First outputs the names stored in the sample object (stan::mcmc::sample), then uses the sampler provided to output sampler specific names, then adds the model constrained parameter names.
The names are written to the sample_stream as comma separated values with a newline at the end.
sample | a sample (unconstrained) that works with the model |
sampler | a stan::mcmc::base_mcmc object |
model | the model |
Definition at line 70 of file mcmc_writer.hpp.
|
inline |
Outputs samples.
First outputs the values of the sample params from a stan::mcmc::sample, then outputs the values of the sampler params from a stan::mcmc::base_mcmc, then finally outputs the values of the model.
The samples are written to the sample_stream as comma separated values with a newline at the end.
rng | random number generator (used by model.write_array()) |
sample | the sample in constrained space |
sampler | the sampler |
model | the model |
Definition at line 98 of file mcmc_writer.hpp.
|
inline |
Internal method.
Prints timing information
warmDeltaT | warmup time in seconds |
sampleDeltaT | sample time in seconds |
writer | output stream |
Definition at line 204 of file mcmc_writer.hpp.
|
inline |
Print timing information to all streams.
warmDeltaT | warmup time (sec) |
sampleDeltaT | sample time (sec) |
Definition at line 237 of file mcmc_writer.hpp.