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

Pareto-smoothing updates #314

Merged
merged 17 commits into from
Nov 23, 2023
Merged

Pareto-smoothing updates #314

merged 17 commits into from
Nov 23, 2023

Conversation

n-kall
Copy link
Collaborator

@n-kall n-kall commented Nov 15, 2023

Summary

Discussion points

What should we do with khat when using weight_draws? Should we add a message or warning if khat > 0.7 (or khat_threshold)?

TODO

  • add tests

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 7ea8037 is merged into master:

  •   :ballot_box_with_check:as_draws_array: 99.1ms -> 99.9ms [-0.62%, +2.11%]
  •   :ballot_box_with_check:as_draws_df: 31.6ms -> 31.5ms [-1.56%, +0.81%]
  •   :ballot_box_with_check:as_draws_list: 180ms -> 181ms [-0.65%, +0.93%]
  •   :rocket:as_draws_matrix: 30.3ms -> 29.1ms [-5.94%, -2.22%]
  •   :ballot_box_with_check:as_draws_rvars: 154ms -> 153ms [-1.88%, +1.06%]
  •   :ballot_box_with_check:summarise_draws_100_variables: 705ms -> 706ms [-0.69%, +0.94%]
  •   :ballot_box_with_check:summarise_draws_10_variables: 78.6ms -> 78ms [-1.84%, +0.45%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

Copy link
Collaborator

@paul-buerkner paul-buerkner left a comment

Choose a reason for hiding this comment

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

PR looks good to me. I just have one request for changes.

R/weight_draws.R Show resolved Hide resolved
Copy link

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

  •   :ballot_box_with_check:as_draws_array: 104ms -> 103ms [-6.45%, +4.46%]
  •   :rocket:as_draws_df: 34.9ms -> 33ms [-6.9%, -3.92%]
  •   :ballot_box_with_check:as_draws_list: 196ms -> 196ms [-1.6%, +2.38%]
  •   :ballot_box_with_check:as_draws_matrix: 30.2ms -> 31.8ms [-2.91%, +13.03%]
  •   :ballot_box_with_check:as_draws_rvars: 166ms -> 165ms [-3.17%, +1.53%]
  •   :ballot_box_with_check:summarise_draws_100_variables: 727ms -> 734ms [-1.44%, +3.41%]
  •   :ballot_box_with_check:summarise_draws_10_variables: 80.6ms -> 80.9ms [-0.85%, +1.59%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

Copy link

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

  •   :ballot_box_with_check:as_draws_array: 99.6ms -> 100ms [-0.67%, +2.23%]
  •   :ballot_box_with_check:as_draws_df: 31.6ms -> 31.8ms [-0.66%, +1.88%]
  •   :ballot_box_with_check:as_draws_list: 183ms -> 182ms [-1.3%, +1.06%]
  •   :ballot_box_with_check:as_draws_matrix: 29.2ms -> 28.9ms [-2.54%, +0.74%]
  •   :ballot_box_with_check:as_draws_rvars: 155ms -> 157ms [-1.5%, +3.85%]
  •   :ballot_box_with_check:summarise_draws_100_variables: 712ms -> 711ms [-0.54%, +0.16%]
  •   :ballot_box_with_check:summarise_draws_10_variables: 79.3ms -> 79ms [-1.29%, +0.33%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@paul-buerkner
Copy link
Collaborator

paul-buerkner commented Nov 15, 2023 via email

@paul-buerkner
Copy link
Collaborator

Ready to merge from my side. Anything you want to change before I merge?

Copy link

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

  •   :ballot_box_with_check:as_draws_array: 100ms -> 101ms [-0.9%, +1.45%]
  •   :rocket:as_draws_df: 34ms -> 31.9ms [-8.05%, -4.35%]
  •   :ballot_box_with_check:as_draws_list: 185ms -> 187ms [-0.73%, +2.55%]
  •   :ballot_box_with_check:as_draws_matrix: 31ms -> 29.8ms [-15.65%, +8.18%]
  • ❗🐌as_draws_rvars: 156ms -> 159ms [+0.45%, +3.64%]
  •   :ballot_box_with_check:summarise_draws_100_variables: 717ms -> 714ms [-1.05%, +0.16%]
  •   :ballot_box_with_check:summarise_draws_10_variables: 79.3ms -> 79.3ms [-0.95%, +0.97%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@n-kall
Copy link
Collaborator Author

n-kall commented Nov 17, 2023

Ready to merge from my side. Anything you want to change before I merge?

I think I should add some tests for the new functionality.

Also, I am now just adding a message if khat too high when adding weights. So a couple little things to add. I'll write here when done

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2023

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (e420f13) 95.52% compared to head (7ff4d6b) 95.28%.

❗ Current head 7ff4d6b differs from pull request most recent head b062ce4. Consider uploading reports for the commit b062ce4 to get more accurate results

Files Patch % Lines
R/pareto_smooth.R 82.60% 8 Missing ⚠️
R/weight_draws.R 81.81% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #314      +/-   ##
==========================================
- Coverage   95.52%   95.28%   -0.25%     
==========================================
  Files          47       47              
  Lines        3691     3734      +43     
==========================================
+ Hits         3526     3558      +32     
- Misses        165      176      +11     

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

Copy link

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

  •   :ballot_box_with_check:as_draws_array: 99.9ms -> 100ms [-0.21%, +1.13%]
  •   :ballot_box_with_check:as_draws_df: 31.9ms -> 32ms [-1.33%, +2%]
  •   :ballot_box_with_check:as_draws_list: 182ms -> 183ms [-1.33%, +2.73%]
  •   :ballot_box_with_check:as_draws_matrix: 29ms -> 29ms [-2.35%, +2.57%]
  •   :ballot_box_with_check:as_draws_rvars: 161ms -> 160ms [-4.54%, +2.57%]
  •   :ballot_box_with_check:summarise_draws_100_variables: 718ms -> 715ms [-1.05%, +0.21%]
  •   :ballot_box_with_check:summarise_draws_10_variables: 79.2ms -> 79.6ms [-0.57%, +1.6%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

Copy link

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

  •   :ballot_box_with_check:as_draws_array: 100ms -> 101ms [-0.12%, +2.26%]
  •   :rocket:as_draws_df: 34.8ms -> 31.6ms [-10.59%, -7.73%]
  •   :ballot_box_with_check:as_draws_list: 181ms -> 180ms [-0.92%, +0.46%]
  •   :ballot_box_with_check:as_draws_matrix: 30.3ms -> 30.5ms [-1.16%, +2.72%]
  •   :ballot_box_with_check:as_draws_rvars: 153ms -> 154ms [-1.53%, +1.78%]
  •   :ballot_box_with_check:summarise_draws_100_variables: 708ms -> 708ms [-0.3%, +0.45%]
  •   :ballot_box_with_check:summarise_draws_10_variables: 78.4ms -> 78.9ms [-0.72%, +1.93%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

Copy link

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

  • ❗🐌as_draws_array: 101ms -> 103ms [+1.52%, +2.97%]
  •   :rocket:as_draws_df: 35.4ms -> 32ms [-12.41%, -7.22%]
  •   :rocket:as_draws_list: 193ms -> 185ms [-8.02%, -0.2%]
  •   :ballot_box_with_check:as_draws_matrix: 30.7ms -> 30.6ms [-2.05%, +0.93%]
  •   :ballot_box_with_check:as_draws_rvars: 158ms -> 157ms [-2.53%, +1.28%]
  •   :ballot_box_with_check:summarise_draws_100_variables: 718ms -> 714ms [-1.37%, +0.45%]
  •   :ballot_box_with_check:summarise_draws_10_variables: 79.5ms -> 79.8ms [-0.76%, +1.34%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@n-kall
Copy link
Collaborator Author

n-kall commented Nov 23, 2023

I've now added tests and a message if pareto-k is high. I think it's ready from my side

Copy link

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

  •   :ballot_box_with_check:as_draws_array: 102ms -> 103ms [-0.26%, +2.43%]
  •   :ballot_box_with_check:as_draws_df: 33.8ms -> 32.4ms [-12.96%, +4.86%]
  •   :ballot_box_with_check:as_draws_list: 189ms -> 190ms [-1.91%, +2.46%]
  •   :ballot_box_with_check:as_draws_matrix: 30ms -> 29.9ms [-2.58%, +1.93%]
  •   :ballot_box_with_check:as_draws_rvars: 161ms -> 159ms [-3.95%, +1.56%]
  •   :ballot_box_with_check:summarise_draws_100_variables: 724ms -> 718ms [-2.1%, +0.46%]
  •   :ballot_box_with_check:summarise_draws_10_variables: 78.9ms -> 79.6ms [-0.18%, +1.99%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@paul-buerkner
Copy link
Collaborator

Perfect. Looks good. Merging now!

@paul-buerkner paul-buerkner merged commit adf3813 into stan-dev:master Nov 23, 2023
9 of 10 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.

3 participants