Skip to content

Commit

Permalink
fix threshold in print
Browse files Browse the repository at this point in the history
  • Loading branch information
avehtari committed Jan 26, 2024
1 parent 61c0725 commit 6565f45
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ print.psis_loo <- function(x, digits = 1, plot_k = FALSE, ...) {
print.loo(x, digits = digits, ...)
cat("------\n")
print_mcse_summary(x, digits = digits)
if (length(pareto_k_ids(x, threshold = 0.7))) {
S <- dim(x)[1]
k_threshold <- ps_khat_threshold(S)
if (length(pareto_k_ids(x, threshold = k_threshold))) {
cat("\n")
}
print(pareto_k_table(x), digits = digits)
Expand All @@ -65,7 +67,9 @@ print.psis_loo_ap <- function(x, digits = 1, plot_k = FALSE, ...) {
cat("------\n")
cat("Posterior approximation correction used.\n")
print_mcse_summary(x, digits = digits)
if (length(pareto_k_ids(x, threshold = 0.7))) {
S <- dim(x)[1]
k_threshold <- ps_khat_threshold(S)
if (length(pareto_k_ids(x, threshold = k_threshold))) {
cat("\n")
}
print(pareto_k_table(x), digits = digits)
Expand Down

0 comments on commit 6565f45

Please sign in to comment.