Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change pareto functions to return unnamed numerics #370

Merged
merged 4 commits into from
May 16, 2024

Conversation

n-kall
Copy link
Collaborator

@n-kall n-kall commented May 16, 2024

Summary

This changes pareto_* functions to no longer return named numeric values if there is just a single value output.
This applies to pareto_khat, pareto_khat_threshold, pareto_min_ss, and pareto_convergence_rate.

pareto_diags returns a named vector of all of these. And pareto_smooth is not affected by this.

This also changes the return type of pareto_khat to be an unnamed numeric rather than a list, which would require a change in loo (specifically E_loo). As there is already an issue that needed to be worked around (stan-dev/loo/issues/263) I think this is worth addressing now.

This would close #359 and #346

Copyright and Licensing

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

Copy link

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

  • ✔️as_draws_array: 154ms -> 152ms [-2.74%, +0.37%]
  • ✔️as_draws_df: 73.2ms -> 73.9ms [-0.41%, +2.37%]
  • ✔️as_draws_list: 173ms -> 173ms [-1.09%, +1.01%]
  • ✔️as_draws_matrix: 69.7ms -> 69.7ms [-1.26%, +1.32%]
  • ✔️as_draws_rvars: 86.7ms -> 86.3ms [-1.34%, +0.46%]
  • ✔️summarise_draws_100_variables: 718ms -> 716ms [-1.17%, +0.44%]
  • ✔️summarise_draws_10_variables: 120ms -> 120ms [-1%, +0.58%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@paul-buerkner
Copy link
Collaborator

Looks good to me. Do you want to make any changes before I merge?

@n-kall
Copy link
Collaborator Author

n-kall commented May 16, 2024

I think it's ready

@paul-buerkner
Copy link
Collaborator

great! Merging now. Thank you!

@paul-buerkner paul-buerkner merged commit 4d3ccf1 into stan-dev:master May 16, 2024
11 checks passed
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.

pareto_khat should always return the same data structure
2 participants