You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: delay_opts() uses tolerance instead of max for certain distributions, but not uncertain.
Description:
Previously reported for certain distributions in #665 and fixed in #716
Reproducible Steps:
library("EpiNow2")
#> #> Attaching package: 'EpiNow2'#> The following object is masked from 'package:stats':#> #> Gammacertain<-EpiNow2::LogNormal(
mean=4,
sd=1
)
uncertain<-EpiNow2::LogNormal(
mean=EpiNow2::Normal(mean=4,sd=0.5),
sd=EpiNow2::Normal(mean=1, sd=0.5)
)
#> Warning: ! Uncertain lognormal distribution specified in terms of parameters that are#> not the "natural" parameters of the distribution meanlog and sdlog.#> ℹ Converting using a crude and very approximate method that is likely to#> produce biased results.#> ℹ If possible it is preferable to specify the distribution directly in terms of#> the natural parameters.EpiNow2::delay_opts(certain)
#> ℹ Unconstrained distributon passed as a delay.#> ℹ Constraining with default CDF cutoff 0.001.#> ℹ To silence this message, specify delay distributions with `max` or#> `tolerance`.#> - lognormal distribution (cdf_cutoff: 0.001):#> meanlog:#> 1.4#> sdlog:#> 0.25EpiNow2::delay_opts(uncertain)
#> Error in `check_stan_delay()`:#> ℹ All distribution passed to the model need to have a finite maximum,#> which can be achieved either by setting `max` or non-zero `cdf_cutoff`.
packageVersion("EpiNow2")
#> [1] '1.6.1'
This behaviour is as expected - we can't constrain uncertain distributions with a CDF cutoff.
The underlying reason is that this in that case we can't work out how long the constrained and discretised PMF is in advance (as it will depend on the parameter values as they're being sampled by stan) which creates all sorts of issues.
The issue could and should be addressed with better documentation / messaging.
Summary:
delay_opts()
uses tolerance instead of max for certain distributions, but not uncertain.Description:
Previously reported for certain distributions in #665 and fixed in #716
Reproducible Steps:
Created on 2024-11-20 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: