Releases: epiforecasts/EpiNow2
EpiNow2 1.8.0
This is a major release with significant API improvements, new features, and bug fixes.
Highlights
- Unified return structure: All main modelling functions (
estimate_infections(),estimate_secondary(),estimate_truncation(),epinow()) now return consistent S3 objects withfit,args, andobservationselements - New accessor methods:
get_samples(),get_predictions(),get_parameters(), andsummary()provide a consistent interface across all model types - scoringutils integration:
get_predictions()supports"sample"and"quantile"output formats for direct use with the scoringutils package - Improved discretisation: Now uses the primarycensored package for more accurate PMF calculations
- Population-adjusted Rt: Accounts for susceptible depletion when
popis specified inrt_opts()
Breaking changes
- Changed
discretise()to use theprimarycensoredpackage for double censored PMF calculations - Changed population-adjusted Rt estimates to account for susceptible depletion
- Removed deprecated functions and arguments from v1.5.0/v1.6.0
- The
variablecolumn inget_samples()andsummary()output now contains semantic parameter names
New features
- Added
get_samples(),get_predictions(), andget_parameters()S3 generics - Added support for fitting the susceptible population size
- Added growth rate estimation using Parag et al. (2022) method via
growth_methodargument - Added
styleargument to plot methods for error bar display - Added comprehensive prior choice guide vignette
Bug fixes
- Fixed incorrect Rt prior in vignettes causing divergent transitions
- Fixed
report_log_likusing wrong overdispersion parameter - Fixed
CrIsparameter not being passed through inepinow() - Fixed
forecast_infections()failing withsamples = 1 - Fixed Matern 5/2 Gaussian process kernel implementation
- Many other fixes (see full changelog)
Full Changelog: See NEWS.md for complete details.
EpiNow2 1.7.1
This is a patch release in response to an upstream issue in rstan, as flagged in CRAN checks.
EpiNow2 1.7.0
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 logicalaccumulatecolumn 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 theforecastargument for setting the forecast horizon (horizon) and accumulation of forecasts.forecastis 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_sdup 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.
EpiNow2 1.6.1
Model changes
- A bug in the spectral densities of Matern kernels of order other than 3/2 has been fixed and the vignette updated accordingly. By @sbfnk in #835 and reviewed by @seabbs.
- Changed the prior on the (square root of the) magnitude alpha of the Gaussian Process back to HalfNormal(0, 0.05) based on user feedback of unexpected results. By @sbfnk in #840 and reviewed by @jamesmbaazam.
Package changes
- Users are now informed that
NAobservations (if present implicitly or explicitly) will be treated as missing instead of zero when using the defaultobs_opts(). Options to treatNAas zeros or accumulate them are also provided in the message. By @jamesmbaazam in #774 and reviewed by @sbfnk.
EpiNow2 1.6.0
A release that introduces model improvements to the Gaussian Process models, alongside a number of other improvements and bug fixes.
Documentation
- The documentation of the
rtargument has been expanded in the case wherert = NULLto make explicit the settings that are applied in that case. By @jamesmbaazam in #779 and reviewed by @sbfnk. - The README has been updated to link to the free course on nowcasting and forecasting. The availability of variational inference, Laplace approximation, and Pathfinder through
cmdstanrhas also be surfaced. By @jamesmbaazam in #753 and reviewed by @seabbs. - Some implicit argument defaults have been made explicit in the function definition. By @Bisaloo in #729.
- The installation guide in the README has been updated to provide instructions for configuring the C toolchain of Windows, MacOS, and Linux. By @jamesmbaazam in #707 and reviewed by @sbfnk.
Model changes
- The interface for defining delay distributions has been generalised to also cater for continuous distributions
- When defining probability distributions these can now be truncated using the
toleranceargument - Ornstein-Uhlenbeck and 5 / 2 Matérn kernels have been added. By @sbfnk in #741 and reviewed by @seabbs.
- Gaussian processes have been vectorised, leading to some speed gains 🚀 , and the
gp_opts()function has gained three more options, "periodic", "ou", and "se", to specify periodic and linear kernels respectively. By @seabbs in #742 and reviewed by @jamesmbaazam. - Prior predictive checks have been used to update the following priors: the prior on the magnitude of the Gaussian process (from HalfNormal(0, 1) to HalfNormal(0, 0.1)), and the prior on the overdispersion (from 1 / HalfNormal(0, 1)^2 to 1 / HalfNormal(0, 0.25)). In the user-facing API, this is a change in default values of the
sdofphiinobs_opts()from 1 to 0.25. By @seabbs in #742 and reviewed by @jamesmbaazam. - The default stan control options have been updated from
list(adapt_delta = 0.95, max_treedepth = 15)tolist(adapt_delta = 0.9, max_treedepth = 12)due to improved performance and to reduce the runtime of the default parameterisations. By @seabbs in #742 and reviewed by @jamesmbaazam. - Initialisation has been simplified by sampling directly from the priors, where possible, rather than from a constrained space. By @seabbs in #742 and reviewed by @jamesmbaazam.
- Unnecessary normalisation of delay priors has been removed. By @seabbs in #742 and reviewed by @jamesmbaazam.
- Ornstein-Uhlenbeck and 5 / 2 Matérn kernels have been added. By @sbfnk in #741 and reviewed by @seabbs.
- Switch to broadcasting from random walks and added unit tests. By @seabbs in #747 and reviewed by @jamesmbaazam.
- Optimised convolution code to take into account the relative length of the vectors being convolved. See #745 by @seabbs and reviewed by @jamesmbaazam.
- Switch to broadcasting the day of the week effect. By @seabbs in #746 and reviewed by @jamesmbaazam.
- A warning is now thrown if nonparametric PMFs passed to delay options have consecutive tail values that are below a certain low threshold as these lead to loss in speed with little gain in accuracy. By @jamesmbaazam in #752 and reviewed by @seabbs, with a subsequent bug fix in #802.
dist_fit()can now accept any number ofsampleswithout throwing a warning whensamples< 1000 in #751 by @jamesmbaazam and reviewed by @seabbs and @sbfnk.
Package changes
epinow()now returns the "timing" output in a "time difference"" format that is easier to understand and work with. By @jamesmbaazam in #688 and reviewed by @sbfnk.- All functions now use the
{cli}R package to signal errors, warnings, and messages. By @jamesmbaazam in #762 and reviewed by @seabbs. fix_dist()has been renamed tofix_parameters()because it removes the uncertainty in a distribution's parameters. By @sbfnk in #733 and reviewed by @jamesmbaazam.plot.dist_specnow uses color instead of line types to display pmfs vs cmfs. By @jamesmbaazam in #788 and reviewed by @sbfnk.- The use of the
{progressr}package for displaying progress bars is now optional, as is the use of{future}and{future.apply}for parallelisation. By @sbfnk in #798 and reviewed by @seabbs. - Specifying nonparametric generation time intervals with a nonzero first element (corresponding to the zero bin) is being deprecated as the current behaviour of setting it to zero internally was not well exposed. By @sbfnk in #.
Bug fixes
- a bug was fixed that caused delay option functions to report an error if only the CDF cutoff was specified. By @sbfnk in #716 and reviewed by @jamesmbaazam.
- a bug was fixed where
forecast_secondary()did not work with fixed delays. By @sbfnk in #717 and reviewed by @seabbs. - a bug was fixed that caused delay option functions to report an error if only the CDF cutoff was specified. By @sbfnk.
- a bug was fixed that led to the truncation PMF being shortened from the wrong side when the truncation PMF was longer than the supplied data. By @seabbs in #736 and reviewed by @sbfnk and @jamesmbaazam.
- a bug was fixed that caused internal validation checks on delay distributions to fail if they contained non-parametric distributions. By @jamesmbaazam in #750 and reviewed by @seabbs.
- a bug was fixed where combined distributions where shown in alphabetical order, rather than the order in which they were combined. By @sbfnk in #784 and reviewed by @jamesmbaazam.
Documentation
- Updated the documentation of the dots argument of the
stan_sampling_opts()to add that the dots are passed tocmdstanr::sample(). By @jamesmbaazam in #699 and reviewed by @sbfnk. generation_time_opts()has been shortened togt_opts()to make it easier to specify. Calls to both functions are equivalent. By @jamesmbaazam in #698 and reviewed by @seabbs and @sbfnk .- Added stan documentation for
update_rt(). By @seabbs in #747 and reviewed by @jamesmbaazam.
EpiNow2 1.5.2
A patch release to further fix an issue with the date in the package citation. This has now been addressed by removing inst/CITATION.
EpiNow2 1.5.1
A patch release to fix an issue with the date in the package citation.
EpiNow2 1.5.0
This release comes with a change of maintainer, from @seabbs to @sbfnk.
This is to reflect who will handle the upcoming CRAN submission, but is not expected to lead to a change in workflows.
Major changes
- The interface to generating delay distributions has been completely overhauled. Instead of calling
dist_spec()users now specify distributions using functions that represent the available distributions, i.e.LogNormal(),Gamma()andFixed(). See?EpiNow2::Distributions. Uncertainty is specified using calls of the same nature, toNormal(). More information on the underlying design can be found ininst/dev/design_dist.mdBy @sbfnk in #504 and reviewed by @seabbs. - Delay discretisation is now based on a two-day censoring window (with uniform probability in between), based on recommendations in Park et al, medRxiv, 2024. By @sbfnk in #518 and reviewed by @jamesmbaazam.
Deprecations
- The functions
sample_approx_dist(),report_cases(), andadjust_infection_reports()have been deprecated as the functionality they provide can now be achieved withsimulate_secondary(). See #597 by @jamesmbaazam and reviewed by @sbfnk. - The utility function
update_list()has been deprecated in favour ofutils::modifyList()because it comes with an installation of R. By @jamesmbaazam in #491 and reviewed by @seabbs. - The
fixedargument todist_spechas been deprecated and replaced by afix_dist()function. By @sbfnk in #503 and reviewed by @seabbs. - The functions
get_dist(),get_generation_time(),get_incubation_period()have been deprecated and replaced with examples. By @sbfnk in #481 and reviewed by @seabbs. - The function
init_cumulative_fit()has been deprecated. By @jamesmbaazam in #541 and reviewed by @sbfnk. - The model-specific
weigh_delay_priorsargument has been deprecated in favour of delay-specific prior weighting usingweight_priors. Seegeneration_time_opts(),delay_opts(), andtrunc_opts(). By @sbfnk in #630 and reviewed by @jamesmbaazam. - All functions now use a
dataargument to pass data. The existingreported_cases,reports, andobsarguments are deprecated and will be removed in v2.0.0. By @jamesmbaazam in #638 and reviewed by @sbfnk.
Other breaking changes
- Updated
estimate_infections()so that rather than imputing missing data, it now skips these data points in the likelihood. This is a breaking change as it alters the behaviour of the model when dates are missing from a time series but are known to be zero. We recommend that users check their results when updating to this version but expect this to in most cases improve performance. By @seabbs in #528 and reviewed by @sbfnk. simulate_infectionshas been renamed toforecast_infectionsin line withsimulate_secondaryandforecast_secondary. The terminology is: a forecast is done from a fit to existing data, a simulation from first principles. By @sbfnk in #544 and reviewed by @seabbs.- A new
simulate_infectionsfunction has been added that can be used to simulate from the model from given initial conditions and parameters. By @sbfnk in #557 and reviewed by @jamesmbaazam. - The function
init_cumulative_fit()has been deprecated. By @jamesmbaazam in #541 and reviewed by @sbfnk. - The interface to generating delay distributions has been completely overhauled. Instead of calling
dist_spec()users now specify distributions using functions that represent the available distributions, i.e.LogNormal(),Gamma()andFixed(). Uncertainty is specified using calls of the same nature, toNormal(). More information on the underlying design can be found ininst/dev/design_dist.mdBy @sbfnk in #504 and reviewed by @seabbs. - The accessor functions
get_parameters(),get_pmf(), andget_distribution()have been added to extract elements of a <dist_spec> object. By @sbfnk in #646 and reviewed by @jamesmbaazam. - The functions
sample_approx_dist(),report_cases(), andadjust_infection_reports()have been deprecated as the functionality they provide can now be achieved withsimulate_secondary(). See #597 by @jamesmbaazam and reviewed by @sbfnk.
Documentation
- Two new vignettes have been added to cover the workflow and example uses. By @sbfnk in #458 and reviewed by @jamesmbaazam.
- Removed references to the no longer existing
forecast_infectionsfunction. By @sbfnk in #460 and reviewed by @seabbs. - The contribution guide has been improved to include more detail on ways to contribute new features/enhancements, report bugs, and improve or suggest vignettes. By @jamesmbaazam in #464 and reviewed by @seabbs.
- Updated the code in
inst/CITATIONand added a GitHub Actions workflow to auto-generatecitation.cffso that the two citation files are always in sync withDESCRIPTION. By @jamesmbazam in #467, with contributions from @Bisaloo, and reviewed by @seabbs and @sbfnk. - Updated the documentation of the
dataargument inestimate_infections()andconfirmcolumn in theobsargument ofestimate_truncation()to allownumerictypes, not justinteger. See #594, by @jamesmbaazam, and reviewed by @sbfnk. - Removed the reporting templates that were previously provided. See #604 by @jamesmbaazam, and reviewed by @sbfnk.
- Clarified how estimated or specified uncertainty around data truncation can be passed to
epinow(),regional_epinow(), andestimate_infections()using thetruncationargument. By @jamesmbaazam in #644 and reviewed by @sbnfk. - Internal functions have been removed from the pkgdown index. By @sbfnk in #735.
Package
- Replaced use of
purrr::transpose()withpurrr::list_transpose()because the former is superseded. By @jamesmbaazam in #524 and reviewed by @seabbs. - Reduced the number of long-running examples. By @sbfnk in #459 and reviewed by @seabbs.
- Changed all instances of arguments that refer to the maximum of a distribution to reflect the maximum. Previously this did, in some instance, refer to the length of the PMF. By @sbfnk in #468.
- Fixed a bug in the bounds of delays when setting initial conditions. By @sbfnk in #474.
- Added input checking to
estimate_infections(),estimate_secondary(),estimate_truncation(),simulate_infections(), andepinow().check_reports_valid()has been added to validate the reports dataset passed to these functions. Tests are added to checkcheck_reports_valid(). As part of input validation, the various*_opts()functions now return subclasses of the same name as the functions and are tested against passed arguments to ensure the right*_opts()is passed to the right argument. For example, theobsargument inestimate_secondary()is expected to only receive arguments passed throughobs_opts()and will error otherwise. By @jamesmbaazam in #476 and reviewed by @sbfnk and @seabbs. - Added the possibility of specifying a fixed observation scaling. By @sbfnk in #550 and reviewed by @seabbs.
- Added the possibility of specifying fixed overdispersion. By @sbfnk in #560 and reviewed by @seabbs.
- The example in
estimate_truncation()has been simplified. The package now ships with a datasetexample_truncated, which is used in theestimate_truncation()example and tests. The steps for creating theexample_truncatedis stored in./data-raw/estimate-truncation.R. By @jamesmbaazam in #584 and reviewed by @seabbs and @sbfnk. - Tests have been updated to only set random seeds before snapshot tests involving random number generation, and unset them subsequently. By @sbfnk in #590 and reviewed by @seabbs.
- A function
simulate_secondary()was added to simulate from parameters of theestimate_secondarymodel. A function of the same name that was previously based on a reimplementation of that model in R with potentially time-varying scalings and delays has been renamed toconvolve_and_scale(). By @sbfnk in #591 and reviewed by @seabbs. - Fixed broken links in the README. By @jamesmbaazam in #617 and reviewed by @sbfnk.
- Replaced descriptions and plot labels to be more general and clearer. By @sbfnk in #621 and reviewed by @jamesmbaazam.
- Argument choices have been moved into default arguments. By @sbfnk in #622 and reviewed by @seabbs.
simulate_infections()gained the argumentseeding_timeto change the seeding time. Additionally, the documentation was improved. By @sbfnk in #627 and reviewed by @jamesmbaazam.- A
cmdstanrbackend has been added. By @sbfnk in #537 and #642 and reviewed by @seabbs.
Model changes
- Updated the parameterisation of the dispersion term
phito bephi = 1 / sqrt_phi ^ 2rather than the previous parameterisationphi = 1 / sqrt(sqrt_phi)based on the suggested prior here and the performance benefits seen in theepinowcastpackage (see here). By @seabbs in #487 and reviewed by @sbfnk. - Added an
naargument toobs_opts()that allows the user to specify whether NA values in the data should be interpreted as missing or accumulated in the next non-NA data point. By @sbfnk in #534 and reviewed by @seabbs. - Growth rates are now calculated directly from the infection trajectory as
log I(t) - log I(t - 1). Originally by @seabbs in #213, finished by @sbfnk in #610 and reviewed by @seabbs. - Fixed a bug when using the nonmechanistic model that could lead to explosive growth. By @sbfnk in #612 and reviewed by @jamesmbaazam.
- Added the arguments
filter_leading_zerosandzero_thresholdtoestimate_secondary()andestimate_truncation()to allow the user to specify whether to filter leading zeros in the data and the threshold for replacing zero cases. These arguments were already used inestimate_infections()...
1.4.0 release
This release contains some bug fixes, minor new features, and the initial stages of some broader improvement to future handling of delay distributions.
Breaking changes
- The external distribution interface has been updated to use the
dist_spec()function. This comes with a range of benefits, including optimising model fitting when static delays are used (by convolving when first defined vs in stan), easy printing (usingprint()), and easy plotting (usingplot()). It also makes it possible to use all supported distributions everywhere (i.e, as a generation time or reporting delay). However, while for now backwards compatibility has been ensured this update will break most users' code eventually as the interface has changed. See the documentation fordist_spec()for more details. By @sbfnk in #363 and reviewed by @seabbs.
Package
- Model description has been expanded to include more detail. By @sbfnk in #373 and reviewed by @seabbs.
- Moved to a GitHub Action to only lint changed files. By @seabbs in #378.
- Linted the package with a wider range of default linters. By @seabbs in #378.
- Added a GitHub Action to build the README when it is altered. By @seabbs.
- Added handling of edge case where we sample from the negative binomial with mean close or equal to 0. By @sbfnk in #366 and reviewed by @seabbs.
- Replaced use of nested
ifelse()anddata.table::fifelse()in the code base withdata.table::fcase(). By @jamesmbaazam in #383 and reviewed by @seabbs. - Reviewed the example in
calc_backcalc_data()to callcalc_backcalc_data()instead ofcreate_gp_data(). By @jamesmbaazam in #388 and reviewed by @seabbs. - Improved compilation times by reducing the number of distinct stan models and deprecated
tune_inv_gamma(). By @sbfnk in #394 and reviewed by @seabbs. - Changed touchstone settings so that benchmarks are only performed if the stan model is changed. By @sbfnk in #400 and reviewed by @seabbs.
- pak is now suggested for installing the developmental version of the package. By @jamesmbaazam in #407 and reviewed by @seabbs. This has been successfully tested on MacOS Ventura, Ubuntu 20.04, and Windows 10. Users are advised to use
remotes::install_github("epiforecasts/EpiNow2")ifpakfails and if both fail, raise an issue. dist_fit()'ssamplesargument now takes a default value of 1000 instead of NULL. If a suppliedsamplesis less than 1000, it is changed to 1000 and a warning is thrown to indicate the change. By @jamesmbazam in #389 and reviewed by @seabbs.- The internal distribution interface has been streamlined to reduce code duplication. By @sbfnk in #363 and reviewed by @seabbs.
- A small bug has been fixed where the seeding time was too long. When a single delay is used this shortens the seeding time by one day and when more delays are used it shortens the seeding time by n days where n is the number of delays used e.g. for two parametric delays it's two days. By @sbfnk in #413 and reviewed by @seabbs.
- Some tuning was done to speed up the renewal model. By @sbfnk in #416 and reviewed by @seabbs.
- An approximation of the negative binomial by the Poisson at low levels of overdispersion was disabled as it led to parameter identification issues. By @sbfnk in #432 and reviewed by @seabbs.
- Reduced verbosity of tests. By @sbfnk in #433 and reviewed by @seabbs.
- Updated code style in response to lintr warnings. By @sbfnk in #437 and reviewed by @seabbs.
- Fixed an edge case breaking summary output. Reported by @jrcpulliam, fixed by @sbfnk in #436 and reviewed by @seabbs.
- Added content to the vignette for the estimate_truncation model. By @sbfnk in #439 and reviewed by @seabbs.
- Added a feature to the
estimate_truncationto allow it to be applied to time series that are shorter than the truncation max. By @sbfnk in #438 and reviewed by @seabbs. - Changed the
estimate_truncationto use thedist_specinterface, deprecating existing optionsmax_truncandtrunc_dist. By @sbfnk in #448 and #452 and reviewed by @seabbs. - Added a
weigh_delay_priorsargument to the main functions, allowing the users to choose whether to weigh delay priors by the number of data points or not. By @sbfnk in #450 and reviewed by @seabbs.
Documentation
- Added a link to the recent CSTE workshop on using
EpiNow2to the case studies vignette. By @seabbs in #441 and reviewed by @sbfnk.
Pull requests associated with this release
- Expand model description. by @sbfnk in #373
- Linting by @seabbs in #378
- fix errors introduced in #378 by @sbfnk in #380
- allow edge case of negative binomial with 0 mean by @sbfnk in #366
- add Seb orcid by @sbfnk in #386
- Substitute nested
ifelsewithdata.table::fcase()by @jamesmbaazam in #383 - Revise the examples for
create_backcalc_data()by @jamesmbaazam in #388 - reduce the number of stan models by @sbfnk in #394
- Amend contribution guide by @jamesmbaazam in #406
- limit touchstone to stan model changes by @sbfnk in #400
- change the default value of sample in
dist_fit()by @jamesmbaazam in #389 - Update install info by @jamesmbaazam in #407
- implement
dist_specinterface by @sbfnk in #363 - shorten seeding time by @sbfnk in #413
- speed up generation of infections by @sbfnk in #416
- update R CMD check action by @sbfnk in #425
- qualify internal functions in tests by @sbfnk in #426
- don't defer negative binomial to Poisson at low levels of overdispersion by @sbfnk in #432
- disable verbosity for failing chains by @sbfnk in #433
- fix logmean bound by @sbfnk in #435
- style change in response to lintr warnings by @sbfnk in #437
- fix regional summary in case of 0/0 by @sbfnk in #436
- update estimate truncation vignette by @sbfnk in #439
- allow snapshots shorter than trunc_max by @sbfnk in #438
- Issue 440: Added CSTE workshop as a case study by @seabbs in #441
- bug fix: make simulated delay mean unbounded by @sbfnk in #446
- move synthetic validation to macos by @sbfnk in #445
- Fix 442 by @sbfnk in #443
- use
delay_lpinestimate_truncationby @sbfnk in #448 - move prior weights to model arguments by @sbfnk in #450
- make estimate_truncation return a dist_spec by @sbfnk in #452
- avoid very narrow initial truncation distributions by @sbfnk in #454
- Improve deprecation by @sbfnk in #455
- Update deprecated syntax for future rstan compatibility by @andrjohns in #453
- Prepare 1.4.0 CRAN release by @sbfnk in #456
New Contributors
- @jamesmbaazam made their first contribution in #383
- @andrjohns made their first contribution in #453
Full Changelog: v1.3.5...v1.4.0
1.3.4 release
EpiNow2 1.3.4
This release focusses on bug fixes and package infrastructure updates along with a few quality of life improvements such as enabling the use of fixed delays and generation times.
Thanks to @seabbs, and @sbfnk and for SACEMA for hosting @seabbs whilst some of the development work on this release was being done.
Breaking changes
- To streamline the interface with the definition of delay distributions
trunc_opts()now takes a single argument (dist) which defines the truncation delay rather than a arbitrary list of arguments (which was previously used to define the distribution). - Updated the handling of generation times in the renewal equation to be left truncation adjusted for the zeroth day. This more better the approach taken to estimate generation times but may slightly impact estimates vs those produced using previous versions.
- The range of the
frac_obsparameter has restricted with an upper bound of 1 to reflect its name and description. This may impact a small number of edge case uses with the majority being models fit usingestimate_secondary(). By @sbfnk in #340.
Features
- Adds a new function
simulate_secondary()for simulating secondary observations under the generative process model assumed byestimate_secondary. Unlikeforecast_secondary()which uses astanmodel to simulate secondary cases (which shares code with theestimate_secondarymodel) this new function is implemented entirely in R and is therefore useful to sense check any results from thestanimplementation. - Adds support for fixed delays (mean only or fixed lognormal distributed) or truncations (fixed lognormal distributed), and for pre-computing these delays as well as generation times if they are fixed. By @sbfnk and @seabbs.
- Support for gamma distributed delays and log-normal distributed generation times.
Package
- Update the GitHub Action files to new versions.
- Switched to using
seq_along()rather than1:length()in all package code. - Fixed a broken example in the documentation for
regional_runtimes(). - Add compatibility changes for the latest version of
rstanandrstantools. - Remove legacy use of
pkgnetfor package dependency visualisation. - Restyled all code using
styler. - Dropped dependency on
RcppParallel. - Updated
report_casesto work with the newdelay_optshelper function. - Added test coverage for
report_casesthough note this function will likely be deprecated in future releases. - Switched to
linewidthinplot_CrIsrather thansizeto avoid issues withggplot23.4.0. - Set up validation against synthetic data to run as a CI check.
- Added tests for internal stan convolution functions.
- Update all
get_distribution functions to return the distribution as well as summary
parameters. - Added support for model fitting benchmarking using
touchstone.
Documentation
- Slight edits to the model outline for
estimate_infections(). - Updated examples to make use of fixed distributions.
Bugs
- Fixed a bug in
simulate_infections()where passing a custom number of samples would cause the input vector of R values to be replicated in a column-wise fashion meaning that the intended R trajectory was not simulated. - Fixed a bug in the
estimate_infections()deconvolution model where the generation time was not correctly being reversed.
Pull requests
- add more flexibility with delays by @sbfnk in #305
- documentation fixes and deprecation warning by @sbfnk in #335
- fixes to small issues introduced by PR #305 by @sbfnk in #336
- bug fix: return_likelihood check by @sbfnk in #333
- upper bound
frac_obsby 1 by @sbfnk in #340 - secondary features by @sbfnk in #310
- Develop by @seabbs in #343
Full Changelog: v1.3.3...v1.3.4