Stan  2.10.0
probability, sampling & optimization
init_softabs.hpp
Go to the documentation of this file.
1 #ifndef STAN_SERVICES_SAMPLE_INIT_SOFTABS_HPP
2 #define STAN_SERVICES_SAMPLE_INIT_SOFTABS_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 
20  double alpha
21  = dynamic_cast<stan::services::real_argument*>
22  (hmc->arg("metric")->arg("softabs")->arg("alpha"))->value();
23 
24  dynamic_cast<Sampler*>(sampler)->z()->set_alpha(alpha);
25 
26  return true;
27  }
28 
29  }
30  }
31 }
32 
33 #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
argument * arg(const std::string &name)
bool init_softabs(stan::mcmc::base_mcmc *sampler, stan::services::argument *algorithm)

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