![]() |
Stan
2.5.0
probability, sampling & optimization
|
mcmc_writer writes out headers and samples More...
#include <mcmc_writer.hpp>
Public Member Functions | |
| mcmc_writer (SampleRecorder &sample_recorder, DiagnosticRecorder &diagnostic_recorder, MessageRecorder &message_recorder, std::ostream *msg_stream=0) | |
| Constructor. More... | |
| void | write_sample_names (stan::mcmc::sample &sample, stan::mcmc::base_mcmc *sampler, M &model) |
| Outputs parameter string names. More... | |
| template<class RNG > | |
| void | write_sample_params (RNG &rng, stan::mcmc::sample &sample, stan::mcmc::base_mcmc &sampler, M &model) |
| Outputs samples. More... | |
| template<class Recorder > | |
| void | write_adapt_finish (stan::mcmc::base_mcmc *sampler, Recorder &recorder) |
| Internal method. 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, M &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 Recorder > | |
| void | write_timing (double warmDeltaT, double sampleDeltaT, Recorder &recorder) |
| Internal method. More... | |
| void | write_timing (double warmDeltaT, double sampleDeltaT) |
| Print timing information to all streams. More... | |
mcmc_writer writes out headers and samples
| M | Model class |
| SampleRecorder | Class for recording samples |
| DiagnosticRecorder | Class for diagnostic samples |
Definition at line 29 of file mcmc_writer.hpp.
|
inline |
Constructor.
| sample_stream | samples are "written" to this stream (can abstract this?) |
| diagnostic_stream | diagnostic information is "written" to this stream |
| msg_stream | messages are output to this stream |
Definition at line 51 of file mcmc_writer.hpp.
|
inline |
Internal method.
Prints additional sampler info to the stream.
| sampler | sampler |
| stream | stream to output stuff to |
Definition at line 139 of file mcmc_writer.hpp.
|
inline |
Prints additional info to the streams.
Prints to both the sample stream and the diagnostic stream
| sampler | sampler |
Definition at line 157 of file mcmc_writer.hpp.
|
inline |
Print diagnostic names.
| sample | unconstrained sample |
| sampler | sampler |
| model | model |
Definition at line 175 of file mcmc_writer.hpp.
|
inline |
Print diagnostic params to the diagnostic stream.
| sample | unconstrained sample |
| sampler | sampler |
Definition at line 203 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 79 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 107 of file mcmc_writer.hpp.
|
inline |
Internal method.
Prints timing information
| warmDeltaT | warmup time in seconds |
| sampleDeltaT | sample time in seconds |
| stream | output stream |
| prefix | prepend each line with the prefix; default is "" |
Definition at line 231 of file mcmc_writer.hpp.
|
inline |
Print timing information to all streams.
| warmDeltaT | warmup time (sec) |
| sampleDeltaT | sample time (sec) |
Definition at line 267 of file mcmc_writer.hpp.