robjhyndman / forecast

Forecasting Functions for Time Series and Linear Models
http://pkg.robjhyndman.com/forecast
1.12k stars 342 forks source link

Auto.arima() returns a different ARIMA model from ACF/PACF #634

Closed yuanyuan2319 closed 6 years ago

yuanyuan2319 commented 6 years ago

Hi Hyndman,

I am using auto.arima() to fit stock returns. However, auto.arima() returns ARIMA(1,0,0), while acf/pacf plot indicates the best model is ARIMA(2,0,2).

The two results seems quite different. Could you let me know the reason? Auto.arima() choose the best model based on aic/bic, but shouldn't the result be consistent with acf/pacf plot?

Following is the reproducible codes:

getSymbols("TECHM.NS", from="2012-01-01", to = "2015-01-01")
stock_prices = TECHM.NS[,4]
stock = diff(log(stock_prices), lag = 1)
stock = stock[!is.na(stock)]

breakpoint = floor(nrow(stock)*(2.9/3))
acf.stock = acf(stock[c(1:breakpoint),], main = "ACF Plot", lag.max = 100)
pacf.stock = pacf(stock[c(1:breakpoint),], main = "PACF Plot", lag.max = 100)

Based on the ACF/PACF codes, the best model is ARIMA(2,0,2). However, based on auto.arima()

auto.arima(stock[1:breakpoint], ic = "bic")
auto.arima(stock[1:breakpoint], ic = "aic")

ARIMA(1,0,0) is returned.

Thank you in advance for your time. Happy New Year!

robjhyndman commented 6 years ago

You cannot possibly tell that it is an ARIMA(2,0,2) from the ACF/PACF alone. ACF/PACF are only useful for picking pure AR or pure MA models.