|
| | nuts (stan::model::prob_grad &model, int maxdepth=10, double epsilon=-1, double epsilon_pm=0.0, bool epsilon_adapt=true, double delta=0.6, double gamma=0.05, BaseRNG base_rng=BaseRNG(std::time(0)), const std::vector< double > *params_r=0, const std::vector< int > *params_i=0) |
| | Construct a No-U-Turn Sampler (NUTS) for the specified model, using the specified step size and number of leapfrog steps, with the specified random seed for randomization. More...
|
| |
| | ~nuts () |
| | Destructor. More...
|
| |
| virtual sample | next_impl () |
| | Return the next sample. More...
|
| |
| virtual void | write_sampler_param_names (std::ostream &o) |
| | Write out any sampler-specific parameter names for output. More...
|
| |
| virtual void | write_sampler_params (std::ostream &o) |
| | Write out any sampler-specific parameters for output. More...
|
| |
| virtual void | get_sampler_param_names (std::vector< std::string > &names) |
| | Get any sampler-specific parameter namess. More...
|
| |
| virtual void | get_sampler_params (std::vector< double > &values) |
| | Get any sampler-specific parameters. More...
|
| |
| void | build_tree (const std::vector< double > &x, const std::vector< double > &m, const std::vector< double > &grad, double u, int direction, int depth, double H0, std::vector< double > &xminus, std::vector< double > &mminus, std::vector< double > &gradminus, std::vector< double > &xplus, std::vector< double > &mplus, std::vector< double > &gradplus, std::vector< double > &newx, std::vector< double > &newgrad, double &newlogp, int &nvalid, bool &criterion, double &prob_sum, int &n_considered) |
| | The core recursion in NUTS. More...
|
| |
| | hmc_base (stan::model::prob_grad &model, double epsilon=-1, double epsilon_pm=0.0, bool epsilon_adapt=true, double delta=0.651, double gamma=0.05, boost::mt19937 rand_int=boost::mt19937(std::time(0)), const std::vector< double > *params_r=0, const std::vector< int > *params_i=0) |
| | Construct a base HMC sampler. More...
|
| |
| virtual | ~hmc_base () |
| |
| virtual void | set_params (const std::vector< double > &x, const std::vector< int > &z) |
| | Sets the model real and integer parameters to the specified values. More...
|
| |
| void | set_params_r (const std::vector< double > &x) |
| | Sets the model real parameters to the specified values and update gradients and log probability to match. More...
|
| |
| void | set_params_i (const std::vector< int > &z) |
| | Sets the model integer parameters to the specified values and update gradients and log probability to match. More...
|
| |
| bool | varying_epsilon () |
| |
| virtual void | adapt_off () |
| | Turn off parameter adaptation. More...
|
| |
| virtual void | get_parameters (std::vector< double > ¶ms) |
| | Write the step size into position 1 of the specified vector. More...
|
| |
| | adaptive_sampler (bool adapt, std::ostream *error_msgs=0, std::ostream *output_msgs=0) |
| | Constructs an adaptive sampler with specified adaptation status. More...
|
| |
| virtual | ~adaptive_sampler () |
| | Destructor. More...
|
| |
| void | set_error_stream (std::ostream &error_msgs) |
| | Set the stream into which errors will be written as the sampler runs. More...
|
| |
| void | unset_error_stream () |
| | Unset the stream into which errors are written to 0 so that error messages are ignored. More...
|
| |
| void | set_output_stream (std::ostream &output_msgs) |
| | Set the stream into which output will be written as the sampler runs. More...
|
| |
| void | unset_output_stream () |
| | Unset the stream into which errors are written to 0 so that output messages are ignored. More...
|
| |
| sample | next () |
| | Returns the next sample from this sampler. More...
|
| |
| double | mean_stat () |
| | Returns the value of the statistic we are trying to coerce. More...
|
| |
| void | set_mean_stat (double v) |
| | Sets the mean statistic to the specified value. More...
|
| |
| void | update_mean_stat (double avg_eta, double adapt_stat) |
| | Updates the mean statistic given the specified adaptation statistic and weighting. More...
|
| |
| unsigned int | nfevals () |
| | Returns the number of times that the (possibly unnormalized) log probability function has been evaluated by this sampler. More...
|
| |
| void | nfevals_plus_eq (int n) |
| | Add the specified number of evaluations to the number of function evaluations. More...
|
| |
| int | n_steps () |
| | Return the number of iterations for this sampler. More...
|
| |
| int | n_adapt_steps () |
| | Return how many iterations parameter adaptation has happened for. More...
|
| |
| virtual void | adapt_on () |
| | Turn on parameter adaptation. More...
|
| |
| bool | adapting () |
| | Return whether or not parameter adaptation is on. More...
|
| |
| virtual void | write_adaptation_params (std::ostream &o) |
| | Use this method to write the adaptation parameters into the output. More...
|
| |
template<class BaseRNG = boost::mt19937>
class stan::mcmc::nuts< BaseRNG >
No-U-Turn Sampler (NUTS).
The NUTS sampler requires a probability model with the ability to compute gradients, characterized as an instance of prob_grad.
Definition at line 32 of file nuts.hpp.
template<class BaseRNG = boost::mt19937>
| virtual void stan::mcmc::nuts< BaseRNG >::write_sampler_param_names |
( |
std::ostream & |
o | ) |
|
|
inlinevirtual |
Write out any sampler-specific parameter names for output.
This method must match write_sampler_params() in terms of number of parameters written.
Params should be writte starting with a comma, then the first parameter, then a comma, then the second parameter, ending on the final parameter.
The base class implementation is a no-op.
- Parameters
-
| [out] | o | Output stream to which param names are written. |
Reimplemented from stan::mcmc::adaptive_sampler.
Definition at line 216 of file nuts.hpp.