Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dense_e_nuts.hpp
Go to the documentation of this file.
1 #ifndef STAN__MCMC__DENSE__E__NUTS__BETA
2 #define STAN__MCMC__DENSE__E__NUTS__BETA
3 
8 
9 namespace stan {
10 
11  namespace mcmc {
12 
13  // The No-U-Turn Sampler (NUTS) on a
14  // Euclidean manifold with dense metric
15 
16  template <typename M, class BaseRNG>
17  class dense_e_nuts: public base_nuts<M,
18  dense_e_point,
19  dense_e_metric,
20  expl_leapfrog,
21  BaseRNG> {
22 
23  public:
24 
25  dense_e_nuts(M &m, BaseRNG& rng, std::ostream* o = &std::cout, std::ostream* e = 0):
26  base_nuts<M, dense_e_point, dense_e_metric, expl_leapfrog, BaseRNG>(m, rng, o, e)
27  { this->name_ = "NUTS with a dense Euclidean metric"; }
28 
29  // Note that the points don't need to be swapped
30  // here since start.mInv = finish.mInv
32  dense_e_point& finish,
33  Eigen::VectorXd& rho) {
34  return finish.p.transpose() * finish.mInv * (rho - finish.p) > 0
35  && start.p.transpose() * finish.mInv * (rho - start.p) > 0;
36  }
37 
38  };
39 
40  } // mcmc
41 
42 } // stan
43 
44 #endif
bool compute_criterion(ps_point &start, dense_e_point &finish, Eigen::VectorXd &rho)
dense_e_nuts(M &m, BaseRNG &rng, std::ostream *o=&std::cout, std::ostream *e=0)
Eigen::VectorXd p
Definition: ps_point.hpp:48
double e()
Return the base of the natural logarithm.
Definition: constants.hpp:86

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