View source: R/fitMisRepARMA.R
| fitMisRepARMA | R Documentation |
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").
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, ...)
y |
numeric vector or time series of observed (potentially misreported) data. |
tol |
tolerance to stop the iterative EM algorithm. A value of
|
B |
for |
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 |
misReport |
character string: |
method |
character string: |
n_chains |
(Bayesian only) number of parallel MCMC chains.
Default is |
n_burnin |
(Bayesian only) burn-in iterations to discard.
Default is |
n_thin |
(Bayesian only) thinning interval. Default is |
w_prior_a |
(Bayesian only) first shape parameter of the Beta
prior for |
w_prior_b |
(Bayesian only) second shape parameter of the Beta
prior for |
... |
additional arguments passed to |
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.
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).
David Morina, Amanda Fernandez-Fontelo, Alejandra Cabana, Pedro Puig, Biel Abarca Galvan
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")}
MisRepARMA-package, reconstruct
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.