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

NonParametric distributions fail check_stan_delays() run #749

Closed
jamesmbaazam opened this issue Aug 20, 2024 · 0 comments · Fixed by #750
Closed

NonParametric distributions fail check_stan_delays() run #749

jamesmbaazam opened this issue Aug 20, 2024 · 0 comments · Fixed by #750

Comments

@jamesmbaazam
Copy link
Contributor

I noticed this error when I was trying to run the reprex in #735. Here's a reprex:

install.packages("EpiNow2", repos = c("https://epiforecasts.r-universe.dev", getOption("repos")))
#> Installing package into '/Users/lshja16/Library/R/arm64/4.4/library'
#> (as 'lib' is unspecified)
#> 
#> The downloaded binary packages are in
#>  /var/folders/vr/dn4r1_zj417drd1zr9301trw0000gp/T//RtmpzmFBEf/downloaded_packages
library(EpiNow2)
#> 
#> Attaching package: 'EpiNow2'
#> The following object is masked from 'package:stats':
#> 
#>     Gamma
# Passing NonParametric distributions leads to an error
try(generation_time_opts(dist = NonParametric(rep(0.1, 10))))
#> Error in get_parameters(dist, id) : 
#>   Cannot get parameters of a nonparametric distribution.
# hence epinow() fails
try(epinow(
  data = example_confirmed,
  generation_time = gt_opts(dist = NonParametric(rep(0.1, 10)))
  )
)
#> Logging threshold set at INFO for the EpiNow2 logger
#> Writing EpiNow2 logs to the console and: /var/folders/vr/dn4r1_zj417drd1zr9301trw0000gp/T//RtmpzmFBEf/regional-epinow/2020-06-30.log
#> Logging threshold set at INFO for the EpiNow2.epinow logger
#> Writing EpiNow2.epinow logs to the console and: /var/folders/vr/dn4r1_zj417drd1zr9301trw0000gp/T//RtmpzmFBEf/epinow/2020-06-30.log
#> Error in get_parameters(dist, id) : 
#>   Cannot get parameters of a nonparametric distribution.

Created on 2024-08-20 with reprex v2.1.1

@jamesmbaazam jamesmbaazam changed the title Error when NonParametric distributions are passed to any of the opts functions Error with NonParametric distributions passed to opts functions Aug 20, 2024
@jamesmbaazam jamesmbaazam changed the title Error with NonParametric distributions passed to opts functions NonParametric distributions fail check_stan_delays() run Aug 20, 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 a pull request may close this issue.

1 participant