1 #ifndef STAN__MCMC__BASE__STATIC__HMC__BETA
2 #define STAN__MCMC__BASE__STATIC__HMC__BETA
5 #include <boost/math/special_functions/fpclassify.hpp>
16 template <
class M,
class P,
template<
class,
class>
class H,
17 template<
class,
class>
class I,
class BaseRNG>
23 base_hmc<M, P, H, I, BaseRNG>(m, rng, o, e),
T_(1)
41 for (
int i = 0; i <
L_; ++i)
42 this->
integrator_.evolve(this->z_, this->hamiltonian_, this->epsilon_);
47 double acceptProb =
std::exp(H0 - h);
50 this->
z_.ps_point::operator=(z_init);
52 acceptProb = acceptProb > 1 ? 1 : acceptProb;
54 return sample(this->
z_.q, - this->hamiltonian_.V(this->z_), acceptProb);
59 o <<
"stepsize__,int_time__,";
67 names.push_back(
"stepsize__");
68 names.push_back(
"int_time__");
73 values.push_back(this->
T_);
void write_sampler_param_names(std::ostream &o)
bool isnan(const stan::agrad::var &v)
Checks if the given number is NaN.
void write_sampler_params(std::ostream &o)
void set_nominal_stepsize_and_T(const double e, const double t)
H< M, BaseRNG > hamiltonian_
void set_nominal_stepsize_and_L(const double e, const int l)
void set_nominal_stepsize(const double e)
double cont_params(int k) const
void set_T(const double t)
base_static_hmc(M &m, BaseRNG &rng, std::ostream *o, std::ostream *e)
double e()
Return the base of the natural logarithm.
void seed(const Eigen::VectorXd &q)
boost::uniform_01< BaseRNG & > rand_uniform_
void get_sampler_param_names(std::vector< std::string > &names)
sample transition(sample &init_sample)
fvar< T > exp(const fvar< T > &x)
void sample(stan::mcmc::base_mcmc *sampler, int num_warmup, int num_samples, int num_thin, int refresh, bool save, stan::io::mcmc_writer< Model, SampleRecorder, DiagnosticRecorder, MessageRecorder > &writer, stan::mcmc::sample &init_s, Model &model, RNG &base_rng, const std::string &prefix, const std::string &suffix, std::ostream &o, StartTransitionCallback &callback)
void get_sampler_params(std::vector< double > &values)
I< H< M, BaseRNG >, P > integrator_