1 #ifndef STAN__MCMC__DENSE__E__METRIC__BETA
2 #define STAN__MCMC__DENSE__E__METRIC__BETA
4 #include <boost/random/variate_generator.hpp>
5 #include <boost/random/normal_distribution.hpp>
8 #include <Eigen/Cholesky>
19 template <
typename M,
typename BaseRNG>
29 return 0.5 * z.
p.transpose() * z.
mInv * z.
p;
36 return Eigen::VectorXd::Zero(this->
model_.num_params_r());
49 boost::variate_generator<BaseRNG&, boost::normal_distribution<> >
50 rand_dense_gaus(rng, boost::normal_distribution<>());
52 Eigen::VectorXd u(z.
p.size());
54 for (idx_t i = 0; i < u.size(); ++i)
55 u(i) = rand_dense_gaus();
57 z.
p = z.
mInv.llt().matrixL().solve(u);
const Eigen::VectorXd dtau_dp(dense_e_point &z)
double V(dense_e_point &z)
void sample_p(dense_e_point &z, BaseRNG &rng)
dense_e_metric(M &m, std::ostream *e)
Primary template class for the metaprogram to compute the index type of a container.
const Eigen::VectorXd dphi_dq(dense_e_point &z)
double tau(dense_e_point &z)
double e()
Return the base of the natural logarithm.
double phi(dense_e_point &z)
const Eigen::VectorXd dtau_dq(dense_e_point &z)
double T(dense_e_point &z)