Skip to content

Commit dbf6a9f

Browse files
committed
changes per code review; remove call to rank-normalized-split-rhat from chains.hpp, otherwise, leave in place
1 parent cbea72f commit dbf6a9f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/stan/mcmc/chains.hpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,25 @@ class chains {
590590
double split_effective_sample_size(const std::string& name) const {
591591
return split_effective_sample_size(index(name));
592592
}
593+
594+
double split_potential_scale_reduction(const int index) const {
595+
int n_chains = num_chains();
596+
std::vector<const double*> draws(n_chains);
597+
std::vector<size_t> sizes(n_chains);
598+
int n_kept_samples = 0;
599+
for (int chain = 0; chain < n_chains; ++chain) {
600+
n_kept_samples = num_kept_samples(chain);
601+
draws[chain]
602+
= samples_(chain).col(index).bottomRows(n_kept_samples).data();
603+
sizes[chain] = n_kept_samples;
604+
}
605+
606+
return analyze::compute_split_potential_scale_reduction(draws, sizes);
607+
}
608+
609+
double split_potential_scale_reduction(const std::string& name) const {
610+
return split_potential_scale_reduction(index(name));
611+
}
593612
};
594613

595614
} // namespace mcmc

0 commit comments

Comments
 (0)