MARSS icon indicating copy to clipboard operation
MARSS copied to clipboard

explain weird predict behaviour

Open eeholmes opened this issue 4 years ago • 0 comments

Need to explain to user why this occurs

# Covariate example
fulldat <- lakeWAplanktonTrans
years <- fulldat[,"Year"]>=1965 & fulldat[,"Year"]<1975
dat <- t(fulldat[years,c("Greens", "Bluegreens")])
dat <- zscore(dat)
covariates <- rbind(
  Temp = fulldat[years, "Temp"],
  TP = fulldat[years, "TP"])
covariates <- zscore(covariates)
A <- U <- "zero"
B <- Z <- "identity"
R <- diag(0.16,2)
Q <- "equalvarcov"
C <- "unconstrained"
model.list <- list(B=B,U=U,Q=Q,Z=Z,A=A,R=R,C=C,c=covariates)
fit <- MARSS(dat, model=model.list)

Looks bad

plot(predict(fit,  newdata=list(y=dat, c=matrix(5,2,120)), type="ytt1"))

Looks better

plot(predict(fit,  newdata=list(y=dat, c=matrix(5,2,120)), type="ytt"))

Looks best

plot(predict(fit,  newdata=list(y=dat, c=matrix(5,2,120)), type="ytT"))

eeholmes avatar Oct 14 '21 00:10 eeholmes