Stan  2.10.0
probability, sampling & optimization
diag_e_nuts_classic.hpp
Go to the documentation of this file.
1 #ifndef STAN_MCMC_HMC_NUTS_DIAG_E_NUTS_CLASSIC_HPP
2 #define STAN_MCMC_HMC_NUTS_DIAG_E_NUTS_CLASSIC_HPP
3 
8 
9 namespace stan {
10  namespace mcmc {
11  // The No-U-Turn Sampler (NUTS) on a
12  // Euclidean manifold with diagonal metric
13  template <class Model, class BaseRNG>
15  public base_nuts_classic<Model, diag_e_metric,
16  expl_leapfrog, BaseRNG> {
17  public:
18  diag_e_nuts_classic(const Model& model, BaseRNG& rng):
20  expl_leapfrog, BaseRNG>(model, rng) { }
21 
22  // Note that the points don't need to be swapped
23  // here since start.mInv = finish.mInv
25  diag_e_point& finish,
26  Eigen::VectorXd& rho) {
27  return finish.mInv.cwiseProduct(finish.p).dot(rho - finish.p) > 0
28  && finish.mInv.cwiseProduct(start.p).dot(rho - start.p) > 0;
29  }
30  };
31 
32  } // mcmc
33 } // stan
34 #endif
Probability, optimization and sampling library.
Point in a generic phase space.
Definition: ps_point.hpp:17
Eigen::VectorXd p
Definition: ps_point.hpp:46
bool compute_criterion(ps_point &start, diag_e_point &finish, Eigen::VectorXd &rho)
Point in a phase space with a base Euclidean manifold with diagonal metric.
diag_e_nuts_classic(const Model &model, BaseRNG &rng)

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