Learn R Programming

stsm (version 1.7)

methods-vcov-confint: Variance-covariance Matrix for a Fitted stsm Model Object

Description

The method vcov computes the variance-covariance matrix of the parameters fitted in a structural time series model. This matrix is used to compute confidence intervals for those parameters returned by the coef.stsmFit method.

Usage

## S3 method for class 'stsmFit':
vcov(object, 
  type = c("hessian", "infomat", "OPG", "sandwich", "optimHessian"), ...)
## S3 method for class 'stsm':
vcov(object, 
  type = c("hessian", "infomat", "OPG", "sandwich"), 
  domain = c("frequency", "time"), ...)
## S3 method for class 'stsmFit':
confint(object, parm, level = 0.95, 
  type = c("vcov", "bootstrap"),
  vcov.type = c("hessian", "infomat", "OPG", "sandwich", "optimHessian"), 
  breps = 100, ...)

Arguments

object
a stsmFit list or object of class stsm.
type
a character. In vcov, it is the type of covariance matrix. In confit, it is the type of confidence intervals: based on the covariance matrix of the estimated parameters or on a bootstrap procedure.
domain
a character indicating whether the covariance matrix is obtained upon the frequency or time domain likelihood function.
parm
character indicating the name of the parameter on to obtain the confidence interval. If missing, all parameters are considered.
level
the confidence level.
vcov.type
a character indicating the type of covariance matrix. Ignored if type = "bootstrap".
breps
number of bootstrap replicates. Ignored if type "vcov".
...
additional arguments to be passed to the functions called in these methods. Currently ignored.

Value

  • vcov.stsm, vcov.stsmFitreturn the covariance matrix of the parameters of the model.
  • confint.stsmFitreturns a matrix containing confidence intervals for the parameters of the model.

code

breps

deqn

$$2\pi I(\lambda_j) / g(\lambda_j) \sim \chi^2_1, \hbox{ for } j=0, n/2 \hbox{ (for n even)}$$

eqn

$\lambda_j$

Details

The following estimators of the covariance matrix of parameter estimates are available (Davidson and MacKinnon (2004), Section 10.4):
  • hessian: the inverse of the analytical Hessian.
infomat: the inverse of the analytical expression for the information matrix.OPG: the inverse of the outer product of the analytical gradient. Also known as the BHHH estimator since it was proposed by Berndt, Hall, Hall and Hausman (1974). This method requires only first order derivatives. It tends to be less reliable in small samples.sandwich: the sandwich estimator defined as: $H^{-1} (G'G) H^{-1},$ where $G$ is the gradient vector and $H$ is the Hessian matrix. It requires more computations and may be unreliable in small samples. However, contrary to the previous methods, it is valid when the information matrix equality does not hold for example due to misspecification of the model.optimHessian: the inverse of the numerical Hessian returned by optim.

References

Berndt, E. R., Hall, B. H., Hall, R. E. and Hausman, J. A. (1974). Estimation and inference in nonlinear structural models. Annals of Economic and Social Measurement, 3, pp. 653-65.

Dahlhaus, R. and Janas, D. (1996). A Frequency Domain Bootstrap for Ratio Statistics in Time Series Analysis. Annals of Statistics, 24(5), pp. 1934-1963.

Davidson, R. and MacKinnon, J. G. (2004). Section 10.4. Econometric Theory and Methods. Oxford University Press.

Koopman, S. J. and Wong, S. Y. (2006). Extracting Business Cycles using Semi-Parametric Time-varying Spectra with Applications to US Macroeconomic Time Series. Tinbergen Institute Discussion Papers, No. 2006-105/4. http://papers.tinbergen.nl/06105.pdf

See Also

maxlik.fd, maxlik.td, methods-stsmFit, stsm.

Examples

Run this code
data("llmseas")
# fit the local level plus seasonal model with default arguments
# using the Newton-Raphson algorithm
m <- stsm.model(model = "llm+seas", y = llmseas)
res <- maxlik.fd.scoring(m = m, information = "observed")
coef(res)
# confidence intervals for parameter estimates ...
# ... based on the covariance matrix of parameter estimates
# gives a warning since the lower limit of the confidence interval
# for parameter 'var2' was forced to be non-negative (fixed to 0)
civcov <- confint(res, type = "vcov", vcov.type = "hessian")
civcov
# ... based on bootstrapping the periodogram
# NOTE: this will take a while to run
set.seed(643)
ciboot <- confint(res, type = "bootstrap", breps = 100)
ciboot

Run the code above in your browser using DataLab