Learn R Programming

partialCI (version 1.2.0)

statehistory.pci: Generates the sequence of inferred states of a partial cointegration model

Description

Generates the sequence of inferred states of a partial cointegration model

Usage

statehistory.pci(A, data = A$data, basis = A$basis)

Arguments

A

An object returned by fit.pci representing a partial cointegration fit.

data

The data history for which the inferred states are to be computed. This should be a (k+1) x n matrix, where k is the number of independent variables and n is the number of observations. If this is omitted, then uses the data history that was used in fitting the model A.

basis

The coefficients of the independent variables. This is a vector of length k. If this is omitted, then uses the coefficients that were computed in fitting the model A.

Value

Returns a data.frame with the following columns:

Y

The variable being modeled

X1,...,X_N

The independent variables

Z

The residual series Y - beta %*% X

M

The estimated state of the mean reverting component

R

The estimated state of the random walk component

eps_M

The innovation to the mean reverting component

eps_R

The innovation to the random walk component

Details

Computes the expected internal states of the model over the course of the data history.

See Also

egcm Engle-Granger cointegration model

partialAR Partially autoregressive models

Examples

Run this code
# NOT RUN {
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

YX <- rpci(n=1000, beta=c(2,3), sigma_C=c(0.1,0.1), rho=0.9, sigma_M=1, sigma_R=2)
f <- fit.pci(YX[,1], YX[,2:ncol(YX)])
statehistory.pci(f)

# }

Run the code above in your browser using DataLab