Stan  2.10.0
probability, sampling & optimization
init_static_hmc.hpp
Go to the documentation of this file.
1 #ifndef STAN_SERVICES_SAMPLE_INIT_STATIC_HMC_HPP
2 #define STAN_SERVICES_SAMPLE_INIT_STATIC_HMC_HPP
3 
8 
9 namespace stan {
10  namespace services {
11  namespace sample {
12 
13  template<class Sampler>
15  stan::services::argument* algorithm) {
18  (algorithm->arg("hmc"));
19 
22  (algorithm->arg("hmc")->arg("engine")->arg("static"));
23 
24  double epsilon
25  = dynamic_cast<stan::services::real_argument*>
26  (hmc->arg("stepsize"))->value();
27  double epsilon_jitter
28  = dynamic_cast<stan::services::real_argument*>
29  (hmc->arg("stepsize_jitter"))->value();
30  double int_time
31  = dynamic_cast<stan::services::real_argument*>(base->arg("int_time"))
32  ->value();
33 
34  dynamic_cast<Sampler*>(sampler)
35  ->set_nominal_stepsize_and_T(epsilon, int_time);
36  dynamic_cast<Sampler*>(sampler)->set_stepsize_jitter(epsilon_jitter);
37 
38  return true;
39  }
40 
41  }
42  }
43 }
44 
45 #endif
void sample(stan::mcmc::base_mcmc *sampler, int num_warmup, int num_samples, int num_thin, int refresh, bool save, stan::services::sample::mcmc_writer< Model, SampleRecorder, DiagnosticRecorder, MessageRecorder > &mcmc_writer, stan::mcmc::sample &init_s, Model &model, RNG &base_rng, const std::string &prefix, const std::string &suffix, std::ostream &o, StartTransitionCallback &callback, interface_callbacks::writer::base_writer &info_writer, interface_callbacks::writer::base_writer &error_writer)
Definition: sample.hpp:17
Probability, optimization and sampling library.
virtual argument * arg(const std::string &name)
Definition: argument.hpp:74
bool init_static_hmc(stan::mcmc::base_mcmc *sampler, stan::services::argument *algorithm)
argument * arg(const std::string &name)

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