Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MARSSkemcheck not catching illegal u #158

Open
2 tasks
eeholmes opened this issue Jan 31, 2022 · 0 comments
Open
2 tasks

MARSSkemcheck not catching illegal u #158

eeholmes opened this issue Jan 31, 2022 · 0 comments
Assignees
Labels
bug actual bug
Milestone

Comments

@eeholmes
Copy link
Collaborator

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 eeholmes added the bug actual bug label Jan 31, 2022
@eeholmes eeholmes added this to the 3.11.5 milestone Jan 31, 2022
@eeholmes eeholmes self-assigned this Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug actual bug
Projects
None yet
Development

No branches or pull requests

1 participant