3
$\begingroup$

I am trying to fit and forecast log returns of a price data using ARIMA model in R. For reproducibility, data is provided here.

Steps Followed, Code and Results obtained

  1. Check for outliers (Package: forecast) - No outliers detected.

    outliers <- tsoutliers(log.rtn)
    
  2. Stationarity Check using ADF test (Package: fUnitRoots) - Series found to be stationary

    stationary <- adfTest(log.rtn, lags = m1$order, type = c("c"))
    
  3. Determination of p,d,q using ACF and PACF (Package: astsa) - Based on my understanding, p = 2, d = 0, q = 2

    acf2(log.rtn, lags = 20)
    
  4. Fitting ARIMA (Package: forecast)

    fit <- auto.arima(log.rtn, stepwise=FALSE, trace=TRUE, approximation=FALSE)
    

    Model obtained : ARIMA(2,0,1)

    Series: log.rtn 
    
      ARIMA(2,0,1) with zero mean     
    
    Coefficients:
              ar1     ar2     ma1
          -0.5705  0.1557  0.6025
    s.e.   0.1549  0.0532  0.1519
    
    sigma^2 estimated as 0.001086:  log likelihood=775.57
    AIC=-1543.14   AICc=-1543.04   BIC=-1527.29
    
  5. Prediction (Package:forecast)

    fcast <- forecast(fit, n.ahead=5)
    plot(fcast)
    
        Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
    390   1.416920e-03 -0.04080849 0.04364233 -0.06316127 0.06599511
    391   8.228924e-04 -0.04142414 0.04306993 -0.06378837 0.06543416
    392  -2.488236e-04 -0.04289257 0.04239493 -0.06546681 0.06496917
    393   2.700663e-04 -0.04248622 0.04302635 -0.06512003 0.06566016
    394  -1.928045e-04 -0.04303250 0.04264690 -0.06571047 0.06532486
    395   1.520366e-04 -0.04273465 0.04303872 -0.06543749 0.06574156
    396  -1.167506e-04 -0.04303183 0.04279833 -0.06574971 0.06551621
    397   9.027370e-05 -0.04284167 0.04302221 -0.06556846 0.06574901
    398  -6.967566e-05 -0.04301167 0.04287232 -0.06574379 0.06560444
    399   5.380284e-05 -0.04289419 0.04300179 -0.06562948 0.06573708
    

I am quite confused why the model is predicting so badly.

$\endgroup$
  • $\begingroup$ What makes you think that the predictions are poor? $\endgroup$ – forecaster Jul 13 '15 at 13:10
  • $\begingroup$ @forecaster: When I plot the data used for fitting (389 data points) and predictions obtained. The predicted values to be almost constant. Apart from that, the magnitudes of the series and predicted values are different.. $\endgroup$ – Abhay Bhadani Jul 13 '15 at 13:25
  • 1
    $\begingroup$ That tells you the data is patternless and has low forecastability, things like price follow random walk and cannot be forecasted, use theory and judgement rather than relying on an automated algorithms. $\endgroup$ – forecaster Jul 13 '15 at 14:55
  • $\begingroup$ @forecaster: Thanks for your suggestion. So, it is always advisable to first plot the series before proceeding for model building. I would also like to know whether the sequence of approach applied is correct, otherwise, to apply on some other data? $\endgroup$ – Abhay Bhadani Jul 13 '15 at 15:37
0
$\begingroup$

For log returns the recommended model to use is GARCH and its variations. Log returns are characterised by volatility clusters: periods of high volatility are followed by high volatility and periods of low volatility are followed by low volatility.

GARCH is designed to handle volatility in a much better way than ARIMA. Further I would not treat the data for outliers as a perceived outlier could carry signal on the start (or end) of a volatility cluster.

Check this post, the R package fGarch and the function garch from package tseries.

$\endgroup$
  • 2
    $\begingroup$ While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. $\endgroup$ – Sean Easter Jul 24 '15 at 0:07
  • $\begingroup$ The answer is: poor predictions are a result from the algorithm adopted. GARCH would provide better predictions as it deals better with log returns data. The link serves as additional documentation on GARCH. In the unlikely event of link changes, a simple Google search on GARCH would be equally useful. $\endgroup$ – elmaroto10 Jul 30 '15 at 6:52
  • $\begingroup$ Nice edits. (My comment and delete vote were made prior.) $\endgroup$ – Sean Easter Jul 30 '15 at 13:11
  • 1
    $\begingroup$ @AbhayBhadani, note that using a GARCH model is not likely to help much in getting accurate forecasts of the conditional mean of the series (even though it might be a good model for the conditional variance). The conditional mean of stock returns, commodity returns, futures returns and many other financial series is nearly unpredictable, and there is little you can do about it besides accepting it. $\endgroup$ – Richard Hardy Aug 3 '15 at 17:58
0
$\begingroup$

There are a few mistakes on your reasoning. Let me explain

  • The Augmented Dickey–Fuller test is NOT a stationarity test. The null-hypothesis on this test is that there exists a unit-root in the series. Rejecting this hypothesis DOES NOT mean the series is stationary. It just means that there is enough evidence to allow you rejecting the hypothesis of a very specific form of non-stationarity (i.e. unit root)
  • To see an ARMA is not a good model for your data, do estimate the ACF of the squares of log-returns. You will see significant autocorrelation at high lags. Which means there is high memory in volatility and/or volatility is non-stationary

  • There is plenty of evidence in financial literature to support the idea that volatility is clustered and that log-returns are uncorrelated. When trying to fit a model, you should not discard prior evidence and theory (when available). This should be your starting point

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.