src/algorithms/marginal_algorithm.cc
//! \param grid Grid of points in matrix form to evaluate the density on
//! \param coll Collector containing the algorithm chain
//! \return     Matrix whose i-th column is the lpdf at i-th iteration
\param grid Grid of points in matrix form to evaluate the density on
\param coll Collector containing the algorithm chain
\return     Matrix whose i-th column is the lpdf at i-th iteration
\ param grid Grid of points in matrix form to evaluate the density on \ param coll Collector containing the algorithm chain \ return Matrix whose i - th column is the lpdf at i - th iteration
Eigen::MatrixXd MarginalAlgorithm::eval_lpdf(const Eigen::MatrixXd &grid,
                                             BaseCollector *coll) {
  std::deque<Eigen::VectorXd> lpdf;
  bool keep = true;
  progresscpp::ProgressBar bar(coll->get_size(), 60);
  while (keep) {
    keep = update_state_from_collector(coll);
    if (!keep) {
      break;
    }
    lpdf.push_back(lpdf_from_state(grid));
    ++bar;
    bar.display();
  }
  coll->reset();
  bar.done();
  return bayesmix::stack_vectors(lpdf);
}
Eigen :: MatrixXd MarginalAlgorithm :: eval_lpdf ( const Eigen :: MatrixXd & grid , BaseCollector * coll ) { std :: deque < Eigen :: VectorXd > lpdf ; bool keep = true ; progresscpp :: ProgressBar bar ( coll -> get_size ( ) , 60 ) ; while ( keep ) { keep = update_state_from_collector ( coll ) ; if ( ! keep ) { break ; } lpdf . push_back ( lpdf_from_state ( grid ) ) ; ++ bar ; bar . display ( ) ; } coll -> reset ( ) ; bar . done ( ) ; return bayesmix :: stack_vectors ( lpdf ) ; }
\param grid Grid of points in matrix form to evaluate the density on
\param coll Collector containing the algorithm chain
\return     Matrix whose i-th column is the lpdf at i-th iteration
\ param grid Grid of points in matrix form to evaluate the density on \ param coll Collector containing the algorithm chain \ return Matrix whose i - th column is the lpdf at i - th iteration
// Loop over non-burn-in algorithm iterations