8.7 Model diagnostics
We will examine some basic model diagnostics for these three approaches by looking at plots of the model residuals and their autocorrelation functions (ACFs) for all five taxa using the following code:
for (i in 1:3) {
dev.new()
<- paste("seas.mod", i, sep = ".")
modn for (j in 1:5) {
<- MARSSresiduals(get(modn), type = "tt1")$model.residuals[j,
resid.j
]plot.ts(resid.j, ylab = "Residual", main = phytos[j])
abline(h = 0, lty = "dashed")
acf(resid.j, na.action = na.pass)
} }