FilterModel1 {SMFilter}R Documentation

Filtering algorithm for the type one model.

Description

This function implements the filtering algorithm for the type one model. See Details part below.

Usage

FilterModel1(mY, mX, mZ, beta, mB = NULL, Omega, vD, U0,
  method = "max_1")

Arguments

mY

the matrix containing Y_t with dimension T×pT \times p.

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.

beta

the β\beta matrix.

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.

U0

initial value of the alpha sequence.

method

a string representing the optimization method from c('max_1','max_2','max_3','min_1','min_2').

Details

The type one model on Stiefel manifold takes the form:

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

αt+1αtML(p,r,αtD)\boldsymbol{\alpha}_{t+1} | \boldsymbol{\alpha}_{t} \quad \sim \quad ML (p, r, \boldsymbol{\alpha}_{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 αt\boldsymbol{\alpha}_t and β\boldsymbol{\beta} 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. αt\boldsymbol{\alpha}_t and β\boldsymbol{\beta} are both non-singular matrices. αt\boldsymbol{\alpha}_t is time-varying while β\boldsymbol{\beta} is time-invariant.

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

ML(p,r,αtD)ML (p, r, \boldsymbol{\alpha}_{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{\alpha_{t+1}} ) = \frac{ \mathrm{etr} \left\{ \boldsymbol{D} \boldsymbol{\alpha}_{t}' \boldsymbol{\alpha_{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.

Value

an array aAlpha containing the modal orientations of alpha in the prediction step.

Author(s)

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

Examples


iT = 50
ip = 2
ir = 1
iqx = 4
iqz=0
ik = 0
Omega = diag(ip)*.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_0 = matrix(c(runif_sm(num=1,ip=ip,ir=ir)), ip, ir)
beta = matrix(c(runif_sm(num=1,ip=ip*ik+iqx,ir=ir)), ip*ik+iqx, ir)
mB=NULL
vD = 100

ret = SimModel1(iT=iT, mX=mX, mZ=mZ, mY=mY, alpha_0=alpha_0, beta=beta, mB=mB, vD=vD, Omega=Omega)
mYY=as.matrix(ret$dData[,1:ip])
fil = FilterModel1(mY=mYY, mX=mX, mZ=mZ, beta=beta, mB=mB, Omega=Omega, vD=vD, U0=alpha_0)


[Package SMFilter version 1.0.3 Index]