Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/compute_std_errors.R View source: R/compute_std_errors.R
Computation of the standard errors for the MCEM algorithm for the GCNB model
1 | compute_std_errors(theta, obs.data, m, p, q, marginals)
|
theta |
a vector of MLE parameter estimates |
obs.data |
a vector of observed data |
m |
The number of monte carlo simulations required |
p |
The order of the ARMA(p,q) model |
q |
The order of the ARMA(p,q) model |
marginals |
how are the marginals estimated |
The standard errors of the MLE's are not automatically produced for the EM algorithm. Equation (3) of Chen and Ledolter, (1995) is used to compute the errors. The Hessian and the score of the ARMA(p,q) likelihood is required. The analytical solution is sought, however for the tie being a numerical approximation is used, via the R package (numDeriv). The expectation is found by using a Monte Carlo average over m samples.
The standard errors of the MLE's of the ARMA(p,q) parameters for the GCNB model
The standard errors for the true unobserved time series data (we know it because we simulated it), will be smaller than the standard error of the digitised time series
Hannah Lennon <drhannahlennon@gmail.com>
Chen and Ledolter, (1995), Monte Carlo EM Estimation.
Lennon, H (2014)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(numDeriv)
library(forecast)
set.seed(1)
IV.data <- generate_data(200, 0.7, -0.5, "negbin", c(3, 0.3))
obs.data <- IV.data$x
order <- c(1, 1)
theta <- arima(IV.data$y, order=c(1,0,1), include.mean=FALSE)$coef
m <- 10
n <- length(obs.data)
# Standard errors for the MLE's obtained via a MCEM algorithm
compute_std_errors(theta, obs.data, m, 1, 1)
# Standard errors for the true unobserved data (we know it because we simulated it)
arima(IV.data$y, order=c(1,0,1), include.mean=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.