This release introduces the new accumulation feature, where models can fitted to data reported at regular or irregular intervals. Moreover, all priors are now specified using the internal distribution interface.
Internal changes should improve performance, reduce the number of failing fits, and pave the way for future model flexibility.
Model changes
-
The models now support more complex patterns of aggregating reported cases by accumulating them over multiple time points, as well as mixtures of accumulation and missingness via the new
fill_missing()
function and a logicalaccumulate
column that can be supplied with the data. If the accumulation frequency is fixed in the data this is detected when usingfill_missing()
. By @sbfnk in #851 and #933 and reviewed by @seabbs and @jamesmbaazam.# Deprecated data |> estimate_infections(obs_opts(na = "accumulate")) # Recommended workflow e.g. for weekly incidence data data |> fill_missing(missing = "accumulate", initial_accumulate = 7) |> estimate_infections()
-
A bug was fixed where the initial growth was never estimated (i.e. the prior mean was always zero). By @sbfnk in #853 and reviewed by @seabbs.
-
A bug was fixed where an internal function for applying a default cdf cutoff failed due to a difference a vector length issue. By @jamesmbaazam in #858 and reviewed by @sbfnk.
-
All parameters have been changed to the new parameter interface. By @sbfnk in #871 and #890 and reviewed by @seabbs.
-
The Gaussian Process lengthscale is now scaled internally by half the length of the time series. By @sbfnk in #890 and reviewed by @seabbs.
-
A bug was fixed where
plot.dist_spec()
wasn't throwing an informative error due to an incomplete check for the max of the specified delay. By @jamesmbaazam in #858 and reviewed by @sbfnk. -
Updated the early dynamics calculation to estimate growth from the initial reproduction number instead of a separate linear model. Also changed the prior calculation for initial infections to be a scaling factor of early case numbers adjusted by the growth estimate, instead a true number of initial infections. By @sbfnk in #923 (with initial exploration in #903) and reviewed by @seabbs and @SamuelBrand1.
-
A bug was fixed in the non-mechanistic model where the final period could have discontinuities. By @sbfnk in # and reviewed by @seabbs.
Package changes
- The internal functions
create_clean_reported_cases()
has been broken up into several functions, with relevant onesfilter_leading_zeros()
,add_breakpoints()
andapply_zero_threshold()
exposed to the user. By @sbfnk in #884 and reviewed by @seabbs and @jamesmbaazam. - The step of estimating early infections and growth in the internal function
create_stan_data()
has been separated into a new internal functionestimate_early_dynamics()
. By @jamesmbaazam in #888 and reviewed by @sbfnk. estimate_infections()
andepinow()
gain theforecast
argument for setting the forecast horizon (horizon
) and accumulation of forecasts.forecast
is set with theforecast_opts()
function similar to the other settings arguments. By @sbfnk in #901 and @jamesmbaazam in #912 and reviewed by each other.
Documentation
- Brought the docs on
alpha_sd
up to date with the code change from prior PR #853. By @zsusswein in #862 and reviewed by @jamesmbaazam. - The
...
argument inestimate_secondary()
has been removed because it was not used. By @jamesmbaazam in #894 and reviewed by @sbfnk. - All examples now use the natural parameters of distributions rather than the mean and standard deviation when specifying uncertain distributions. This is to eliminate warnings and encourage best practice. By @jamesmbaazam in #893 and reviewed by @sbfnk.
- Updated the methodology vignettes, By @sbfnk in #919 and reviewed by @seabbs and @jamesmbaazam.
- The ways that
dist_spec()
with certain/uncertain parameters can be constrained has been clarified. By @sbfnk in #940 and reviewed by @jamesmbaazam. - Language in plots and summaries was adapted to reflect potentially non-daily data. By @sbfnk in #947 and reviewed by @seabbs.