Discussion of article "Forecasting with ARIMA models in MQL5"

 

New article Forecasting with ARIMA models in MQL5 has been published:

In this article we continue the development of the CArima class for building ARIMA models by adding intuitive methods that enable forecasting.

It is well known that ARIMA models rely on temporal dependences in a dataset. Therefore to make one or more predictions we need to feed the model a series of input data. The specification of the model determines the minimum size of the input series. Knowning this, it becomes obvious that if the input series is inadequate it will not be possible to make any predictions or at the very least the predictions will not be reflective of the applied model. Different types of ARIMA models make varying demands on the size of the input series beyond just the order of the model.

Implementing predictions for pure autoregressive models is trivial as all that is required are inputs equal to the largest lag of the model. Mixed models that use moving average terms create problems when making forecasts. We have no actual error or innovation series yet. To overcome this we must first decide how the initial values of errors will be calculated.

This process involves first using any available model parameters to get the initial state of the model which excludes any of the moving average terms, as they are assumed to be 0 at this stage. Then the known series values are used to calculate initial error values by cycling through an number of redundant predictions.These initial predictions are redundant because they will have nothing to do with the final prediction(s) we are ultimately interested in. This obviously puts more demands on the number of inputs needed for prediction. The critical thing to appreciate here is how many redundant prediction cycles should be peformed in order to come up with suitable  error series values to make valid  predictions.

Author: Francis Dube

 

Hello Francis!

An excellent article!  As I am converting an MQ4 EA that use several averages,  I am going to study your code to determine the best integration and will be back in touch later

CapeCoddah

 
Thank you for the article
 

Thanks for your very informative article. Can I predict more than one step ahead?

I guess just increasing "NumberOfPredictions" isn't enough, is it?

 
I know you have created something really good here but the trainARmodel script does not work for me, what do you recommend i should do.
Reason: