Stan
2.5.0
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
stan
mcmc
hmc
nuts
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
4
#include <
stan/mcmc/hmc/nuts/base_nuts.hpp
>
5
#include <
stan/mcmc/hmc/hamiltonians/dense_e_point.hpp
>
6
#include <
stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp
>
7
#include <
stan/mcmc/hmc/integrators/expl_leapfrog.hpp
>
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
31
bool
compute_criterion
(
ps_point
& start,
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
stan::mcmc::base_mcmc::name_
std::string name_
Definition:
base_mcmc.hpp:38
stan::mcmc::dense_e_nuts::compute_criterion
bool compute_criterion(ps_point &start, dense_e_point &finish, Eigen::VectorXd &rho)
Definition:
dense_e_nuts.hpp:31
stan::mcmc::ps_point
Definition:
ps_point.hpp:16
stan::mcmc::dense_e_metric
Definition:
dense_e_metric.hpp:20
stan::mcmc::base_nuts
Definition:
base_nuts.hpp:32
stan::mcmc::dense_e_nuts::dense_e_nuts
dense_e_nuts(M &m, BaseRNG &rng, std::ostream *o=&std::cout, std::ostream *e=0)
Definition:
dense_e_nuts.hpp:25
stan::mcmc::ps_point::p
Eigen::VectorXd p
Definition:
ps_point.hpp:48
dense_e_metric.hpp
stan::mcmc::dense_e_point::mInv
Eigen::MatrixXd mInv
Definition:
dense_e_point.hpp:18
dense_e_point.hpp
stan::mcmc::expl_leapfrog
Definition:
expl_leapfrog.hpp:12
expl_leapfrog.hpp
stan::math::e
double e()
Return the base of the natural logarithm.
Definition:
constants.hpp:86
stan::mcmc::dense_e_point
Definition:
dense_e_point.hpp:12
base_nuts.hpp
stan::mcmc::dense_e_nuts
Definition:
dense_e_nuts.hpp:17
[
Stan Home Page
]
© 2011–2014, Stan Development Team.