mskfModelSkeleton: Create a model skeleton for the specification of a state...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/mskfModelSkeleton.R

Description

This function generates a mskfSkeleton object to be used with mskfModel for the specification of a state space model with markovian switching between regimes.

Usage

1
2
 mskfModelSkeleton(y, ne = 1, nm = 2, x = NA, ipat = c(W = 1, B = nx, R = 0, c = 2,
        H = 2, G = 1, K = 2, p = 2))

Arguments

y

a univariate or multivariate time series (ts) object or vector or matrix object (with rows as time points), possibly with missing values.

ne

number of (underlying/latent) state variables.

nm

number of regimes. Should be 2 or larger.

x

an (optional) uni- or multivariate time series object of predictors for the measurement equation.

ipat

a named numeric vector with entry values 0, 1 or 2. Specifies the model matrices to be used (see Details).

Details

See mskf for complete definition of the regime switching state-space model.

The values in ipat indicate which model matrices (W, B, R, c, H, G, K, and p; see ‘Value’ below for a description) are used, and whether or not they contain free parameters: For each named element 0 implies the model matrix is not use; 1 implies the corresponding model matrix contains fixed values only; 2 implies the model matrix contains free parameters.

Value

An object of class mskf.skeleton with components

const

A list wich contains all of the components below for which ipat is not equal to zero.

  • maW numeric ny by ne by nm array for fixed values in the W matrices which relate the observations to the states.

  • maB numeric ny by nx by nm array for fixed values in the B matrices which relate the observations to the predictors.

  • maR numeric ny by ny by nm array for fixed values in the R matrices that specify the (co)variances of residuals in the measurement equation.

  • mac numeric ne by 1 by nm array for fixed values in the state intercepts c.

  • maH numeric of ne by ne by nm array for fixed values in the H matrices which relate the current state to the previous state.

  • maG numeric ne by ne by nm array for fixed values in the G matrices.

  • maK numeric ne by ne by nm array for fixed values in the K matrices that specify the (co)variances of the state innovations.

  • map numeric nm by nm array for fixed values in the regime transition matrix p.

pattern

A list wich contains all of the components below for which ipat is equal to two. Numeric arrays paW (ny by ne by nm), paB (ny by nx by nm), paR (ny by ny by nm), pac (ne by 1 by nm), paH (ne by ne by nm), paG (ne by ne by nm), paK (ne by ne by nm), and pap (nm by nm) for the free parameters in the model matrices W, B, R, pac, H, G, K, and p respectively.

y

time series y to be modeled as entered as the first argument.

x

(optional) predictor time series x. If none was present, a 1 by 1 array with value NA.

ny

number of time series in y.

nx

number of time series in x.

nt

length of the time series in y.

ne

number of (underlying/latent) state variables.

nm

number of regimes.

ipat

ipat as entered or its default value.

Note

The object returned by this function is to be used with mskfModel for full model specification.

Author(s)

Ellen L. Hamaker and Raoul P. P. P. Grasman

References

Kim, C.-J. (1994). Dynamic linear models with Markov-switching. Journal of Econometrics, 60, 1-22.

Kim, C.-J., and Nelson, C. R. (1999). State-Space Models with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications. Cambridge, MIT press.

See Also

See also mskf, mskfModel

Examples

1
1:10

mskf documentation built on May 2, 2019, 6:47 p.m.