lynx <- scan("../datasets/lynx.dat") lynx <- log10(lynx) resid <- ar(lynx,order.max=2)$resid resid <- resid[-c(1,2)] sum(resid^2)