SimModel2 {SMFilter}R Documentation

Simulate from the type two state-space Model on Stiefel manifold.

Description

This function simulates from the type two model on Stiefel manifold. See Details part below.

Usage

SimModel2(iT, mX = NULL, mZ = NULL, mY = NULL, beta_0, alpha,
  mB = NULL, Omega = NULL, vD, burnin = 100)

Arguments

iT

the sample size.

mX

the matrix containing X_t with dimension T×q1T \times q_1.

mZ

the matrix containing Z_t with dimension T×q2T \times q_2.

mY

initial values of the dependent variable for ik-1 up to 0. If mY = NULL, then no lagged dependent variables in regressors.

beta_0

the initial beta, iqx+ip*ik, y_1,t-1,y_1,t-2,...,y_2,t-1,y_2,t-2,....

alpha

the α\alpha matrix, p×rp \times r.

mB

the coefficient matrix B\boldsymbol{B} before mZ with dimension p×q2p \times q_2.

Omega

covariance matrix of the errors.

vD

vector of the diagonals of DD.

burnin

burn-in sample size (matrix Langevin).

Details

The type two model on Stiefel manifold takes the form:

yt=αβtxt+Bzt+εt\boldsymbol{y}_t \quad = \quad \boldsymbol{\alpha} \boldsymbol{\beta}_t ' \boldsymbol{x}_t + \boldsymbol{B}' \boldsymbol{z}_t + \boldsymbol{\varepsilon}_t

βt+1βtML(q1,r,βtD)\boldsymbol{\beta}_{t+1} | \boldsymbol{\beta}_{t} \quad \sim \quad ML (q_1, r, \boldsymbol{\beta}_{t} \boldsymbol{D})

where yt\boldsymbol{y}_t is a pp-vector of the dependent variable, xt\boldsymbol{x}_t and zt\boldsymbol{z}_t are explanatory variables wit dimension q1q_1 and q2q_2, xt\boldsymbol{x}_t and zt\boldsymbol{z}_t have no overlap, matrix B\boldsymbol{B} is the coefficients for zt\boldsymbol{z}_t, εt\boldsymbol{\varepsilon}_t is the error vector.

The matrices α\boldsymbol{\alpha} and βt\boldsymbol{\beta}_t have dimensions p×rp \times r and q1×rq_1 \times r, respectively. Note that rr is strictly smaller than both pp and q1q_1. α\boldsymbol{\alpha} and βt\boldsymbol{\beta}_t are both non-singular matrices. βt\boldsymbol{\beta}_t is time-varying while α\boldsymbol{\alpha} is time-invariant.

Furthermore, βt\boldsymbol{\beta}_t fulfills the condition βtβt=Ir\boldsymbol{\beta}_t' \boldsymbol{\beta}_t = \boldsymbol{I}_r, and therefor it evolves on the Stiefel manifold.

ML(p,r,βtD)ML (p, r, \boldsymbol{\beta}_t \boldsymbol{D}) denotes the Matrix Langevin distribution or matrix von Mises-Fisher distribution on the Stiefel manifold. Its density function takes the form

f(βt+1)=etr{Dβtβt+1}0F1(p2;14D2)f(\boldsymbol{\beta_{t+1}} ) = \frac{ \mathrm{etr} \left\{ \boldsymbol{D} \boldsymbol{\beta}_{t}' \boldsymbol{\beta_{t+1}} \right\} }{ _{0}F_1 (\frac{p}{2}; \frac{1}{4}\boldsymbol{D}^2 ) }

where etr\mathrm{etr} denotes exp(tr())\mathrm{exp}(\mathrm{tr}()), and 0F1(p2;14D2)_{0}F_1 (\frac{p}{2}; \frac{1}{4}\boldsymbol{D}^2 ) is the (0,1)-type hypergeometric function for matrix.

Note that the function does not add intercept automatically.

Value

A list containing the sampled data and the dynamics of beta.

The object is a list containing the following components:

dData

a data.frame of the sampled data

aBeta

an array of the βt\boldsymbol{\beta}_t with the dimension T×q1×rT \times q_1 \times r

Author(s)

Yukai Yang, yukai.yang@statistik.uu.se

Examples


iT = 50
ip = 2
ir = 1
iqx =3
iqz=2
ik = 1

if(iqx==0) mX=NULL else mX = matrix(rnorm(iT*iqx),iT, iqx)
if(iqz==0) mZ=NULL else mZ = matrix(rnorm(iT*iqz),iT, iqz)
if(ik==0) mY=NULL else mY = matrix(0, ik, ip)

alpha = matrix(c(runif_sm(num=1,ip=ip,ir=ir)), ip, ir)
beta_0 = matrix(c(runif_sm(num=1,ip=ip*ik+iqx,ir=ir)), ip*ik+iqx, ir)
if(ip*ik+iqz==0) mB=NULL else mB = matrix(c(runif_sm(num=1,ip=(ip*ik+iqz)*ip,ir=1)), ip, ip*ik+iqz)
vD = 50

ret = SimModel2(iT=iT, mX=mX, mZ=mZ, mY=mY, alpha=alpha, beta_0=beta_0, mB=mB, vD=vD)


[Package SMFilter version 1.0.3 Index]