View source: R/mvInnovations.R
| mvInnovations | R Documentation | 
Function mvInnovations computes the multivariate versions of one 
step-ahead prediction errors and their variances using the output of KFS.
mvInnovations(x)
| x | Object of class  | 
| v | Multivariate prediction errors  | 
| F | Prediction error variances  | 
| Finf | Diffuse part of  | 
# Compute the filtered estimates based on the KFS output
filtered <- function(x) {
  innov <- mvInnovations(x)
  att <- window(x$a, end = end(x$a) - 1)
  tvz <- attr(x$model,"tv")[1]
  
  for (i in 1:nrow(att)) {
    att[i,] <- att[i,] + 
      x$P[,,i] %*% 
      t(solve(innov$F[,,i], x$model$Z[, , tvz * (i - 1) + 1, drop = FALSE])) %*%
      innov$v[i, ]
  }
  att
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.