atsa-es / marssTMB

Companion package for MARSS that allows you to use TMB to fit MARSS models
https://atsa-es.github.io/marssTMB/
1 stars 0 forks source link

something wrong with LL calc #15

Closed eeholmes closed 1 year ago

eeholmes commented 1 year ago

Running into numerical problems but not really reporting that.

Should put in the option to compute the chol of the var-cov matrix the way I did for MARSSoptim(). Something is off with the separation method.

library(MARSS)
data(lakeWAplankton, package = "MARSS")
phytoplankton <- c("Cryptomonas", "Diatoms", "Greens", "Unicells", "Other.algae")
dat <- as.data.frame(lakeWAplanktonTrans) |>
  subset(Year >= 1980 & Year <= 1989) |>
  subset(select=phytoplankton) |>
  t() |>
  MARSS::zscore()
modlist = list(U="zero", A="zero", Q="unconstrained")
a = MARSS(dat[,14:22], method="BFGS_TMB", model=modlist, control=list(trace=1))

LL much lower than

a = MARSS(dat[,14:22], method="BFGS_TMB")

also LL doesn't match. The LL output is from the KF but within the opt output is the LL coming from TMB. Should match.

a$iter.record$opt.output$value
eeholmes commented 1 year ago

Not able to replicate