Displaying 1 result from an estimated 1 matches for "r_kalmanlik".
Did you mean:
r_kalmanlike
2010 Sep 10
0
How to call to R_KalmanLike from outside StructTS
...e. The first version is the same code as the 'StructTS' function:
StructTS.v1 <- function (x, type = c("level", "trend", "BSM"), init = NULL,
??? fixed = NULL, optim.control = NULL)
{
??? KalmanLike2 <- function(y, mod, nit = 0) {
??????? x <- .Call(R_KalmanLike, y, mod$Z, mod$a, mod$P, mod$T,
??????????? mod$V, mod$h, mod$Pn, as.integer(nit), FALSE, fast = TRUE)
??????? 0.5 * sum(x)/length(y)
??? }
#...
#... above and remaining code is the same as the original code in StructTS
#...
}
Running this version gives the following error:
R> StructTS.v1(lo...