MARSS icon indicating copy to clipboard operation
MARSS copied to clipboard

MARSSkemcheck not catching illegal u

Open eeholmes opened this issue 3 years ago • 0 comments

Per 7.2.2 these should be caught by MARSSkemcheck in the degenerate checks. MARSSkem had a check commented out

      # if(any(diag.Q==0)) U.degen.update=!all(d$U[diag.Q==0,,]==0)    #CUT?

to catch the illegal u. The check in kemcheck should have caught this but didn't.

  • [ ] check possible bug in kemcheck that is not catching an attempted u estimation for an indirectly stochastic x. It fails but in MARSSkem not kemcheck.
control = list(maxit=100, minit=1, trace = 1)
model <- list(
    B = matrix(list(0.5, 1, 0.5, 0), nrow=2), 
    U = matrix(list("u1", "u2"), 2, 1), 
    Q = matrix(c(1, 0, 0, 0), nrow=2), 
    A = matrix(c(0)), 
    Z = matrix(1, 1, 2), 
    R = diag(1), 
    x0 = matrix(c(0, 0)), 
    tinitx = 0
)

rows = 200
dim = 1
y = matrix(1:rows*dim, dim, rows)

fit.0 <- MARSS(y, model = model, control=control, fun.kf="MARSSkfss")
  • [ ] check possible bug in kemcheck that is not catching the following. Per 7.2.2, the u associated with indirectly stochastic x rows should not be estimable due to a fundamental constraint in the partial differentiation. If so this should throw an error since row 2 of x is indirectly stochastic. That u is shared with a stochastic x should not matter given the issue described in 7.2.2.
control = list(maxit=100, minit=1, trace = 1)
model <- list(
   B = matrix(list(0.5, 1, 0.5, 0), nrow=2), 
   U = matrix(list("u1", "u1"), 2, 1), 
   Q = matrix(c(1, 0, 0, 0), nrow=2), 
   A = matrix(c(0)), 
   Z = matrix(1, 1, 2), 
   R = diag(1), 
   x0 = matrix(c(0, 0)), 
   tinitx = 0
)

rows = 200
dim = 1
y = matrix(1:rows*dim, dim, rows)

fit.0 <- MARSS(y, model = model, control=control, fun.kf="MARSSkfss")

eeholmes avatar Jan 31 '22 21:01 eeholmes