CRAN interface release + hot fixes
This release introduces multiple breaking interface changes. Please see the README for examples of the new interface. It adds a range of quality of life improvements including updating the stan
interface to support fitting each chain independently and offering variational inference as an alternative, experimental, fitting option. Notably it also adds support for nesting logging and a parallel enabled progress bar via the progressr
package. Minor bugs have been fixed in the core model implementation focussing on stability and several already implemented features have been extended. Major model developments are planned for the next release of EpiNow2
.
New features
- Added support for either NUTs sampling (
method = "exact"
) or Variational inference (method = "approximate"
). - Update the prior on the initial Rt estimate to be lognormal rather than gamma distributed. For users the interface remains unchanged but this parameterisation should be more numerically stable.
- Added
get_dist
,get_generation_time
,get_incubation_period
based on ideas from @pearsonca. (This leads to breaking changes with the removal ofcovid_generation_times
andcovid_incubation_periods
). - Added
setup_logging
to enable users to specify the level and location of logging (wrapping functionality fromfutile.logger
). Also addedsetup_default_logging
to give users sensible defaults and embedded this
function inregional_epinow
andepinow
. - Added
setup_future
to making using nested futures easier (required when usingfuture = TRUE
). - Implemented progress bar support using
progressr
. - Added timeout and timing option to
regional_epinow
- Improved logging of warnings in
regional_epinow
- Enabled the user to specify the credible intervals desired with 20%, 50% and 90% calculated by default. Also switched from high density regions to quantiles. Custom credible intervals are now supported in all reporting and plotting functions.
- Added mean and sd to all reporting summaries.
- Added a summary of the growth rate and doubling time.
- Added a new function
regional_runtimes
that summarises the run time across regions. - Updated the
estimate_infections
interface and expanded the range of options for thefuture_rt
argument. Users can now choose to set Rt from any time point referenced to the forecast date.
Bug fixes
- Fixed y axis max for
plot_summary
. - Fix to normalisation of delay and generation time distributions from @sbfnk. This will impact nowcast infections but not reproduction number estimate.
- Updated
discretised_gamma_pmf
(discretised truncated Gamma PMF) to constrain gamma shape and (inverse) scale parameters to be positive and finite (alpha > 0
andbeta > 0
). - Fixed
readLines
incomplete final line warnings. - Fix from @medewitt from the internal
fit_chain
function where an interaction betweenrstan
and timing out may have introduced an exception that caused whole regions to fail. This did not show on current unit tests or exploration using examples etc. indicating a gap in testing.
Other changes
- Updates the interface for specifying how output is returned.
- Moved all inherited from stan arguments into
create_stan_args
with the option to override usingstan_args
. This leads to breaking changes - see the examples for details of the new interface. - Updated all example and documentation to reflect the new interface.
- Added a
samples
argument toget_regional_results
to make loading in samples optional. This also allows samples to be dropped when usingregional_epinow
which reduces RAM usage. - Cleaned up wrapper functions to move individual jobs into functions.
- Adds testing of high level functions and some low level unit testing.
- Adds a csv download button the interactive table in the regional summary table.
- Makevars updated to remove the dependency on GNU Make by @hsbadr