The Forecasting Efficiency of Monthly Stock Indices between Macroeconomic Factors and Technical Indicators by Using Augmented Genetic Algorithm and Artificial Neural Network Model

The purpose of this study is to compare the forecasting efficiency of stock indices between macroeconomics and technical analysis by using augmented Genetic Algorithm and Artificial Neural Network model. Monthly data of Taiwan stock index, electronic index, and financial index, from Jan. 2001 to Dec. 2019 are collected. Eight influential macroeconomic factors and seven commonly watched technical indicators are used as determinants. Three models are adopted for comparison. The models include the ARMA(p, q) model as the benchmark, GA_ANN with macroeconomic factors, and GA_ANN with technical indicators. The sliding window method with 24-, 30-, 36-, 42- and 48-month training base periods is simulated. Linear unit root tests of ADF, PP, and KPSS, and nonlinear unit root test of KSS are ex-amined. Internal validity index of hit ratio and external validity indices of MAPE, HR, ARV and Theil U coefficients are compared. The empirical findings are summarized as follows. 1) The overall forecasting performance between MACRO and TECH models shows little difference. The electronic and financial stock indices have the out-of-sample hit ratios of 77.78% and 68.89%, respectively. Thus, these two stock indices may be suitable for making meaningful investment decisions. 2) The best training base observed from the market stock index is between 30 to 48 months. The best base observed from the electronic stock index is between 42 to 48 months. The best base observed from the financial stock index is between 42 to 48 months. Thus, the training base from 42 to 48 months exhibits better forecasting to 0.99 and may not be a constant parameter.


Introduction
Stock index forecasting has been empirically investigated over the past decades. The importance of stock index forecasting in making speculation, hedge, and arbitrage investment decisions is addressed by many practitioners, financial engineers, and academic researchers. Due to the stochastic and much like a random walk phenomenon nature of stock index movement, the task of making efficient forecast is challenging and requires innovative thinking in investment theory, model settings, and variable selection.
On the other hand, dramatic development in statistical and heuristic computing algorithms such as genetic algorithm (GA) and artificial neural networks (ANN) have been seen in the past decades. The improvement of mathematical optimization capability for handling complicated, dynamic, and nonlinear functional forms with multivariate dataset could help researchers enhance the construction data classification, financial forecasting, and risk management models.
The genetic algorithm (GA) uses the biological evolutionary rule for finding optimal number of variables and weighting schemes. Specifically, the optimal final outcomes can be found by using reproduction, crossover, and mutation procedure with a fitness function and a certain amount of iterative generations. Past literatures have disclosed the application of the GA techniques for forecasting stock price (Armano, Marchesi, & Murru, 2005;Kim & Han, 2000;Kai & Wenhua, 1997). The artificial neural networks (ANN) imitate the bio-neural processing system with hidden layers and hidden units for finding better solutions. Specifically, the ANN model can be used in making a forecasting model by searching optimal hidden layers, hidden units, transformation, and learning coefficient. Past literatures have disclosed the application of the ANN techniques for forecasting stock price (Nayak, Misra & Behera, 2017;Kwon & Moon, 2007;Chen, Leung, & Daouk, 2003).
According to past literatures, past researches had focused on many issues regarding stock index forecasting. However, this study intends to re-examine some issues which may not have been addressed in the past studies. First, the GA and ANN models are integrated in such a way that allows GA method to randomly select proper sets of variables through crossover and mutation, the ANN methodology is applied in each simulation to find optimal simulated parameters, and a forecast for one-period ahead stock index is made. Second, randomly selected transforming and learning rates in both hidden layers and final outcome stages are simulated. Third, the stock index forecasting efficiency between macroeconomic factors and technical indicators are compared. Fourthly, the focus is placed on the monthly stock index rather than the daily stock index.
The rest of the paper is organized as follows: Section 2 discusses data and methodology; Section 3 provides the empirical results; and Section 4 summarizes the discussion and concludes the paper.

Linear and Nonlinear Unit Root Tests
Financial time series often exhibit trending behavior or non-stationarity in the mean. The study conducts the linear unit root tests of the three stock index series by applying the augmented Dickey-Fuller (ADF) test (Dickey & Fuller, 1979;Dickey and Fuller, 1981), the Phillips-Perron (PP) test (Phillips & Perron, 1988), the Kwiatkowski-Phillips-Schmidt-Shin (KPSS) test (Kwiatkowski, Phillips, Schmidt, & Shin, 1992), as well as the nonlinear Kapetanios-Shin-Snell (KSS) test (Kapetanios, Shin, & Snell, 2003). The ADF test's regression includes lags of the first differences of Y t , and the corresponding three models are expressed in the following equations: where t is the time index, α is an intercept constant called a drift, λ is the coefficient on a time trend, φ is the coefficient presenting the process root, i.e., the focus of testing, k is the lag order of the first-differences autoregressive process, and t ε is an independent identically distributed residual term.
Model (1) is a pure random walk with the lag terms. Model (2) possesses a drift. Model (3) includes a drift and a time trend. The null hypothesis for the ADF test is: The PP test differs from the ADF test mainly in how PP test deals with serial correlation and heteroscedasticity in the error term. The PP test does not require the specification of the form of the serial correlation of t Y ∆ under the null, nor the errors t ε be conditionally homoscedastic. The ADF and PP unit root tests are for the null hypothesis that a time series t Y is integrated of order one, I(1).
On the other hand, the KPSS unit root test is for the null that t Y is integrated of order zero, I(0). In addition, the KSS test is applied since the above linear unit root tests may suffer from important power distortions in the presence of nonlinearities in the data generating process.

The ARMA(p, q) Model as the Benchmark
In this study, the ARMA(p, q) model is used as the benchmark model. The stationarity of the returns series is checked using the unit root tests. The estimation of the ARMA models for three stock index returns includes the checking of appropriate ARMA(p, q) orders, the sliding window of the training sample, and one-month ahead forecasting.

Development of Augmented GA_ANN (AGA_ANN) Model
The traditional genetic algorithm estimation procedure includes Initialization, reproduction, genetic operations (including crossover and mutation), heuristics, and termination. As shown in Figure 1, the ANN model consists of three stages, i.e. input, hidden layer, and output. The components of ANN includes neurons, connections and weights, propagation function, ANN parameters (including learning rate, the number of hidden layers and batch size), weights adjustment, backpropagation, and self-learning.
The rationale of the newly proposed augmented GA_ANN (namely, AGA_ANN) model is to adopt the advantages of GA and ANN so as to improve the forecasting accuracy. The transformation functions from the input node, the hidden layer node, to the output node are as follows: (the λ h and λ o are transformation parameters.) where j H is the j th hidden unit; Ŷ is the forecasted output; i X is the input variable. ji W is the weight of input variable; j W is the weight of hidden unit. The detailed AGA_ANN estimation procedure is as follows:

1) Variables transformation a) Dependent variables
To improve simulated performance, the three stock index returns series are transformed by using the following logistic function. The transformed series (Y 1 ) is then converted into 0 or 1 series (Y).
Y is one when Y 1 is greater than or equal to 0.5; otherwise Y is zero.
b) Independent variables The independent variables are standardized with mean equal to zero and standard deviation equal to one. The transformed series is then logisticalized to within zero and one.
2) The sliding window span parameters In this study, the sliding window spans are simulated by 24-, 30-, 36-, 42-, and 48-months as the training base. The base data is then used for simulating the AGA_ANN model. The best simulated parameters are then adopted for making the one-month ahead forecast. Then the sliding window moves one period ahead and performs next AGA_ANN model until the end of observations.
3) The initialization of W ji and W lj parameters The coefficient weights of W ji and W lj are randomly and uniformly simulated having values within zero and one.
4) The selection of simulated IV and hidden units In this study, the number of simulated independent variables (M) ranges from 6 to NVAR/2. The NVAR is the total number of predetermined variables. For each simulation, 100 sets of random selection are made. The number of hidden units (J) ranges from M/2 to M.
5) The GA procedure By using the core ANN estimation, the hit ratios of the 100 sets are ranked. The top 10 sets are kept. The variables in the middle 80 sets are switched according to crossover method. The worst 10 sets are wiped off and additional new 10 sets are created. Thus, the newly created 100 sets are used for the next run.
6) The randomization of transformation and learning parameters In this study, the transformation and learning Parameters are uniformly simulated from 0.5 to 1.0. For each simulation, 10 sets of random selection are made.
7) The one-month ahead forecast For each simulation, the best simulated parameters are used to make a one-month ahead forecast until the end of observation. 8

Descriptive Statistics
The descriptive statistics is shown in

The Results of Linear and Nonlinear Unit Root Tests
A nonstationary time series might lead to spurious regression. Linear unit root tests of the ADF, PP, and KPSS, and nonlinear KSS unit root tests are conducted for the MKT, ELEC, and FINA returns. Tables 2-4 show the results and conclude that all three series are stationary statistically. Notice that an insignificant t value of KPSS test verifies the series is stationary.

The Simulated Parameters of the Three Models
Using the SAS-IML and FARMAFIT functional call, the estimation and sliding window simulation of ARMA(p, q) model reveals that AR(p) = 3 and MA(q) = 2 throughout entire simulation process. In Table 5, the simulated parameters of the technical indicators (TECH) and macroeconomic factors (MACRO) shows that the total number of forecasted   Note: *, **, and *** denote significance at the 10%, 5%, and 1% levels, respectively. Note: *, **, and *** denote significance at the 10%, 5%, and 1% levels, respectively.

The Performance Comparison of the Three Models
In Table 6 and Table 7, the results of the forecasting performances of the three proposed models are as follows: 1) The TECH model has the best overall MAPE. The MACRO model has the best overall HR and ARV. The ARMA model has the best THEIL's U.
2) In terms of the market stock index, the ARMA model has the best MAPE. The MACRO model has the best HR. The TECH model has the best ARV and THEIL_U.
3) In terms of the electronic stock index, the TECH model has the best MAPE and HR. The MACRO model has the best ARV. The ARMA model has the best THEIL_U. 4) In terms of the financial stock index, the MACRO model has the best MAPE and HR. The TECH model has the best ARV. The ARMA model has the best THEIL_U. 5) In terms of the training base in MAPE and HR, the best base observed from the market stock index shows is between 30 to 48 months. The best base observed from the electronic stock index is between 42 to 48 months. The best base observed from the financial stock index is between 42 to 48 months. Thus, the training base from 42 to 48 months exhibits better forecasting performance.
In sum, previous study shows that daily stock index forecast is quite satisfactory. However, the monthly stock index forecasts tell the story otherwise, which indicates monthly data forecast might be even more difficult than that of daily data. The overall forecasting performance between TECH and MACRO models show little difference. The electronic and financial stock indices have the out-of-sample hit ratios of 77.78% and 68.89%, respectively. Thus, these two stock indices might be suitable for making meaningful investment decisions.

Conclusion and Discussion
The study attempted to compare the forecasting efficiency of Stock Indices between macroeconomic factors and technical indicators by using augmented GA and ANN Models. Three models are proposed including the ARMA model as the benchmark, GA_ANN with macroeconomic factors (MACRO), and GA_ANN with technical indicators (TECH). The empirical findings are summarized as follows: 1) The overall forecasting performance between MACRO and TECH models shows little difference. The electronic and financial stock indices have the out-of-sample hit ratios of 77.78% and 68.89%, respectively. Thus, these two stock indices may be suitable for making meaningful investment decisions.
2) The best training base observed from the market stock index is between 30 to 48 months. The best base observed from the electronic stock index is between 42 to 48 months. The best base observed from the financial stock index is between 42 to 48 months. Thus, the training base from 42 to 48 months exhibits better forecasting performance.
3) The optimal transformation parameters under ANN may range from 0.50 to 0.99 and may not be a constant parameter.
Due to the complexity of the augmented GA_ANN model, tremendous computing time and efforts are involved. The study found that monthly stock index forecasts may be more challenging than daily data. Further theoretical and empirical works are needed. Specifically, previous researches have adopted many different types of models, variables, and data frequency. All aspects require extensive and prudent investigations.