![]() |
Stan
1.0
probability, sampling & optimization
|
Representation of a MCMC sample. More...
#include <sampler.hpp>
Public Member Functions | |
| sample (const std::vector< double > ¶ms_r, const std::vector< int > ¶ms_i, double log_prob) | |
| Construct a sample from the specified parameters and log probability. More... | |
| virtual | ~sample () |
| Destroy this sample. More... | |
| int | size_r () const |
| Return the number of real (scalar) parameters. More... | |
| double | params_r (int k) const |
| Return the value of the parameter at the specified index. More... | |
| void | params_r (std::vector< double > &x) const |
| Set the specified parameter vector's value to the parameters in this sample. More... | |
| const std::vector< double > & | params_r () const |
| Return the underlying continuous parameter vector. More... | |
| int | size_i () const |
| Return the number of discrete integer (discrete) parameters. More... | |
| int | params_i (int k) const |
| Return the integer (discrete) parameter at the specified index. More... | |
| void | params_i (std::vector< int > &n) const |
| Set the specified parameter vector's value to the parameters in this sample. More... | |
| const std::vector< int > & | params_i () const |
| Return the vector of integer parameters for this sample. More... | |
| double | log_prob () const |
| Return the log probability (possibly unnormalized) for this sample. More... | |
Representation of a MCMC sample.
A sample consists of real parameters, integer parameters, and a log probability.
Definition at line 16 of file sampler.hpp.
|
inline |
Construct a sample from the specified parameters and log probability.
This constructor copies the parameter vectors so that subsequent changes to the parameters do not affect the sample.
| params_r | Scalar (real) parameters. |
| params_i | Discrete (integer) parameters. |
| log_prob | Log probability of parameters and data in the model. |
Definition at line 37 of file sampler.hpp.
|
inlinevirtual |
Destroy this sample.
This base class implements is destructor as a no-op.
Definition at line 50 of file sampler.hpp.
|
inline |
Return the log probability (possibly unnormalized) for this sample.
Definition at line 135 of file sampler.hpp.
|
inline |
Return the vector of integer parameters for this sample.
Definition at line 125 of file sampler.hpp.
|
inline |
Return the integer (discrete) parameter at the specified index.
| k | Index of parameter. |
Definition at line 108 of file sampler.hpp.
|
inline |
Set the specified parameter vector's value to the parameters in this sample.
| [out] | n | Vector into which to write parameters. |
Definition at line 118 of file sampler.hpp.
|
inline |
Return the underlying continuous parameter vector.
Definition at line 89 of file sampler.hpp.
|
inline |
Return the value of the parameter at the specified index.
| k | Index of parameter. |
Definition at line 69 of file sampler.hpp.
|
inline |
Set the specified parameter vector's value to the parameters in this sample.
| [out] | x | Vector into which to write the parameters. |
Definition at line 79 of file sampler.hpp.
|
inline |
Return the number of discrete integer (discrete) parameters.
Definition at line 98 of file sampler.hpp.
|
inline |
Return the number of real (scalar) parameters.
Definition at line 58 of file sampler.hpp.