Skip to content

feat: re-add simplify= to print.compare.loo (#366)#369

Open
LeonidasZhak wants to merge 2 commits into
stan-dev:masterfrom
LeonidasZhak:feature/re-add-print-compare-loo-simplify
Open

feat: re-add simplify= to print.compare.loo (#366)#369
LeonidasZhak wants to merge 2 commits into
stan-dev:masterfrom
LeonidasZhak:feature/re-add-print-compare-loo-simplify

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Summary

Re-adds a simplify parameter to print.compare.loo() (default TRUE), addressing #366.

When simplify = FALSE, the full comparison table is printed including pointwise ELPD, LOOIC/WAIC, and their standard errors for each model. This restores functionality that was available in previous versions of loo.

Changes

  • R/loo_compare.R: Add simplify parameter to print.compare.loo() with roxygen documentation
  • man/loo_compare.Rd: Regenerated by roxygen2
  • man/loo-package.Rd: Minor roxygen2 update

Example

comp <- loo_compare(loo1, loo2, loo3)

# default (simplified) output
print(comp)

# full output with all ELPD/LOOIC columns
print(comp, simplify = FALSE)

Testing

  • All existing tests pass: [ FAIL 0 | WARN 0 | SKIP 2 | PASS 1144 ]
  • Manual verification that simplify = TRUE (default) produces identical output to current behavior
  • Manual verification that simplify = FALSE correctly displays all available estimate columns

Closes #366

Add a 'simplify' parameter (default TRUE) to print.compare.loo().
When simplify=FALSE, the full comparison table is printed including
pointwise ELPD, LOOIC/WAIC, and their standard errors for each model.

This restores functionality that was available in previous versions
of loo, where users could see the complete model comparison output.

Changes:
- R/loo_compare.R: Add simplify parameter with documentation
- man/loo_compare.Rd: Regenerated by roxygen2
- man/loo-package.Rd: Minor roxygen2 update
@codecov-commenter

codecov-commenter commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.49%. Comparing base (286263d) to head (beec4b6).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
R/loo_compare.R 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #369      +/-   ##
==========================================
- Coverage   92.70%   92.49%   -0.22%     
==========================================
  Files          31       31              
  Lines        3029     3037       +8     
==========================================
+ Hits         2808     2809       +1     
- Misses        221      228       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

This is how benchmark results would change (along with a 95% confidence interval in relative change) if beec4b6 is merged into master:

  • ✔️loo_function: 1.89s -> 1.89s [-0.6%, +0.33%]
  • ✔️loo_matrix: 1.7s -> 1.7s [-0.58%, +0.67%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@florence-bockting

Copy link
Copy Markdown
Contributor

Thank you @LeonidasZhak for opening this PR. We had some discussion about whether to include/exclude this argument from loo_compare in this PR.
Therefore, we (@avehtari, @jgabry) need probably to discuss first how we want to handle this aspect and then we will come back to your PR.

@florence-bockting

florence-bockting commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Thanks again @LeonidasZhak for the PR.
Please read our AI contribution policy and disclose any use of AI.
Additionally, please add tests for any changes you make to functions; stating "manual verification" is not sufficient.
Finally, please avoid making changes to files unrelated to this PR, as was done in loo-package.Rd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-add print.compare.loo(simplify=)

4 participants