Skip to content

Commit

Permalink
changes per code review; remove call to rank-normalized-split-rhat fr…
Browse files Browse the repository at this point in the history
…om chains.hpp, otherwise, leave in place
  • Loading branch information
mitzimorris committed Sep 30, 2024
1 parent 23a2022 commit cbea72f
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/stan/mcmc/chains.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class chains {
using boost::accumulators::tag::tail;
using boost::accumulators::tag::tail_quantile;
double M = x.rows();
// size_t cache_size = std::min(prob, 1-prob)*M + 2;
size_t cache_size = M;

if (prob < 0.5) {
Expand Down Expand Up @@ -146,8 +145,7 @@ class chains {
using boost::accumulators::tag::tail_quantile;
double M = x.rows();

// size_t cache_size = M/2 + 2;
size_t cache_size = M; // 2 + 2;
size_t cache_size = M;

accumulator_set<double, stats<tail_quantile<left> > > acc_left(
tail<left>::cache_size = cache_size);
Expand Down Expand Up @@ -592,24 +590,6 @@ class chains {
double split_effective_sample_size(const std::string& name) const {
return split_effective_sample_size(index(name));
}

double split_potential_scale_reduction(const int index) const {
int n_chains = num_chains();
std::vector<const double*> draws(n_chains);
std::vector<size_t> sizes(n_chains);
int n_kept_samples = 0;
for (int chain = 0; chain < n_chains; ++chain) {
n_kept_samples = num_kept_samples(chain);
draws[chain]
= samples_(chain).col(index).bottomRows(n_kept_samples).data();
sizes[chain] = n_kept_samples;
}
return analyze::compute_split_potential_scale_reduction(draws, sizes);
}

double split_potential_scale_reduction(const std::string& name) const {
return split_potential_scale_reduction(index(name));
}
};

} // namespace mcmc
Expand Down

0 comments on commit cbea72f

Please sign in to comment.