Description Usage Arguments Details Value Author(s) Examples
This function implements the filtering algorithm for the type two model. See Details part below.
1 2 | FilterModel2(mY, mX, mZ, alpha, mB = NULL, Omega, vD, U0,
method = "max_1")
|
mY |
the matrix containing Y_t with dimension T \times p. |
mX |
the matrix containing X_t with dimension T \times q_1. |
mZ |
the matrix containing Z_t with dimension T \times q_2. |
alpha |
the α matrix. |
mB |
the coefficient matrix \boldsymbol{B} before |
Omega |
covariance matrix of the errors. |
vD |
vector of the diagonals of D. |
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'). |
The type two model on Stiefel manifold takes the form:
\boldsymbol{y}_t \quad = \quad \boldsymbol{α} \boldsymbol{β}_t ' \boldsymbol{x}_t + \boldsymbol{B}' \boldsymbol{z}_t + \boldsymbol{\varepsilon}_t
\boldsymbol{β}_{t+1} | \boldsymbol{β}_{t} \quad \sim \quad ML (q_1, r, \boldsymbol{β}_{t} \boldsymbol{D})
where \boldsymbol{y}_t is a p-vector of the dependent variable, \boldsymbol{x}_t and \boldsymbol{z}_t are explanatory variables wit dimension q_1 and q_2, \boldsymbol{x}_t and \boldsymbol{z}_t have no overlap, matrix \boldsymbol{B} is the coefficients for \boldsymbol{z}_t, \boldsymbol{\varepsilon}_t is the error vector.
The matrices \boldsymbol{α} and \boldsymbol{β}_t have dimensions p \times r and q_1 \times r, respectively. Note that r is strictly smaller than both p and q_1. \boldsymbol{α} and \boldsymbol{β}_t are both non-singular matrices. \boldsymbol{β}_t is time-varying while \boldsymbol{α} is time-invariant.
Furthermore, \boldsymbol{β}_t fulfills the condition \boldsymbol{β}_t' \boldsymbol{β}_t = \boldsymbol{I}_r, and therefor it evolves on the Stiefel manifold.
ML (p, r, \boldsymbol{β}_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(\boldsymbol{β_{t+1}} ) = \frac{ \mathrm{etr} ≤ft\{ \boldsymbol{D} \boldsymbol{β}_{t}' \boldsymbol{β_{t+1}} \right\} }{ _{0}F_1 (\frac{p}{2}; \frac{1}{4}\boldsymbol{D}^2 ) }
where \mathrm{etr} denotes \mathrm{exp}(\mathrm{tr}()), and _{0}F_1 (\frac{p}{2}; \frac{1}{4}\boldsymbol{D}^2 ) is the (0,1)-type hypergeometric function for matrix.
an array aAlpha
containing the modal orientations of alpha in the prediction step.
Yukai Yang, yukai.yang@statistik.uu.se
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.