SSModel: Create a State Space Model Object of class 'SSModel'

Description Usage Arguments Details Value See Also

Description

Function SSModel creates a state space object object of class SSModel which can be used as an input object for various functions of KFAS package.

Usage

1
2
3
4
5
6
  SSModel(y, Z = NULL, H = NULL, T = NULL, R = NULL,
    Q = NULL, a1 = NULL, P1 = NULL, P1inf = NULL, u = NULL,
    distribution = c("Gaussian", "Poisson", "Binomial"),
    transform = c("none", "ldl", "augment"),
    tolF = .Machine$double.eps^0.5,
    tol0 = .Machine$double.eps^0.5)

Arguments

y

A time series object of class ts, or a object that can be coerced to such.

Z

System matrix or array of observation equation.

H

Covariance matrix or array of disturbance terms ε[t] of observation equation. Omitted in case of non-Gaussian distributions. Augment the state vector if you want to add additional noise.

T

System matrix or array of transition equation.

R

System matrix or array of transition equation.

Q

Covariance matrix or array of disturbance terms η[t].

a1

Expected value of the initial state vector α[1].

P1

Covariance matrix of α[1]. In the diffuse case the non-diffuse part of P[1].

P1inf

Diffuse part of P[1]. Diagonal matrix with ones on diagonal elements which correspond to the unknown initial states.

u

Only used with non-Gaussian distribution. See details.

distribution

Specify the distribution of the observations. Default is "Gaussian".

transform

The functions of KFAS require diagonal covariance matrix H[t]. If H[t] is not diagonal, model can be transformed using one of the two options. Option "ldl" performs LDL decomposition for covariance matrix H[t], and multiplies the observation equation with the L[t]^{-1}, so ε[t] ~ N(0,D[t]). Option "augment" adds ε[t] to the state vector, when Q[t] becomes block diagonal with blocks Q[t] and H[t]. In case of univariate series, option "ldl" only changes the H_type argument of the model to "Diagonal". Default is "none" which does no transformation but checks if H is diagonal. If not, H_type is set to "Untransformed".

tolF

Tolerance parameter for Finf. Smallest value not counted for zero.

tol0

Tolerance parameter for LDL decomposition, determines which diagonal values are counted as zero.

Details

The custom state space model is constructed by using the given system matrices Z, H, T, R, Q, a1, P1 and P1inf. Matrix or scalar Z (array in case of time-varying Z) is used to determine the number of states m. If some of the other elements of the object are missing, SSModel uses default values which are identity matrix for T, R (or k first columns of identity matrix) and P1inf, and zero matrix for H, Q, P1 and , a1. If P1 is given and P1inf is not, the it is assumed to be zero matrix. If Q is given, it is used to define r, the dimensions of Q, which can be smaller than m (defaults to m).

The linear Gaussian state space model is given by

y[t] = Z[t]α[t] + ε[t], (observation equation)

α[t+1] = T[t]α[t] + R[t]η[t], (transition equation)

where ε[t] ~ N(0,H[t]), η[t] ~ N(0,Q[t]) and α[1] ~ N(a[1],P[1]) independently of each other. In case of non-Gaussian observations, the observation equation is of form p(y[t]|θ[t]) = p(y[t]|Z[t]α[t]), with p(y[t]|θ[t]) being one of the following:

If observations are Poisson distributed, parameter of Poisson distribution is u[t]λ[t] and θ[t]=log(λ[t]).

If observations are from binomial distribution, u is a vector specifying number the of trials at times 1,…,n, and θ[t] = log(π[t]/(1-π[t])), where pi[t] is the probability of success at time t.

For non-Gaussian models u[t]=1 as a default. For Gaussian models, parameter is omitted.

Only univariate observations are supported when observation equation is non-Gaussian.

Value

object of class SSModel with elements

See Also

arimaSSM for state space representation of ARIMA model, regSSM for state space representation of a regression model, and structSSM for structural time series model.


jrnold/KFAS documentation built on May 19, 2019, 11:55 p.m.