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 cbea72f commit dbf6a9f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/stan/mcmc/chains.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,25 @@ 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 dbf6a9f

Please sign in to comment.