Discussion of article "Implementing an ARIMA training algorithm in MQL5"

 

New article Implementing an ARIMA training algorithm in MQL5 has been published:

In this article we will implement an algorithm that applies the Box and Jenkins Autoregressive Integrated Moving Average model by using Powells method of function minimization. Box and Jenkins stated that most time series could be modeled by one or both of two frameworks.

So far we have looked at the implementation of an autoregressive training algorithm without indicating how to derive or choose the appropriate order for a model. Training a model is probably the easy part, in constrast to determining a good model.


Two useful tools to derive a suitable model is to calculate the autocorrelation and partial autocorrelation of a series under study. As a guide to help readers in interpreting autocorrelation and partial autocorrelation plots we will consider four hypothetical series.
                                                                  y(t) = AR1* y(t-1) +  E(t)           (3) 

                 
                                                                  y(t) = E(t) - AR1 * y(t-1)            (4) 

            
                                                                  y(t) = MA1 * E(t-1) +  E(t)          (5) 

                
                                                                   y(t) = E(t) - MA1 * E(t-1)           (6) 

    
(3) and (4) are pure AR(1) processes with positive and negative coefficients respectively. (5) and (6) are pure MA(1) processes with positive and negative coefficients respectively.  

Autocorrelations of series with a positive AR term and a negative AR term respectively


The figures above are the autocorrelations of (3) and (4)  respectively. In both plots the correlation values become smaller as the lag increases. This makes sense since the effect of a previous value on the current diminishes as one goes further up the series.

Author: Francis Dube

 
if Y is the time series, how can I find the Molded Y Array from the code you provided ?
 
Ramzi D #:
if Y is the time series, how can I find the Molded Y Array from the code you provided ?
double y[];//fill y with series data-----

//create CArima instance
CArima arima; 
//train 
arima.fit(y,p,d,q,use_constant_offset); // p , d and q are the model parameters that you must decide on , use_constant_offset is a boolean specifying the use of a constant in the model, method returns true on success, if true then model is built , it then can be used to make predictions

If having difficulty please specify where you are getting lost.

Reason: