mskfModel.mskfSkeleton: Generate an 'mskfModel' from an 'mskfSkeleton'

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

View source: R/mskfModel.mskfSkeleton.R

Description

Generate an mskfModel from an mskfSkeleton specifying values for the different model parameters, starting values, and upper and or lower bounds for the parameter values.

Usage

1
2
## S3 method for class 'mskfSkeleton'
mskfModel(object, ..., start = NA, lower = NA, upper = NA)

Arguments

object

Object returned by mskfSkeleton

...

Extra arguments which can be zero or more of the arrays maW, maB, maR, mac, maH, maG, and maK, map, paW, paB, paR, pac, paH, paG, and paK, and/or the matrix pap (see Details).

start

a named numeric vector with starting values for the freely estimated parameters; see details

lower

a named vector, compatible with start, of lower bounds for the freely estimated parameters

upper

a named vector, compatible with start, of upper bounds for the freely estimated parameters

Details

See mskf for precise definition of the regime switching state-space model. Arrays and matrix may be specified as strings. Can be used to name the free parameters using numbers, and to constrain free parameters to be equal (by using the same number). Parameter estimates will be presented in the same order as they were numbered. Numbering does not need to be consecutively.

The vector start can be used to initialize the parameters at specific values. The names in this vector are the parameter names as given for the model matrices. As an example, if paW is specified as paW=diag(1:2), and paH is specified as paH=2, then if start=c('1'=0.25, '2'=0.8), then paW will be initialized to diag(c(0.25, 0.8)) and paH will be initialized to matrix(0.8,1,1).

Value

An object of class mskfSkeleton 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 with fixed values in the W matrices which relate the observations to the states.

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

  • maR numeric ny by ny by nm array with 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 with fixed values in the state intercepts c.

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

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

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

  • map numeric nm by nm array with 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), pap (nm by nm) that indicate which parameters are to be estimated 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.

# MOET JE DIT NOG STEEDS ZO ZEGGEN? HET IS IN DE VORIGE FUNCTIE NAMELIJK AL GEMAAKT

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 state variables.

nm

number of regimes.

ipat

ipat as entered or its default value.

# MOET DAT HIER WEER ZO WORDEN GEZEGD? HIJ MAAKT HIER GEEN DEFAULTS MEER NAMELIJK

theta

a named vector with starting values with the same names as start

lobo

a vector with lower bound values

upbo

a vector with upper bound values

a0

a vector with ne zeros as the initial state vector

P0

a matrix of ne by ne with 100 on the diagonal, which serves as the initial mean squared error matrix.

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.