library(TSA) data(lynx) plot(log(lynx)) pacf(log(lynx)) arma.lynx=arima(log(lynx),order=c(3,0,0)) arma.lynx # R-squared 1-.2669/1.653 data(sunspots) ?sunspots plot(sunspots) ?aggregate frequency(sunspots) sunspots.y=aggregate(sunspots,nfrequency=1) frequency(sunspots.y) plot(sunspots.y) sunspots.y1=aggregate(sunspots,nfrequency=1,FUN=median)*12 lines(sunspots.y1,col='brown') hist(sunspots.y) boxcox=BoxCox.ar(sunspots.y+min(sunspots.y[sunspots.y!=0])) boxcox # MLE suggest square root transformation plot(sqrt(sunspots.y)) acf(sqrt(sunspots.y),lag.max=60) pacf(sqrt(sunspots.y),lag.max=60) eacf(sqrt(sunspots.y)) arima.s=arima(sqrt(sunspots.y),order=c(3,0,0)) polyroot(c(1,-arima.s$coef[-4])) Mod(polyroot(c(1,-arima.s$coef[-4]))) # stationary Arg(polyroot(c(1,-arima.s$coef[-4]))) theta from the Arg = theta=0.5698923 period=2*pi/theta period