1 #ifndef STAN_MCMC_COVAR_ADAPTATION_HPP
2 #define STAN_MCMC_COVAR_ADAPTATION_HPP
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
6 #include <stan/math/prim/mat/fun/welford_covar_estimator.hpp>
27 double n =
static_cast<double>(
estimator_.num_samples());
28 covar = (n / (n + 5.0)) * covar
29 + 1e-3 * (5.0 / (n + 5.0))
30 * Eigen::MatrixXd::Identity(covar.rows(), covar.cols());
Probability, optimization and sampling library.
stan::math::welford_covar_estimator estimator_
bool end_adaptation_window()
bool learn_covariance(Eigen::MatrixXd &covar, const Eigen::VectorXd &q)
void compute_next_window()
unsigned int adapt_window_counter_