inst/userguide/figures/CS4--fit_covar.R

###################################################
### code chunk number 39: fit_covar
###################################################
if (!saved.res) {
  model.list <- list(m = 2, R = "unconstrained")
  kemz.temp <- MARSS(dat.spp.1980,
    model = model.list, z.score = TRUE, form = "dfa",
    control = big.maxit.cntl.list, covariates = temp
  )
  kemz.TP <- MARSS(dat.spp.1980,
    model = model.list, z.score = TRUE, form = "dfa",
    control = big.maxit.cntl.list, covariates = TP
  )
  kemz.both <- MARSS(dat.spp.1980,
    model = model.list, z.score = TRUE, form = "dfa",
    control = big.maxit.cntl.list, covariates = rbind(temp, TP)
  )
} else {
  # reload to re-define kemz.temp etc since prev chunk redefined
  load(paste("./manual_files/", file, sep = ""))
}
nwfsc-timeseries/MARSS documentation built on June 3, 2023, 1:32 p.m.