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 |
mZ |
the matrix containing Z_t with dimension |
mY |
initial values of the dependent variable for |
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 |
mB |
the coefficient matrix |
Omega |
covariance matrix of the errors. |
vD |
vector of the diagonals of |
burnin |
burn-in sample size (matrix Langevin). |
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.
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 |
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)