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

Update deprecated syntax for future rstan compatibility #453

Merged
merged 4 commits into from
Sep 18, 2023
Merged

Update deprecated syntax for future rstan compatibility #453

merged 4 commits into from
Sep 18, 2023

Conversation

andrjohns
Copy link
Contributor

Now that rstan 2.26 is available on CRAN we need to update the deprecated syntax in your package's Stan models, otherwise it will fail to install with an upcoming version of RStan.

The following updates have been made:

  • New array syntax
  • _cdf functions using conditional | notation (i.e., _cdf(y |x))
    • The current CRAN rstan has a bug in recognising this in _cdf functions, so I've updated your syntax to work on the log scale with the respective _lcdf function. This will let your package be compatible with the current and future parser, and is also more numerically stable with extreme values (bonus!)

More information about the deprecated and removed syntax in Stan can be found here:

If you could merge and submit to CRAN soon, it would be greatly appreciated.

Let me know if you have any questions about these changes.

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2023

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

  •   :ballot_box_with_check:default: 44.5s -> 46.8s [-13.95%, +24.13%]
  •   :ballot_box_with_check:no_delays: 45.7s -> 50.4s [-0.51%, +20.9%]
  •   :ballot_box_with_check:random_walk: 14.4s -> 14.6s [-8%, +10.98%]
  •   :ballot_box_with_check:stationary: 26.5s -> 28.2s [-2.71%, +15.79%]
  •   :ballot_box_with_check:uncertain: 1.08m -> 1.15m [-5.03%, +16.71%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@sbfnk
Copy link
Contributor

sbfnk commented Sep 10, 2023

Thanks! Exciting to see the rstan update on CRAN. I had a look at the failing checks and as far as I can see it seem to be due to this issue I just opened on rstan.

@andrjohns
Copy link
Contributor Author

Thanks! Exciting to see the rstan update on CRAN. I had a look at the failing checks and as far as I can see it seem to be due to this issue I just opened on rstan.

Thanks for flagging! I've opened a PR with a fix and I'll let you know when it's made it to CRAN

@seabbs
Copy link
Contributor

seabbs commented Sep 11, 2023

As we aren't testing stan code on CRAN (just on our CI) and that is what we use expose_stan_functions() for we should be able to update on CRAN/merge this without waiting on that PR fix. We would need to temporarily pause CI checks of the stan code in order to do this (to avoid CI checks failing on main).

That does leave on outstanding issue which is causing R-CMD-as-CRAN-check to fail which is the estimate_truncation example erroring - will check this out today to see what the issue is.

@sbfnk
Copy link
Contributor

sbfnk commented Sep 15, 2023

@andrjohns can you rebase to main / merge to see if the as-cran-check is fixed by #454?

@github-actions
Copy link
Contributor

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

  •   :ballot_box_with_check:default: 44.6s -> 46.2s [-10.62%, +18%]
  •   :ballot_box_with_check:no_delays: 49.4s -> 48.5s [-17.18%, +13.69%]
  •   :ballot_box_with_check:random_walk: 15s -> 15.2s [-10.02%, +12.91%]
  •   :ballot_box_with_check:stationary: 29.1s -> 29s [-6.6%, +5.66%]
  •   :ballot_box_with_check:uncertain: 1.15m -> 1.22m [-4.5%, +16.81%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@sbfnk sbfnk mentioned this pull request Sep 18, 2023
@sbfnk
Copy link
Contributor

sbfnk commented Sep 18, 2023

CRAN checks passing so merging for CRAN submission as discussed

@sbfnk sbfnk merged commit fac8567 into epiforecasts:main Sep 18, 2023
6 of 11 checks passed
sbfnk pushed a commit that referenced this pull request May 3, 2024
sbfnk pushed a commit that referenced this pull request May 3, 2024
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