CHEMICAL ENGINEERING TRANSACTIONS VOL. 51, 2016 A publication of The Italian Association of Chemical Engineering Online at www.aidic.it/cet Guest Editors: Tichun Wang, Hongyang Zhang, Lei Tian Copyright © 2016, AIDIC Servizi S.r.l., ISBN 978-88-95608-43-3; ISSN 2283-9216 Stock Market Risk Measurement Method Based on Improved Genetic Algorithm Bingqiu Zhang Department of Economics and Management, Suzhou University, 49, Bianhe Mid Road, Suzhou, Anhui Province, China 58945439@qq.com In this paper, we concentrate on the problem of stock market risk measurement, which is of great importance for the healthy development of the stock market. The main innovations of this paper lie in that 1) we introduce the GARCH model in stock market risk measuring, and 2) we utilize the Value-at-Risk (VaR) as the stock market risk measure. In order to solve the volatility prediction problem, GARCH model is developed to allow for a great more flexible lag structure and VaR is defined as the loss associated with the low percentile of the return distribution. As the performance of the GARCH model highly depends on the parameter selection, we propose an improved genetic algorithm to estimate optimal parameters for the GARCH model. Finally, to test the effectiveness of the proposed GA-GARCH algorithm, we choose Shanghai composite index and Shenzhen Compositional Index to make performance evaluation. Experimental results demonstrate that proposed GA-GARCH model can effectively cover the stock market risk. 1. Introduction In recent years, the volatility of financial market is increasing, which greatly influences national economic and financial situation and affects the healthy development of financial markets (Xu et al., 2016). Particularly, with the China going to the WTO organization, China market has gradually developed toward internationalization (Hua et al., 2016). On the other hand, the international contact brings opportunities to the development of financial market, and also brings many risks and uncertainties (Jiang et al., 2016). The stock market risk is the main risk in the process of investment, and it is also the main issue which is focused by securities regulatory authorities and governments. Stock market is an emerging market, in which information disclosure, macroeconomic policy and regulatory system is not normalized (Zhou et al., 2016; Qiu et al., 2016). Furthermore, with a large margin of frequent fluctuations in the price of securities, there are many market risks. From a macro perspective, stock market risk has a great negative impact on the stability of the securities market and the healthy development of the national economy. From a micro angle analysis, stock market risk may cause investors to escape from stock market (Hsu et al., 2016; Gencer et al., 2016). Therefore, it is very important to study the risk of stock market. Therefore, governments and scholars have realized the importance and necessity of financial risk research. Meanwhile, they have also gradually concentrated on the problem of stock market risk measuring (Shim et al., 2016; Lehkonen et al., 2015; Mensi et al., 2015). Therefore, it is necessary to study on how to effectively measure stock market risk on the basis of the theory in economics and finance. In this paper, we proposed a novel method to measure the stock market risk by the GARCH model, and then optimize parameters of is calculated by the improved genetic algorithm. The performance of our proposed stock market risk measurement method is highly depends on the parameters selection. Therefore, how to obtain optimal parameters is a key problem in this paper. In recent years, as a powerful computing tool, Genetic algorithm has been widely used in many fields, such as Correlating Thermal Models (Shusser et al., 2016), Decolourization of real textile dye effluent (Prabhu et al., 2016), Topology and sizing optimization (Zhong et al., 2016), Adaptive neuro-fuzzy inference system (Khoshbin et al., 2016), Bi-objective stochastic model (Ardjmand et al., 2016), Generalized minimum spanning tree (Contreras-Bolton et al., 2016), Broadband vibration suppression (Abdeljaber et al., 2016), Assembly line balancing problem (Triki et al., 2016), Strip steel defect image with non-uniform illumination (Liu et al., 2016). DOI: 10.3303/CET1651106 Please cite this article as: Zhang B.Q., 2016, Stock market risk measurement method based on improved genetic algorithm, Chemical Engineering Transactions, 51, 631-636 DOI:10.3303/CET1651106 631 2. Measuring the stock market risk by the GARCH model The main innovations of this paper lie in two aspects, that is, 1) utilizing the GARCH model in stock market risk measuring, and 2) exploiting the Value-at-Risk (VaR) as the stock market risk measure. As is well known that volatility plays a key role in many time series based problems. Particularly, ARCH process allows the conditional variance to vary over time and prevents the errors by assuming the conditional variance constant. In general, heteroscedasticity can be regarded as time-varying variance, such as volatility. To solve the volatility prediction problem, GARCH model is proposed to allow for a great more flexible lag structure. VaR is defined as the loss associated with the low percentile of the return distribution, and VaR refers to a portfolio’s worst outcome which is expected to occur over a predetermined period and at a specific confidence level. The standard GARCH(1,1) model is described as follows. t ty μ ε= + (1) ( )20,t tNε σ (2) 2 2 2 0 1 1 1 1t t tσ α α ε β σ− −= + + (3) Where ε0=0 and σ2 0 refers to a constant. Furthermore, to guarantee the variance process σ2 t is just positive and stationary, we suppose that α0>0, α1≥0, β1>0 and α1+β1<1 are satisfied. A time series {yt} follows the GARCH(p,q) model when E{yt}=0 is satisfied, and then the following equation can be obtained: t t ty h ε= (4) 2 2 0 1 1 q q t i t i i t j i j h z zα α β− − = = = +   (5) where α0>0, αi>0, β>0 are satisfied, and {εt} denotes a sequence of independent distributed random variables. In particularly, GARCH model is described by the mean and variance equations. The univariate GARCH model is described as follows. 0 1 1t t tR α α ε ε−= + + (6) ( ) 2t tVar ε σ= (7) where Rt refers to the realized returned at time t. Rt can also be estimated by ln(Pt/Pt-1), where Pt denotes the closing price of the time t. In particular, 1-α is the confidence level, and the following equation should be satisfied. ( )( )Pr 1tR VaR α α< − = (8) Based on the above definitions, σ2 t is computed by the GARCH model, and Value-at-Risk (VaR) is calculated as follows. ( ) 1 tVaR R zαα σ− = − (9) Where means the mean return, and Zα refers to the critical value of the distribution with the tail area α. 3. Parameters estimating for the GARCH model by the improved genetic algorithm Genetic algorithm is a kind of global optimization algorithm, which does not need to carry out sensitivity analysis. Using the genetic algorithm, the optimal solution is obtained after several generations of evolution: 1) selection, 2) crossover, 3) mutation and 4) survival of the fittest. However, the main problem of the genetic algorithm is the slow convergence speed. 632 Therefore, we modify the genetic algorithm to balance the universality and effectiveness, and then to obtain a better comprehensive performance. In this paper, the improvement of genetic algorithm mainly includes the following aspects: (1) Coding Coding of the genetic algorithm uses real numbers, and n-dimensional vector is represented as individual. Individual is expressed as: X=(x1, x2,…, xn)T, in which xi∈[ai,bi], i∈[1,n] (2) Individual evaluation At this stage, the individual fitness function is established as follows: 1( , ) [ ( , ) ]F X t S tθ ε −= + (10) where ε is a small enough positive number. Then, the F value of each individual in the population is calculated, and the best and worst individuals are selected. (3) Selection To avoid the premature convergence and stagnation, the selection strategy of genetic algorithm is improved. Assume that the members of the population are arranged in accordance with the size of the F value (X1, X2,…, Xn). Afterwards, the probability of choice is calculated as follows. (4) Crossover In order to maintain the diversity of population and prevent the convergence speed too fast, we modify the crossover process of the genetic algorithm. Suppose that P(X)>Pc, and Pc refers to crossover probability. We choose two parent individuals Pa[1] and Pa[2], and their child individual are represented as Ch[1] and Ch[2] respectively. Random numbers a1, a2,…, an are generated in advance, and the following conditions should be satisfied: [1] [ ] [1] [ ] (1 ) [2] [ ]j jCh chrom j a Pa chrom j a Pa chrom j⋅ = ⋅ ⋅ + − ⋅ ⋅ (11) [2] [ ] [2] [ ] (1 ) [1] [ ]j jCh chrom j a Pa chrom j a Pa chrom j⋅ = ⋅ ⋅ + − ⋅ ⋅ (12) Where j∈[1,n]. (5) Mutation For individual Pa[j] which are less than the probability of mutation, we randomly select one of the genes for mutation: [ ] [ ] [ ] [ ]Ch i chrom j Pa i chrom j τ⋅ = ⋅ + (13) Where τ=⋅N(0,1). N(0,1) follows the standard normal distribution, where λ is a constant and n is the number of iterations. (6) End condition of the algorithm When the evolutionary algebra reaches the maximum limit or satisfies the following conditions, the algorithm ends: ( , ) ( , )S t S t mθ θ μ− + ≤ (14) where μ is the threshold and it is positive, moreover, m refers to the evolution times. In particular, in this paper, we utilize the above improved genetic algorithm to estimate parameters of the GARCH model. 4. Experiment To test the performance of our proposed algorithm, we choose 1) Shanghai composite index (denoted as SSE index), and 2) Shenzhen Compositional Index (denoted as SZSE index) to make performance evaluation. The SSE Composite Index refers to a stock market index of all stocks (including A shares and B shares) that are traded at the Shanghai Stock Exchange. SSE Indices are all computed utilizing a Paasche weighted composite price index formula. That is to say the index is designed based on a base period on a given base day for its computation. On the other hand, the SZSE Component Index means an index of 40 stocks which are traded at the Shenzhen Stock Exchange. We collect the data of SSE index and SZSE index in the past 633 one years to construct two datasets (named as Dataset I and Dataset II respectively), and the experimental results are given as follows. (1) Dataset I By multiple experimental tests, we set the number of population number as 100, the crossover probability CP is set to 0.6147, mutation probability is set to be 0.0115, and the value of individual is belonged to [ ]0, 0.07 . Exploiting the genetic algorithm, parameters are estimated as follows. ( )2 2 21 1 0.00015 1.32 05 0.1884 0.7584 t t t t t r E ε σ ε σ− − = − + = − + + (15) (2) Dataset II For Dataset II, we set the number of population number as 90, the crossover probability CP is set to 0.6874, mutation probability is set to be 0.011725, and the value of individual is belonged to [ ]0, 0.08 . Using the genetic algorithm, parameters are estimated as follows. ( )2 2 21 1 0.00028 5.8746 06 0.10853 0.86582 t t t t t r E ε σ ε σ− − = − + = − + + (16) As is well known that only the negative volatility may bring trading risks to investors. Integrating Figure1 and Figure 2 together, it can be observed that our proposed GA-GARCH model can effectively cover the stock market risk using the VaR value as risk measurement metric. Figure 1: Stock market risk measurement results for SSE Component Index 0 50 100 150 200 250 300 350 400 -0.15 -0.1 -0.05 0 0.05 0.1 Day R is k va lu e Real volatility GA-GARCH model 634 Figure 2: Stock market risk measurement results for SZSE Component Index 5. Conclusion This paper aims to effectively measure stock market risk to maintain the healthy development of the stock market. We introduce the GARCH model in stock market risk measuring, and then use the Value-at-Risk (VaR) as the stock market risk measure. To promote the quality of parameter selection for the GARCH model, we propose an improved genetic algorithm to estimate optimal parameters. Experimental results proved that our proposed GA-GARCH model is able to measure stock market risk with high accuracy. Acknowledgment This work is supported by Key Program for The Excellent Youth Foundation of Higher Education of Anhui Province (Empirical Research on Evaluation Index System of the National Equities Exchange and Quotations Market Companies Building No. 2013SQRW078ZD), and Teaching Research Project of Suzhou University (Research on the Practical Teaching of Finance in the Application of the University in the Background of the Industry University Research Cooperative Education No. szxyjyxm201335). References Abdeljaber O., Avci O., Inman D.J., 2016,Optimization of chiral lattice based metastructures for broadband vibration suppression using genetic algorithms, Journal of Sound and Vibration, 369: 50-62. doi:10.1016/j.jsv.2015.11.048. Ardjmand E., Young W.A., II, Weckman G.R., Bajgiran O.S., Aminipour B., Park N., 2016, Applying genetic algorithm to a new bi-objective stochastic model for transportation, location, and allocation of hazardous materials, Expert Systems with Applications, 51: 49-58. Contreras B.C., Gatica G., Barra C.R., Parada V., 2016, A multi-operator genetic algorithm for the generalized minimum spanning tree problem, Expert Systems with Applications, 50: 1-8. doi:10.1016/j.eswa.2015.12.014. Gencer H.G., Demiralay S., 2016, Volatility Modeling and Value-at-Risk (VaR) Forecasting of Emerging Stock Markets in the Presence of Long Memory, Asymmetry, and Skewed Heavy Tails, Emerging Markets Finance and Trade, 52(3): 639-657. Hsu C.C., Krause A., 2016, The Optimal Timing of Open Market Stock Repurchases, Emerging Markets Finance And Trade, 52(4): 776-785. Hua J.C., Roy S., McCauley J.L., Gunaratne G.H., 2016, Using dynamic mode decomposition to extract cyclic behavior in the stock market, Physica A-statistical Mechanics and Its Applications, 448: 172-180. doi:10.1016/j.physa.2015.12.059. 0 50 100 150 200 250 300 350 400 -0.15 -0.1 -0.05 0 0.05 0.1 Day R is k va lu e Real volatility GA-GARCH model 635 Jiang J.Q., Gu R.B., 2016, Using Renyi parameter to improve the predictive power of singular value decomposition entropy on stock market, Physica A-statistical Mechanics and Its Applications, 448: 254- 264. doi:10.1016/j.physa.2015.12.070. Khoshbin F., Bonakdari H., Talesh S.H.A. Ebtehaj I., Zaji A.H., Azimi H., 2016, Adaptive neuro-fuzzy inference system multi-objective optimization using the genetic algorithm/singular value decomposition method for modelling the discharge coefficient in rectangular sharp-crested side weirs, Engineering Optimization, 48(6): 933-948. Lehkonen H., Heimonen K, 2015, Democracy, political risks and stock market performance, Journal Of International Money And Finance, 59: 77-99. doi:10.1016/j.jimonfin.2015.06.002. Liu M.F., Liu Y., Hu H.J., Nie L.Q., 2016, Genetic algorithm and mathematical morphology based binarization method for strip steel defect image with non-uniform illumination, Journal of Visual Communication and Image Representation, 37: 70-77. doi:10.1016/j.jvcir.2015.04.005. Mensi W., Hammoudeh S., Kang S.H., 2015, Precious metals, cereal, oil and stock market linkages and portfolio risk management: Evidence from Saudi Arabia, Economic Modelling, 51: 340- 358. doi:10.1016/j.econmod.2015.08.005. Prabhu M.V., Karthikeyan R., Shanmugaprakash M., 2016, Modeling and optimization by response surface methodology and neural network-genetic algorithm for decolorization of real textile dye effluent using Pleurotus ostreatus: a comparison study, Desalination and Water Treatment, 57(28): 13005-13019. Qiu M.Y., Song Y., Akagi F., 2016, Application of artificial neural network for the prediction of stock market returns: The case of the Japanese stock market, Chaos Solitons & Fractals, 85: 1-7. doi:10.1016/j.chaos.2016.01.004. Shim J.B., Lee E.J., Lee S.H., 2016, A new test procedure for the choice of dependence structure in risk measurement: application to the US and UK stock market indices, Applied Economics, 48(15): 1382-1389. Shusser M., 2016, Using a Double Genetic Algorithm for Correlating Thermal Models, Heat Transfer Engineering, 37(10): 889-899. Triki H., Mellouli A., Hachicha W., Masmoudi F., 2016, A hybrid genetic algorithm approach for solving an extension of assembly line balancing problem, 29(5): 504-519. Xu M.J., Shang P.J., Huang J.J., 2016, Modified generalized sample entropy and surrogate data analysis for stock markets, Communications in Nonlinear Science and Numerical Simulation, 35: 17-24. doi:10.1016/j.cnsns.2015.10.023. Zhong W., Su R.Y., Gui L.J., Fan Z.J., Topology and sizing optimization of discrete structures using a cooperative coevolutionary genetic algorithm with independent ground structures, Engineering Optimization, 2016, 48(6): 911-932. Zhou X.R., Chang M.S., Gibler K., The asymmetric wealth effects of housing market and stock market on consumption in China, Journal of the Asia Pacific Economy, 2016, 21(2): 196-216. 636