title: VAR(1) with DLM package Maximum Likelihood estimation
body: <p>I'm trying to write a VAR(1) in DLM form, and I'm using this code:</p>
  
  <p>y is a 200x3 matrix</p>
  
  <pre><code>build &lt;- function(u) {dlm(m0=c(y[1,]),
  C0=1*diag(3),
  FF=diag(3),V=diag(c(1e-3,1e-3,1e-3)), 
  GG= matrix(c(u[1:9]), ncol=3), 
  W=matrix(c (exp(u[10]),u[11],u[12],u[11], exp(u[13]),u[14],u[12],u[14], exp(u[15]) ),ncol=3))}
  
  init &lt;- rep(0,15)
  outMLE &lt;- dlmMLE(y,init, build)
  </code></pre>
  
  <p>R can't calculate the dlmMLE and reports: "W is not a valid variance matrix". </p>
  
  <p>I would appreciate any suggestions, thanks.</p>