GHRmodel changelog
0.2.0
New features
- New model selection workflow:
select_re()andselect_fe()perform two-stage (univariable then multivariable) selection of random-effects and fixed-effects specifications based on goodness-of-fit metrics.select_report()generates an HTML report summarising the results of either function. These functions are experimental and may change in future releases. - New
predict_models()function, a lighter-weight counterpart tofit_models()that fits multiple models and returns posterior predictive samples (or posterior mean/median, via thepred_typeargument), without computing the full set of outputs and GoF metrics returned byfit_models(). Useful for cross-validation in GHRpredict. fit_models()andpredict_models()now support two additional likelihood families:"gaussian"and zero-inflated count models ("zeroinflatedpoisson0","zeroinflatednbinomial0").fit_models()gainskeep_ppdandkeep_inlamodarguments to optionally retain, respectively, the posterior predictive samples and the fittedINLAmodel objects in the returnedGHRmodelsobject.fit_models()andpredict_models()now accept plain character vectors of formulas directly (in addition toGHRformulasobjects).fit_models()andpredict_models()gain the argumentscontrol_inlaandcontrol_family, which are passed to thecontrol.inlaandcontrol.familyarguments ofINLA::inla()to customise the INLA inference strategy and the likelihood settings.- New
print()method forGHRmodelsobjects. plot_coef_crosspred()gains aheat_limsargument to fix the colour scale limits of crossbasis heatmaps.- The example datasets
dengue_MSanddengue_SPnow include a population column (pop100000, population divided by 100,000) for use with theoffset_varargument offit_models()/predict_models(). - New exported function
crps_empirical(), an efficient estimator of the empirical continuous ranked probability score, which is used to compute the CRPS infit_models(). plot_fit()gains the argumentsunit_id(to show only some spatial units) andaggregate_space(to aggregate fitted and observed values over a larger spatial unit).plot_gof()gains the argumentstitle,xlab,ylabandlegend.
Breaking changes
- In
fit_models()theoffsetargument is deprecated and replaced byoffset_var. The offset variable is now transformed internally according to the family (log for count families, identity for"gaussian"). - In
fit_models()thepbargument is replaced byprogress, and a newverboseargument runsINLAin verbose mode. - In
plot_re()themap_areaargument is renamedmap_unit. - In
plot_fit()the argumentsgroupandgroup_idare renamedunitandunit_id, andmod_facetis removed. sample_ppd()is no longer exported; usepredict_models()instead.crosspred_inla()no longer accepts....
Improvements
stack_models()now also merges the$re,$inlamodand$ppdcomponents ofGHRmodelsobjects, and validates that all inputs share the same family, outcome and outcome values.- The CRPS is now the median across observations of the empirical CRPS of the posterior predictive distribution, and the CRPS skill score (
crpss) relative to the first model is reported inmod_gof. fit_models(),predict_models()and the formula helpers have stricter input checks: the outcome and offset must be valid, and linear covariates used in the formulas must exist indataand have no missing values (e.g., lagged covariates must be computed on data that include the preceding time steps).- MAE and RMSE goodness-of-fit metrics are now always computed as point estimates rather than averaged over posterior predictive samples.
fit_models()no longer appends a numeric suffix tonamewhen only a single model is fitted.- Default
nthreadsinfit_models()changed from 8 to 1. - Sampling from the posterior predictive distribution in
fit_models()andpredict_models()can now run in parallel, using up tonthreadsthreads. - General documentation clean-up across functions and vignettes.
Bug fixes
- Fixed the handling of
nthreadsinfit_models()andpredict_models(). - Fixed a bug in the colour scale of crossbasis heatmaps.
- Fixed a bug in the temporal (single time series, no
unit) case of the fixed/random-effects selection workflow. - Fixed a bug in
plot_fit(). - Fixed a bug in
get_covariates(). - Fixed a bug in the parsing of non-linear terms (
inla.group()) inas_GHRformulas(), which affected the names of non-linear variables.
0.1.1
- Fixed bug in the colour scale in the function
plot_coef_crosspred(). - Minor updates in the documentation.
0.1.0
- Initial CRAN submission.