The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
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[@]dogado.de.

npfseir

Nested Particle Filter for Stochastic SEIR Models with Latent OU Transmission

An R package implementing the online Bayesian epidemic inference framework of Feng and Wang (2025).

Installation

# From source (local):
# R CMD build npfseir
# R CMD INSTALL npfseir_0.2.1.tar.gz

Quick start

library(npfseir)

# Fixed model parameters
fixed <- list(eps=1/5, gamma=1/7, delta=1/(70*365), b=1/(70*365),
              q=0.15, N=330e6, sigma_comp=5000)

# Simulate
set.seed(1)
x0   <- c(330e6 - 5000, 2000, 3000, 0, log(0.3))
traj <- seir_simulate(400, kappa=0.10, sigma_psi=0.30,
                      mu_psi=log(0.25), x0=x0, fixed=fixed)

# Fit
fit <- npf_seir(traj$obs[-1], fixed, K=100, M=200, seed=42)

# Summarise and plot
summary(fit, burn=30)
plot(fit, burn=30)

# Forecast 14 days ahead
fc <- predict(fit, horizon=14)

Key functions

Function Description
npf_seir() Run the nested particle filter
seir_simulate() Simulate a stochastic SEIR trajectory
cori_rt() Cori-style renewal R_t estimator (illustrative)
ou_params() Exact OU discrete-time transition parameters

Citation

Feng, W. and Wang, W. (2025). Bayesian sequential inference for a stochastic SEIR model with latent transmission dynamics. Preprint.

Crisan, D. and Miguez, J. (2018). Nested particle filters for online parameter estimation in discrete-time state-space Markov models. Bernoulli, 24(4B):3039–3086.

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.
Health stats visible at Monitor.