fitMisRepARMA: Fit ARMA model to misreported time series data

View source: R/fitMisRepARMA.R

fitMisRepARMAR Documentation

Fit ARMA model to misreported time series data

Description

Fits an ARMA model to misreported (underreported or overreported) continuous time series data using either a frequentist bootstrap-based EM algorithm (method = "freq") or a Bayesian MCMC approach via JAGS (method = "bayes").

Usage

fitMisRepARMA(y, tol, B, p_AR, q_MA, covars = NULL, misReport = "U",
              method = "freq", n_chains = 3, n_burnin = NULL,
              n_thin = 1, w_prior_a = 1, w_prior_b = 1, ...)

Arguments

y

numeric vector or time series of observed (potentially misreported) data.

tol

tolerance to stop the iterative EM algorithm. A value of 1e-4 is recommended.

B

for method = "freq": number of bootstrap resamples. For method = "bayes": total MCMC iterations per chain (minimum 500 recommended; 2000 or more for reliable convergence).

p_AR

non-negative integer: order of the AR part of the latent ARMA process.

q_MA

non-negative integer: order of the MA part of the latent ARMA process.

covars

optional numeric matrix of covariates to account for trends or seasonal patterns. Default is NULL.

misReport

character string: "U" (default) for underreported data (0 < q < 1) or "O" for overreported data (q > 1).

method

character string: "freq" (default) for the frequentist bootstrap-based EM approach, or "bayes" for the Bayesian MCMC approach via JAGS.

n_chains

(Bayesian only) number of parallel MCMC chains. Default is 3.

n_burnin

(Bayesian only) burn-in iterations to discard. Default is NULL (20% of B).

n_thin

(Bayesian only) thinning interval. Default is 1.

w_prior_a

(Bayesian only) first shape parameter of the Beta prior for \omega: \omega \sim \mathrm{Beta}(a, b). Default is 1 (uniform prior).

w_prior_b

(Bayesian only) second shape parameter of the Beta prior for \omega. Default is 1 (uniform prior).

...

additional arguments passed to tsboot.

Details

The model assumes a latent ARMA(p, r) process X_t that is only partially observed through:

Y_t = \begin{cases} X_t & \text{with probability } 1-\omega \\ q \cdot X_t & \text{with probability } \omega \end{cases}

where q is the misreporting intensity and \omega is its frequency.

The frequentist method estimates parameters via an iterative EM algorithm with bootstrap uncertainty quantification.

The Bayesian method samples from the full posterior via JAGS, initialising chains near the frequentist estimates. Convergence should be checked with the Gelman-Rubin statistic (\hat{R} < 1.1) accessible via attr(fit, "jags")$BUGSoutput$summary.

Value

An object of class fitMisRepARMA with elements:

data

the original observed series.

t0

point estimates (EM or posterior medians). Last element is AIC (frequentist) or DIC (Bayesian).

t

matrix of bootstrap replicates or MCMC posterior samples.

Attributes: q (misreporting intensity), w (frequency), z (misreporting indicator), covars (covariate fit), x_rec (Bayesian latent process), DIC (Bayesian), jags (full JAGS object, Bayesian only).

Author(s)

David Morina, Amanda Fernandez-Fontelo, Alejandra Cabana, Pedro Puig, Biel Abarca Galvan

References

Morina, D., Fernandez-Fontelo, A., Cabana, A., Puig, P. (2021): New statistical model for misreported data with application to current public health challenges. Scientific Reports, 11, 23321. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/s41598-021-02620-5")}

See Also

MisRepARMA-package, reconstruct

Examples

set.seed(12345)
x   <- arima.sim(model = list(ar = 0.4), n = 100)
ind <- rbinom(100, 1, 0.6)
y   <- ifelse(ind == 0, x, x * 0.3)

mod_freq <- fitMisRepARMA(y, tol = 1e-4, B = 50, p_AR = 1, q_MA = 0,
                          misReport = "U", method = "freq")
summary(mod_freq)
reconstruct(mod_freq)

## Not run: 
mod_bayes <- fitMisRepARMA(y, tol = 1e-4, B = 1000, p_AR = 1, q_MA = 0,
                           misReport = "U", method = "bayes",
                           n_chains = 3, n_burnin = 200)
summary(mod_bayes)

## End(Not run)

MisRepARMA documentation built on June 7, 2026, 5:06 p.m.