Hi does anyone know why my ACF is not plotting my lag max when for my time series? You can use the airpassenger data in R for this question.
My code is:
acf(z.t, lag.max = 40, main = expression(paste("acf of Z"[t])))
and I'm getting
but want have 1-40 on the x-axis.
The data is a time series by month. Forty lags spans a range of 40 months, or 3.33 years. The time unit on the x-axis is denominated in years and you're seeing lags of 0 to 40 months in the graph.
As another example, if you run acf(AirPassengers, lag.max=12) you can see that the x-axis has lags from 0 to 12 months and the axis is labeled from zero to 1 year.

You can relabel the axis if you wish. For example:
mx=40
acf(AirPassengers, lag.max=mx, xaxt="n", xlab="Lag (months)")
axis(1, at=0:mx/12, labels=0:mx)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With