On autoregressive moving-average models as a tool of virtual stock-exchange: experimental investigation

. The objective of this work is to investigate experimentally the well-known autoregressive models as simplest algorithms simulating prediction processes of the stockholders using the historical stock rates only. The “virtual” stock exchange which applies these algorithms can help in testing various assumptions of investor behavior. To represent users that prefer linear utility functions, the autoregressive moving-average model ( ARMA - ABS ( p, q ) ), minimizing the absolute values of prediction errors is regarded, in addition to the traditional ARMA ( p,q ) model which minimize the least square errors. The results of two hundred actual ﬁnancial time series and a hundred of virtual ones are discussed in short.


Introduction
The field of time series analysis and forecasting methods has significantly changed in the recent time due to the influence of new knowledge in non-linear dynamics. New methods such as artificial neural networks replaced traditional approaches which usually were appropriate for linear models only.
Nevertheless, there are still applications where estimations of linear processes, such as autoregressive and moving average models, are desirable. This includes the simulation of the stock exchange by some simple algorithms imitating actions of major stockholders based on their predictions of future stock rates and expected profits. In this setup we need prediction algorithms which are understandable for ordinary stockholders and not to difficult for calculations. Algorithms of autoregressive models satisfy these conditions. The common autoregressive model is AR(p). This model reflects the opinions of risk-prone users because the squared prediction errors are minimized. To represent risk-neutral users we regard AR-ABS (p) where absolute errors are minimized.
Applying these models we assume that each player predicts stock prices by AR(p) or AR-ABS (p) of order p. The scale parameters a of the model AR(p) are estimated using the standard least squares algorithm for different p The optimization of these parameters in AR-ABS (p) is a piece-wise linear programming problem [12,9] which can be formulated as the Linear Programming (LP) one.
Actual stockholders use their own ways of predicting. We regard the AR(p) and AR-ABS (p) models as the simplest initial approximations of their prediction pro-cesses. The next approximations are ARMA(p, q) and ARMA-ABS (p, q) 1 which corrects the past errors. The AR-ABS (p) model was introduced in [12]. The ARMA-ABS (p, q) model is a new element of this paper To optimize parameters b we have to solve multi-modal problem using global optimization methods [8,10,11,3,4]. Traditional methods [7,2] solved similar problems using specific statistical techniques including sequential local optimization with no references to the inherent multimodality of errors as a function of MA parameters b.

Simulating stockholders predictions
The formal description of the ARMA(p, q) models is well known [2,7]. However, we shall describe these models in the form more convenient for discussions of this paper and supplement them by the new ARMA-ABS (p, q) models representing linear utility functions.
Assume that a stockholder predicts next-day stock prices Z(t+ 1) using the AR(p) model [2]. Professional investors are trying to obtain additional information about the fundamentals of the stock and use advanced mathematical models. Thus the AR(p) of order p model can be regarded as a simplest simulator of a nonprofessional player which is making investments based on the data observed during past p days.
The profit of the stockholder depends on the accuracy of prediction made at time s, s = 1, . . . , t, where t denotes the present time.
Assume that the stock rates changes following this simple relation This formula describes the common autoregressive model AR(p) of order p. However, in the contest of this paper, relation (1) reflects opinions of stockholders which are making investment decisions based on the optimal next day predictions obtained using the past data. It means that we replace the standard assumptions of the autoregressive model by the single assumption that the relation (1) approximately represents opinions of some stockholders. In this paper, we shall compare the prediction models which minimize standard statistical prediction errors, such as MSE and MAE, with the models maximizing simulated profit. The alternative way of fitting AR(p) parameters is the likelihood maximization which provides good mathematical results [13]. However, this approach appears more difficult for stockholders intuitive understanding and the mathematical advantages are not so important regarding the AR(p) model just as a tool of the virtual stock exchange. We consider moving average model MA(q), too, to simulate more sophisticated users which try to correct past errors, where Minimizing the MA(q) errors we have to minimize a polynomial function of degree t. We can see this by expanding the recurrent expression (2). Traditional methods of parameter estimation do not consider this problem as multimodal [2]. However, some more recent authors apply global optimization techniques such as particle swarm optimization [10], evolutionary and genetic algorithms [11,3]. The investigation of multimodality was not performed in these papers, so this work can be regarded as the first step in this direction. We define the ARMA(p, q) model by merging AR(p) and MA(q) into this single expression: To represent risk-neutral users, we may apply the ARMA-ABS (p, q) model by minimizing the absolute errors instead of the squared ones.
The optimal prediction parameters a = a(b) as a function of b in the ARMA(p, q) model, are defined by this condition In the ARMA-ABS (p, q) model, we minimize absolute errors To solve non-linear optimization problem (5) we use the recursive quadratic programming [1]. The piece-wise linear problem (6) is posed in the following standard linear programming terms [9]: u s ǫ s , s = 1, . . . , t, u s 0, s = 1, . . . , t, where v, u are the auxiliary variables and ǫ s are residuals. The scale parameters a i k of the player i are defined by differences of auxiliary variables v.
Optimization of the b parameters is performed using the global optimization methods in both the models because the errors as a function of b ∈ [−1, 1] may have up to t local minima where t is the length of time series. Fig. 1 illustrates average profits of eight prediction models for two virtual 'years' equal to 720 virtual 'days'. Fig. 2 shows the average MSE of 100 samples of virtual stocks generated by USEGM.  In all the experiments, the maximal profits were provided using the maximal memory parameter p = 9. The minimal errors were achieved using lesser memory p = 3 with the only exception when minimal MAE and MSE were achieved using p = 6. This means that the prediction models which provide minimal errors do not necessarily show the maximal profit. Now we shall test the prediction algorithms by historical data is obtained automatically from the Yahoo data base. Fig. 3 shows the average MSE of 200 stocks using AR(p), p = 1, 3, 6, 9 including the corresponding results by the best Matlab version of the AR model.

Virtual stocks and historical data
The Matlab prediction errors are greater. A possible explanation is that Matlab AR model estimates an additional parameter defining the mean value of the time series. That provides lesser 'learning' error but not necessarily the minimal 'testing' error. The USEGM AR model ignores this parameter and predicts only the stock rate changes which are important making investment decisions.

Concluding remarks
While autoregressive and moving average models may be too simplistic for practical forecasting, it can serve as a useful tool for studies of market behavior by presenting an easy way for simulating different scenarios of stockholders strategies. For example, simulations can explain stock market reaction to deliberately set strategies of a major stockholder, such as manipulation of asset prices, designed to lower their value.
We have investigated the autoregressive model with 200 actual financial time series and 100 "virtual" stock rates generated by the USEGM model [5]. The unexpected, and practically the most important, result is that the prediction models which provide minimal errors do not necessarily show the maximal profit. Therefore, to estimate the expected profitability better, we have to simulate the financial markets using and improving the corresponding market models, similar to USEGM. The algorithm and software is on the website [6] and can be tested by a browser with Java support.