NEWS.md
Installs with current versions of Stan again, adds new model options and fixes several bugs. The new options are off by default, so models that do not use them are the same as in 1.0.0.
csr_matrix_times_vector2() compiles against the Stan Math types of Stan >= 2.26, and the build files follow rstantools 2.7 (C++17). rstan and StanHeaders >= 2.26 are now required (#67).inst/include/tests.cpp, which included a missing header, is removed (#61).--as-cran on Linux, macOS and Windows, and on Linux also with R-devel and the previous R release.epiinf(): gen can hold a generation distribution for each group, as a named list or a matrix with named columns. They are matched to groups by name, or through the new gen_group argument.epiinf(): importations = TRUE adds a constant number of imported infections each day in each group to the renewal equation, with prior prior_importations (half-normal with scale 0.2 by default). Off by default (#15).epiobs(): period models observations that are totals over the period days ending on their date, such as weekly counts with period = 7. Daily observations (period = 1) remain the default.discretize_cdf() turns a continuous delay distribution, given by its CDF, into the probability mass function on whole days used by gen and i2o (#3).epiobs(deaths ~ 0 + offset(cfr), link = "identity") fixes the ascertainment of deaths at the CFR held in column cfr, and epiobs(cases ~ 0 + group, link = "logit") estimates a reporting rate for each group. The epiobs() help page now describes this.newdata and a joint fit of weekly cases and deaths with the deaths averted.epiobs(aux_by_group = TRUE) gives each group its own auxiliary parameter, such as its own negative binomial dispersion, for any observation type that has one: cases and deaths alike. Each group’s parameter has the type’s prior_aux, on the scale that prior_aux_on sets, and is named by group (cases|reciprocal dispersion[north]). Several groups no longer need one observation model each (at most 10 are allowed). With the default, FALSE, the model is that of 1.0.0: a test checks that its log density and gradient equal 1.0.0’s, and another that a fit recovers different dispersions in two groups of simulated data. The weekly-counterfactuals article has an example.epiobs(prior_aux_on = "inv_sqrt") makes prior_aux a prior on one over the square root of the auxiliary parameter: prior_aux = rstanarm::normal(0, 1) then gives the negative binomial’s 1/sqrt(phi) a half-normal(0, 1) prior. The help page now says that a normal prior with location m is m + s|z|, so the default keeps phi >= 10.epirt(prior_covariance = rstanarm::normal(0, s)) gives the standard deviation of each random effects term a half-normal(0, s) prior instead of decov’s, when every term has one coefficient, as in (0 + x || group).lognormal(meanlog, sdlog) is a new prior for epiinf(prior_seeds = ): the log of each group’s daily seeded infections is normal, with a mean (and standard deviation) per group if given, so seeds can be centred on each group’s early counts.rw() help page explains that rows with an NA time have no walk term, so a walk can start in the second period, with the first period’s log Rt given by the intercept alone.rw(noncentred = TRUE) samples a walk’s steps as standard normal variables and multiplies them by the walk’s scale. The model is the same, but it samples much better when the scale is near zero. The reported steps are the scaled ones either way, so posterior_rt() and the other posterior simulations are unchanged.posterior_predict() returned NULL for models with several observation types unless a single type was asked for. It now returns a list named by type, so one counterfactual gives, for example, both cases and deaths.posterior_predict() drew log-normal observations on the wrong scale (meanlog = mu - sigma^2 / 2 instead of log(mu) - sigma^2 / 2).R|Sigma[...] reported the Cholesky factors of the random effects’ covariance matrices, not the covariances its name says: epim() converted them in a helper and dropped the result. For a term with one coefficient it was the standard deviation rather than the variance.epim() now stops early and says to set them to NA or use another family.plot_rt() no longer plots the seeding period, where Rt does not enter the model; seeding = TRUE restores it (#54).posterior_rt(), posterior_predict() and the plots) no longer print sampler timings.check_time_as_date() rejects numeric date columns again on R >= 4.3.gen sums to one allows rounding error up to 1e-8, as Stan’s simplex check does.findbars(), nobars() and subbars() now come from reformulas, where lme4 2.0 says they have moved.--as-cran notes are cleared: class tests use inherits(), S3 methods are registered and match their generics, and a help link names its package.plot_infections and plot_observations
plot_rt