Skip to content

Added sorted log ratio path for loo - #452

Open
VisruthSK wants to merge 6 commits into
masterfrom
ps-tail-specialization
Open

VisruthSK wants to merge 6 commits into
masterfrom
ps-tail-specialization

Conversation

@VisruthSK

@VisruthSK VisruthSK commented Jun 17, 2026 •

Copy link
Copy Markdown
Member

This PR was made with assistance from Codex and Claude.

Summary

Add ps_tail_sorted_log_ratios(), a specialized helper for loo to use when the log-ratio tail has already been sorted. See stan-dev/loo#290, especially this comment for more motivation.

Removed warning in ps_tail() for too few tail draws as the aforementioned comment suggests. Also deduplicate some code in ps_tail() with a new internal helper.

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@github-actions

This comment was marked as outdated.

@VisruthSK
VisruthSK marked this pull request as ready for review June 18, 2026 03:04
@VisruthSK
VisruthSK requested a review from avehtari June 18, 2026 03:04
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

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

  • ✔️as_draws_array: 142ms -> 143ms [-0.39%, +1.18%]
  • ✔️as_draws_df: 68ms -> 68.1ms [-1.1%, +1.47%]
  • ✔️as_draws_list: 158ms -> 159ms [-0.79%, +1.37%]
  • ✔️as_draws_matrix: 24.7ms -> 25ms [-0.7%, +2.64%]
  • ✔️as_draws_rvars: 113ms -> 113ms [-0.81%, +1.13%]
  • ✔️summarise_draws_100_variables: 743ms -> 741ms [-0.86%, +0.27%]
  • ✔️summarise_draws_10_variables: 81.8ms -> 81.9ms [-0.19%, +0.43%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@avehtari avehtari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function might need NEWS.md item

Comment thread R/pareto_smooth.R
Comment thread R/pareto_smooth.R
Comment thread R/pareto_smooth.R
Comment thread R/pareto_smooth.R
Comment thread R/pareto_smooth.R Outdated
@VisruthSK
VisruthSK requested a review from avehtari October 7, 2026 01:53

@avehtari avehtari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@jgabry

jgabry commented Oct 14, 2026

Copy link
Copy Markdown
Member

@VisruthSK is this waiting on anything else? Also does this include the performance benefit from that loo PR that we closed?

@VisruthSK

Copy link
Copy Markdown
Member Author

I think I need to implement that after which it's gtg

@VisruthSK
VisruthSK force-pushed the ps-tail-specialization branch from 7be3b39 to bdb0066 Compare October 18, 2026 21:20

This branch has not been deployed

No deployments
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.

3 participants