mvInnovations {KFAS} | R Documentation |
Multivariate Innovations
Description
Function mvInnovations
computes the multivariate versions of one
step-ahead prediction errors and their variances using the output of KFS
.
Usage
mvInnovations(x)
Arguments
x |
Object of class |
Value
v |
Multivariate prediction errors |
F |
Prediction error variances |
Finf |
Diffuse part of |
Examples
# 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
}
[Package KFAS version 1.5.1 Index]