[R] SSPIR problem

Fernando Saldanha fsaldan1 at gmail.com
Sat Apr 29 11:16:23 CEST 2006


I am having a problem with the package SSPIR. The code below
illustrates it. I keep getting the message: "Error in y - f :
non-conformable arrays."

I tried to tweak the code below in many different ways, for example,
substituting rbind for cbind, and sometimes I get a different error
message, but I could not find a variation of this code that would
work.

Any help will be greatly appreciated. I am running R version 2.3, on
Windows XP Professional.

> library(sspir)
>
> # Create observation vector
> y_ <- cbind(rep(1, 20), rep(2, 20))
>
> mat <- rbind(c(1, 2), c(3, 4))
>
> #####################################################################
> # Create model
> model <- SS(y = matrix(y_),
+           Fmat = function(tt, x, phi) {
+             FM <- mat
+             cat("Fmat", dim(FM), "\n")
+             FM
+           },
+           Gmat = function(tt, x, phi) {
+           GM <- mat
+           cat("Gmat", dim(GM), "\n")
+           GM
+           },
+           Vmat = function(tt, x, phi) {
+           VM <- mat
+           cat("Vmat", dim(VM), "\n")
+           VM
+           }, # var observation equation
+           Wmat = function(tt, x, phi) {
+           WM <- mat
+           cat("Wmat", dim(WM), "\n")
+           WM
+           },
+           m0 = matrix(c(1, 2), nrow = 1),
+           C0 = mat)
Gmat 2 2
Gmat 2 2
>
> model.f <- kfilter(model)
Gmat 2 2
Wmat 2 2
Fmat 2 2
Vmat 2 2
Error in y - f : non-conformable arrays
>




More information about the R-help mailing list