FilterModel2 {SMFilter} | R Documentation |
Filtering algorithm for the type two model.
Description
This function implements the filtering algorithm for the type two model. See Details part below.
Usage
FilterModel2(mY, mX, mZ, alpha, mB = NULL, Omega, vD, U0,
method = "max_1")
Arguments
mY |
the matrix containing Y_t with dimension |
mX |
the matrix containing X_t with dimension |
mZ |
the matrix containing Z_t with dimension |
alpha |
the |
mB |
the coefficient matrix |
Omega |
covariance matrix of the errors. |
vD |
vector of the diagonals of |
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 two model on Stiefel manifold takes the form:
where is a
-vector of the dependent variable,
and
are explanatory variables wit dimension
and
,
and
have no overlap,
matrix
is the coefficients for
,
is the error vector.
The matrices and
have dimensions
and
, respectively.
Note that
is strictly smaller than both
and
.
and
are both non-singular matrices.
is time-varying while
is time-invariant.
Furthermore, fulfills the condition
,
and therefor it evolves on the Stiefel manifold.
denotes the Matrix Langevin distribution or matrix von Mises-Fisher distribution on the Stiefel manifold.
Its density function takes the form
where denotes
,
and
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 = 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)
mB=NULL
vD = 100
ret = SimModel2(iT=iT, mX=mX, mZ=mZ, mY=mY, alpha=alpha, beta_0=beta_0, mB=mB, vD=vD)
mYY=as.matrix(ret$dData[,1:ip])
fil = FilterModel2(mY=mYY, mX=mX, mZ=mZ, alpha=alpha, mB=mB, Omega=Omega, vD=vD, U0=beta_0)