compute_std_errors: compute_std_errors

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

Description

Computation of the standard errors for the MCEM algorithm for the GCNB model

Usage

1
compute_std_errors(theta, obs.data,  m, p, q, marginals)

Arguments

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

Details

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.

Value

The standard errors of the MLE's of the ARMA(p,q) parameters for the GCNB model

Note

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

Author(s)

Hannah Lennon <drhannahlennon@gmail.com>

References

Chen and Ledolter, (1995), Monte Carlo EM Estimation.

See Also

Lennon, H (2014)

Examples

 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)

hlennon/copulaIVTS documentation built on Dec. 20, 2021, 4:45 p.m.