Skip to content
Prev 164066 / 398503 Next

DLM - Covariates in the system equation

Hi Jens,

I assume you are using package dlm. 

To add covariates to the system equation the workaround is to include
psi in the state vector. Suppose your observation and system equations are
as follow:

Y[t] = F[t]theta[t] + v[t], v[t] ~ N[0,V] #observation equation
theta[t]  = G[t]theta[t-1] + Z[t]psi + w[t], w[t] ~ N[0,W] #system equation

(Note that I wrote F[t]theta[t] instead of F'[t]theta[t], Z[t]psi
instead of psi*Z[t], and G[t]theta[t-1] instead of simply theta[t-1])

Defining 

thetahat[t] = [theta[t]'  psi']'


Fhat[t] = [ F[t]  0 ]


          [ G[t]  Z[t] ]
Ghat[t] = [            ]
          [  0     Id  ]


What = blockdiag(W, 0)


you have a new DLM that satisfies your requirement. I hope this is
clear enough for you to implement it in R. If not, please send a small
example telling us what you want to do. By the way, questions about
contributed packages should be addressed to the package maintainer
first. 

Best,
Giovanni Petris
(author of package dlm)

  
    
Message-ID: <200812081745.mB8HjMoS024905@definetti.ddns.uark.edu>
In-Reply-To: <OF64A46145.BBC02AD0-ONC1257519.000C65C1-85257519.001D0F15@unisg.ch> (jens.keller@unisg.ch)