The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
sparsesurv provides functions for fitting, forecasting, and prospective outbreak detection in sparse surveillance count time series. Models are built around negative-binomial and zero-modified families (ZINB, hurdle) with optional self-excitation and generalised autoregressive moving average (GARMA) dynamics.
A key feature is forecasting ahead using future climatic/environmental covariates you supply (e.g., weather or seasonality drivers). The package also separates endemic and epidemic states and returns, for each time point, the probability of being in an epidemic state, enabling transparent flagging of emerging outbreaks.
Potential users include biostatisticians, epidemiologists, and others working with surveillance data (also useful wherever counts are sparse/overdispersed).
Forecast with future covariates: plug in known/forecasted climate/environmental inputs to get out-of-sample case forecasts with prediction intervals. (NB,SENB, GARMA_NB, ZINB, SEZINB, GARMA_ZINB)
Endemic vs. epidemic decomposition: per-time-point posterior probability of the epidemic state, plus utilities to flag episodes by thresholding. (outbreakNB, outbreakZINB, outbreakHNB)
Model families
Covariates
Forecasting
Outbreak detection
Diagnostics -summaries and residual checks to assess fit and calibration.
System requirements: JAGS (>= 4.x) for Bayesian fitting via R2jags.
The stable release version of sparsesurv is hosted on the Comprehensive R Archive Network (CRAN) at https://CRAN.R-project.org/package=surveillance and can be installed via
install.packages("sparsesurv")
Development version (GitHub):
# install.packages("remotes")
::install_github("alexangelakis-ang/sparsesurv") remotes
Windows/macOS users: please install JAGS first so model fitting works.
Below is a lightweight example using the self-exciting NB fitter
SENB()
on a toy series. (Kept short for README speed;
increase iterations/chains in real analyses.)
set.seed(1)
# Toy series: NB counts with mean ~8 and size ~5
<- rnbinom(72, size = 5, mu = 8)
cases
# Fit a compact model (short MCMC for demonstration)
<- SENB(
fit_nb cases = cases,
beta_prior_mean = 0,
beta_prior_sd = 5,
r_prior_shape = 2,
r_prior_rate = 0.5,
n_iter = 400,
n_burnin= 200,
n_chains= 1,
n_thin = 2
)
print(fit_nb)
set.seed(1)
# Toy series: NB counts with mean ~8 and size ~5
<- rnbinom(72, size = 5, mu = 8)
cases
# Fit a compact model (short MCMC for demonstration)
<- outbreakZINB(
fit_outbreakzinb cases = cases,
beta_prior_mean = 0,
beta_prior_sd = 10,
r_prior_shape = 2,
r_prior_rate = 0.5,
n_iter = 1000,
n_burnin = 100,
n_chains = 2,
n_thin = 1,
dates = dat1$date,
plot_Z = TRUE
)print(fit_outbreakzinb)
Early detection of outbreaks:
Forecasting:
Issues and pull requests: https://github.com/alexangelakis-ang/sparsesurv/issues or via e-mail to maintainer(“sparsesurv”).
Please include a minimal reproducible example for bugs. For large features, open an issue to discuss first.
If you use sparsesurv in academic work, please cite the package.
The sparsesurv package is free and open-source software, and you are welcome to redistribute it under the terms of the GNU General Public License, version 3. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
This work is supported by European Union’s Horizon 2020 research and innovation programme under grant agreement No 101000365, project PREPARE4VBD (A Cross- Disciplinary Alliance to Identify, PREdict and prePARE for Emerging Vector-Borne Diseases).
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.