1
$\begingroup$

I have a time series of log returns (from 01-01-2007 to 31-12-2012). I need to predict the t+1,t+2, ....... t+1510 log stock returns. Basically, what I need is to predict the 1 day ahead return for every single day. So I would like to predict the return on the 02-01-2007, the 03-01-2007........till the 01-01-2013.

I have therefore done the following coding using fGARCH in R:

      AIG <- garchFit(formula = ~arma(1, 1) + garch(1, 1), data =R.AXP, cond.dist = "std")
      Predict_AIG <- predict(AIG, n.ahead = 1510)

But this gives me the prediction on a single forecast horizon (so it gives me the forecast 1, 2,3.....1510 days from the 01-01-2007) not the forecast on the 02-01-2007, 03-01-2007,...........01-01-2013.

Please can anyone help me to find a different way of coding. Thank you.

$\endgroup$
2
  • 1
    $\begingroup$ Welcome to CV! Please describe also your data. Also while using non-base R package it is good to provide the name of library you use so people do not have to google for it (and so the answers are also less error-prone). $\endgroup$
    – Tim
    Commented Jan 26, 2015 at 22:44
  • $\begingroup$ The forecast package has a function called tsCV which can do what you need. $\endgroup$ Commented Oct 18, 2017 at 17:03

1 Answer 1

2
$\begingroup$
  • I get the same values(for the mean forecast) up to the last date (row 1510). Am I doing something wrong?

An $h$-step forecast from an AR(1) model is $$\hat{x}_{t+h}=\mu+\phi^h (x_t-\mu)$$ where $\phi$ is the AR(1) coefficient and $\mu$ is the mean of the series.

  1. You may be getting the same values for all but the first forecast (which is the only one affected by the MA(1) term) if the estimated AR(1) coefficient $\hat{\phi}$ is equal to zero.
  2. You may be getting approximately equal values for all but the first few forecasts if the estimated AR(1) coefficient $\phi$ is close to zero. For $h$ sufficiently large $\phi^h$ will be close to zero and you will not see any differences between forecasts due to rounding.

    • What values should I consider as the predicted returns?

meanForecast seems to be the column of predicted returns.

  • What does the mean error mean?

Not sure. Perhaps it indicates the width of the prediction interval: meanForecast$\pm$ meanError should give you a ?% prediction interval (the exposition here may help a bit).

  • How is the mean error of any use to me?

If you only care about point forecasts, you may neglect the mean error for the moment. But typically you are also interested in how precise your point forecast is likely to be. Then you look at prediction intervals to get the idea where the point forecast should lie with ?% certainty.

Finally, are you sure you want to forecast as far as 1510 periods ahead? Your forecast could be reliable one or a few periods ahead but not a hundred or a thousand periods ahead. By the time of 1510 periods your data generating process (DGP) may change a lot.

An alternative to making just one point forecast is to simulate your process many times (at least a thousand) and look at the realizations. By using some summary statistics over the realizations you could perhaps get a broader view of what may happen in the future. Unfortunately, this does not account for the possible evolution of your DGP over time, which may be a problem.

$\endgroup$
4
  • $\begingroup$ Thank you very much, the fact is i have a time serie of daily log returns from the (01-01-2008) to (31-12-2012) i need to calculate the 1 day ahead value at risk for every single day . So i need the 1 day ahead VaR for the 01-01-2008, the 02-01-2008........31-12-2012. Thank you again for your time $\endgroup$
    – Alexandre
    Commented Jan 27, 2015 at 9:02
  • $\begingroup$ Apparently, I misunderstood the formulation in your original post. I suggest you edit the original post to make this point clear and explicit (looking forward to other answers). Also, if you need one-day-ahead forecasts for 1510 different forecast origins, you code it differently than how you have done it (currently the code gives you 1,2,...,1510 days-ahead forecasts for one forecast origin). $\endgroup$ Commented Jan 27, 2015 at 9:29
  • $\begingroup$ Thanks Richard it is exactly what i need. What i want is the one day ahead forecast for 1510 different forecast origins. please do you know how to code that please i really do need some help on this. $\endgroup$
    – Alexandre
    Commented Jan 27, 2015 at 11:55
  • $\begingroup$ Perhaps there already is an automatized procedure for that, check out the manual for the package you are using. I know it is implemented in another package rugarch using function ugarchroll (it even has a vignette). If you were to implement it manually, the idea would be to make a loop and put the two lines of code you have inside it. For each iteration, take a window of your data, i.e. something like data=R.AXP[1:i] where i is the loop index in place of data=R.AXP and use n.ahead=1. $\endgroup$ Commented Jan 27, 2015 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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