Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Classes | Functions
stan::mcmc Namespace Reference

Markov chain Monte Carlo samplers. More...

Classes

class  adaptive_cdhmc
 Adaptive "constant distance" Hamiltonian Monte Carlo (CDHMC) sampler. More...
 
class  adaptive_hmc
 Adaptive Hamiltonian Monte Carlo (HMC) sampler. More...
 
class  adaptive_sampler
 An abstract base class for adaptive samplers. More...
 
class  chains
 An mcmc::chains object stores parameter names and dimensionalities along with samples from multiple chains. More...
 
class  DualAverage
 Implements Nesterov's dual average algorithm. More...
 
class  hmc_base
 
class  nuts
 No-U-Turn Sampler (NUTS). More...
 
class  nuts_diag
 No-U-Turn Sampler (NUTS) with varying step sizes. More...
 
class  nuts_massgiven
 No-U-Turn Sampler (NUTS) with varying step sizes. More...
 
class  nuts_nondiag
 No-U-Turn Sampler (NUTS) with varying step sizes. More...
 
class  sample
 Representation of a MCMC sample. More...
 

Functions

void write_error_msgs (std::ostream *error_msgs, const std::domain_error &e)
 
double leapfrog (stan::model::prob_grad &model, std::vector< int > z, std::vector< double > &x, std::vector< double > &m, std::vector< double > &g, double epsilon, std::ostream *error_msgs=0, std::ostream *output_msgs=0)
 Computes the log probability for a single leapfrog step in Hamiltonian Monte Carlo.
 
double rescaled_leapfrog (stan::model::prob_grad &model, std::vector< int > z, const std::vector< double > &step_sizes, std::vector< double > &x, std::vector< double > &m, std::vector< double > &g, double epsilon, std::ostream *error_msgs=0, std::ostream *output_msgs=0)
 
double nondiag_leapfrog (stan::model::prob_grad &model, std::vector< int > z, const Eigen::MatrixXd &_cov_L, std::vector< double > &x, std::vector< double > &m, std::vector< double > &g, double epsilon, std::ostream *error_msgs=0, std::ostream *output_msgs=0)
 
void read_cov (std::string &cov_file, Eigen::MatrixXd &cov_L)
 
int sample_unnorm_log (std::vector< double > probs, boost::uniform_01< boost::mt19937 & > &rand_uniform_01)
 

Detailed Description

Markov chain Monte Carlo samplers.

Function Documentation

double stan::mcmc::leapfrog ( stan::model::prob_grad &  model,
std::vector< int >  z,
std::vector< double > &  x,
std::vector< double > &  m,
std::vector< double > &  g,
double  epsilon,
std::ostream *  error_msgs = 0,
std::ostream *  output_msgs = 0 
)

Computes the log probability for a single leapfrog step in Hamiltonian Monte Carlo.

If a domain error occurs when calling the model's grad_log_prob(), this function returns -inf. Domain errors can occur when distribution functions are called with parameters out of support.

Parameters
[in]modelProbability model with gradients.
[in]zInteger parameters.
[in]xReal parameters
[in,out]mMomentum.
[in,out]gGradient at x, z.
[in]epsilonStep size used in Hamiltonian dynamics.
[in,out]error_msgsOutput stream for error messages.
[in,out]output_msgsOutput stream for output messages.
Returns
the log probability of x and m.

Definition at line 58 of file util.hpp.

double stan::mcmc::nondiag_leapfrog ( stan::model::prob_grad &  model,
std::vector< int >  z,
const Eigen::MatrixXd &  _cov_L,
std::vector< double > &  x,
std::vector< double > &  m,
std::vector< double > &  g,
double  epsilon,
std::ostream *  error_msgs = 0,
std::ostream *  output_msgs = 0 
)

Definition at line 104 of file util.hpp.

void stan::mcmc::read_cov ( std::string &  cov_file,
Eigen::MatrixXd &  cov_L 
)

Definition at line 128 of file util.hpp.

double stan::mcmc::rescaled_leapfrog ( stan::model::prob_grad &  model,
std::vector< int >  z,
const std::vector< double > &  step_sizes,
std::vector< double > &  x,
std::vector< double > &  m,
std::vector< double > &  g,
double  epsilon,
std::ostream *  error_msgs = 0,
std::ostream *  output_msgs = 0 
)

Definition at line 80 of file util.hpp.

int stan::mcmc::sample_unnorm_log ( std::vector< double >  probs,
boost::uniform_01< boost::mt19937 & > &  rand_uniform_01 
)

Definition at line 147 of file util.hpp.

void stan::mcmc::write_error_msgs ( std::ostream *  error_msgs,
const std::domain_error &  e 
)

Definition at line 20 of file util.hpp.


     [ Stan Home Page ] © 2011–2013, Stan Development Team.