<<

9th WSEAS Int. Conf. on & COMPUTERS IN BUSINESS AND ECONOMICS (MCBE '08), Bucharest, Romania, June 24-26, 2008 The role of of financial series in emerging market applications

GABRIELA PRELIPCEAN*, NICOLAE POPOVICIU,** MIRCEA BOSCOIANU* *Faculty of Economic and Public Administration Stefan cel Mare University of Suceava University Street, No. 13, Suceava – 720229, Romania

**Faculty of Mathematics-Informatics Hyperion University of Bucharest Bucharest, Romania,

Abstract: A new metric that quantifies the predictability of financial series based on a mixture between Kaboudan η –metric and Genetic Programming (GP)/ Artificial Neural Networks (ANN) is proposed. The new metrics overcomes the stationary problem and shows how the predictability changes over different subsequences in financial . The focus is to develop quantitative metrics that characterize time series according to their ability to be modeled by a particular method, such as the predictability of a time series using the GP approach or an ANN.

Keywords: quantitative metrics, predictability, timing detection, portfolio selection, Genetic Programming (GP), Artificial Neural Networks (ANN).

1. Introduction in the predictability of since the made on these time series are financial time series on more accurate. New time series predictability metric for use with Time series predictability is a measure of how well nonlinear time series modeling techniques is values y can be forecasted and indicates to t presented. The use of this new metric in what extent the past can be used to determine the conjunction with a time series modeling method in future. In real world, time series are represented by financial modeling applications will show a mixture between deterministic and significant performance improvement in components. Predictability can be viewed as the comparison to using the time series modeling strength of the deterministic component and method alone. can be estimated by using modeling methods.

Measuring the predictability tell whether a time

series can be predicted under a particular model. Time series builds models that describe the 2. Basic unified view of soft underlying that generates a time series: computing concepts applications in ARIMA, Box-Jenkins time series analysis, artificial financial series neural networks (ANN), genetic programming Kosaka (1991) demonstrated the effectiveness of (GP). The focus is to develop quantitative metrics applying FL/ NNs to buy/sell timing detection and that characterize time series according to their portfolio selection. Wilson (1994) proposed a fully ability to be modeled by a particular method, such automatic stock trading system based on a five step as the predictability of a time series using the GP procedure. Frick (1996) investigated price-based and ANN approaches. heuristic trading rules by using a heuristic charting Emerging stock exchange applications (portfolio/ method with buy/ sell based on price winners selection, investment timing) provides changes and reversals. Based on a binary good examples for the use of this time series representation of those charts, they used GAs to predictability metric. The objective is to identify generate trade strategies from the classification of stocks that are more predictable for a given different price formations. Kassicieh (1997) modeling method by evaluating the predictability examined the performance of GAs in formulating value for each member of a set of financial time market-timing trading rules. The goal was to series, and them according to their develop a strategy for deciding whether to be fully predictability value. Trading on higher ranked invested in a stock portfolio, or a riskless (higher predictability value) financial time series is investment. Inspired from Bauer (1994), their expected to have better return/risk performance

ISBN: 978-960-6766-76-3 203 ISSN 1790-5109 9th WSEAS Int. Conf. on MATHEMATICS & COMPUTERS IN BUSINESS AND ECONOMICS (MCBE '08), Bucharest, Romania, June 24-26, 2008 inputs were differenced time series of 10 economic dependent. According to the No Free Lunch (NFL) indicators and the GA used the best three of these theorems [6], there is no search algorithm that can series to make the timing/ switching decision. outperform all other search algorithms over all Allen, Karjalainen (1999) used a GA to learn possible search problems. Kaboudan reported that technical trading rules for an index. The rules were genetic programming (GP) showed an equivalent or able to identify periods to be in the index when better performance in predicting stock price time daily returns were positive and volatility was low series than other methods. Artificial neural and out of the index when the reverse was true, but networks (ANN) are also recognized to be effective these latter results could largely be explained by in the problem of financial market [7]. low-order serial correlation in stock index returns. By design, the computed metric should approach Fernandez, Rodriguez (1999) investigated the zero for a complex signal that is badly distorted by profitability of a simple technical trading rule . Alternatively, the computed metric should based on NNs. In the absence of trading costs, the approach one for a time series with low technical trading rule is always superior to a buy- and strongly deterministic signal. Kaboudan's η- and-hold strategy for both "bear" and "stable" metric measures the level of GP-predictability of a markets but that the reverse holds during a "bull" time series. market. Baba (2000) integrated NNs and GAs in an The goal is to investigate new time series intelligent decision support system (IDSS) capable predictability metrics with better behavior than to optimize decisions and based on the average Kaboudan's, which represents an original projected value and the then-current value. contribution in the field of time series analysis and Lowe (1994) demonstrated the of the mining. This provides an explicit measure of use of NNs in effective portfolio optimization and time series predictability. short-term of multiple equities. Wendt (1995) builded a portfolio efficient frontier by using 3.1. Autoregressive Integrated Moving GA technique. Guo, Huang (1996) proposed a Average (ARIMA) method for optimizing asset allocation by using The ARIMA model of order (p, P, q, Q), Zimmermann's fuzzy programming method. φ B φ B L z = δ + θ B L a , is limited by Jackson (1997) applied a GA to the problem of p ( ) P ( ) t Q ( ) t asset allocation, first using the traditional the requirement of stationarity; additionally, the approach and then using a direct utility residuals, the differences between the time series maximization method for a step utility . He and the ARIMA model, are independent and compared the performance of GAs with the normally distributed. classical method of optimization and demonstrated the robustness to discontinuities in the search 3.2 Genetic Programming space, and sensitive to the starting values. Genetic algorithms (GA) adapt concepts Fogel [3] added noise to data generated by the (reproduction, recombination, mutation, survival of and the logistic system. Using GP the fittest, and populations) from evolutionary and Akaike's information criterion (AIC) [9], it was biology to fields of , optimization, and demonstrated that signals with no noise are more . Such algorithms evolve predictable (measured by average prediction error) populations of candidate solutions to a problem than noisy ones. Their results suggest the potential with the goal of finding near optimal candidates. for evolving models of chaotic data, even in Koza [8] extended this genetic approach and background noise. Evolutionary programming can introduced the concept of genetic programming be used to optimize parameter estimates associated (GP). Each candidate solution in the search space is with models of chaotic time series in light of represented by a genetic program. Genetic observed data. Kaboudan [4] applied GP to programming is now widely recognized as an estimate the predictability of stock price time series. effective search paradigm in artificial intelligence, He tried to find the best-fit model for a time series databases, classification, robotics and many other using GP by minimizing the sum of squared error areas. (SSE). His predictability metric was defined based The major difference between GP and GA is that on comparing the SSE between the original time genetic program structures are not encoded as series and its reshuffled version. linear genomes, but as terms/ simple symbolic expressions. The units being mutated and recombined do not consist of characters or 3. Time series analysis, command but of functional modules, and time series predictability which can be represented as tree-structured chromosomes. The advantages of GP include its Time series modeling selection may be application ability to evolve arbitrarily complex equations

ISBN: 978-960-6766-76-3 204 ISSN 1790-5109 9th WSEAS Int. Conf. on MATHEMATICS & COMPUTERS IN BUSINESS AND ECONOMICS (MCBE '08), Bucharest, Romania, June 24-26, 2008 without requiring a model with an a priori structure, terms of the objective function, f ()xi . and the flexibility in selecting the terminal set and 3. Mutate each parent x ,η to create a single function set to fit different kind of problems. ()i i ' ' The flowchart of a basic evolutionary algorithm is offspring (xi ,ηi ) by presented in Fig.1. ' xi ( j) = xi ( j)+ηi ( j)(C 0,1 )

Generation of initial solutions ' ηi ()j = ηi ()j exp[]τ' N ()0,1 +τN j ()0,1 4. Calculate the fitness of each offspring. Evaluation 5. Comparison over the union of parents and Generation of offspring variants by 6. Select the µ individuals that have the most wins Selection mutation and to be parents of the next generation. crossover 7. Stop if the halting criterion is satisfied; Selection otherwise, increment the generation number and sufficiently go to Step 3. good? The Reduced Parameter Bilinear Model (RPBL) [13] is defined as: Yes φ p (B)zt = θ q (B)()at + [ξ m B zt ][]ζ k ()B at where End {zt} is the of time series observations, The tree structure is the most frequently used {at} is a sequence of independent random representation in GP. The nodes of the tree are variables having a N(0,1) distribution. selected from the function set while the leaves are The identification procedure consists of from the terminal set. Each GP tree represents a determining the orders p, q, m and k of the model single individual (genotype) in the population. and estimating the corresponding parameters. The Crossover: combines the genetic material of two model order is determined as the order that parents by swapping a part of one parent with a part minimizes the Minimum Description Length of the other. (MDL) criterion. Mutation: select a point in the tree randomly and replaces the existing subtree at that point with a 3.4. Time Series Data Mining (TSDM) new randomly generated subtree. Method Selection: decide whether to apply genetic TSDM is focused on characterizing and predicting operators to a particular individual and whether to events, and therefore overcome the limitations of keep it in the population or allow it to be replaced, requiring stationarity of the time series and based on the fitness of that individual. normality and independence of the residuals. Fitness is the measure used by GP during An event is defined as an important occurrence in simulated evolution of how well an individual time. The associated event characterization function program has learned to predict the output from the g(t), represents the value of future "eventness" for input. the current time index. Defined as a vector of length Q or equivalently as a point in a Q-dimensional 3.3. Fast Evolutionary Programming (FEP) space, a temporal pattern is a hidden structure in a and Reduced Parameter Bilinear (RPBL) time series that is characteristic and predictive of Rao, Chellapilla [10], [12] proposed an alternative events. The objective function represents a value of modeling approach called fast evolutionary fitness of a temporal pattern cluster or a collection of programming (FEP) to optimize the parameters of a temporal pattern clusters. Finding optimal temporal reduced parameter bilinear model (RPBL). The pattern clusters that characterize and predict events RPBL approach [13] is capable of effectively is the key of the TSDM framework. modeling nonlinear time series with fewer parameters than a conventional bilinear model. FEP a)Time Series Data Mining Method evolves RPBL models with lower normalized mean The first step in applying the TSDM method is to squared error (NMSE) and also lower model order find hidden temporal patterns that are characteristic than evolved with conventional evolutionary of events in the time series. The steps in TSDM are: programming. FEP is implemented using an I. Training Stage: frame the TSDM goal in terms of ()μ + λ evolution strategy. the event characterization function, objective function, and optimization formulation; determine 1. Generate the initial population of μ randomly the dimension of the and the length of selected individuals the temporal pattern; transform the observed time 2. Evaluate the error score for each individual, in series into the phase space using the time-delayed

ISBN: 978-960-6766-76-3 205 ISSN 1790-5109 9th WSEAS Int. Conf. on MATHEMATICS & COMPUTERS IN BUSINESS AND ECONOMICS (MCBE '08), Bucharest, Romania, June 24-26, 2008 embedding process; associate with each time index generated, which are the local predictability in the phase space an eventness represented by the estimations of the subsequences of the time series. event characterization function and form the Q Generally, η s is defined as the Η-metric over the augmented phase space; search the optimal sample temporal pattern cluster; evaluate training stage results and repeat training stage as necessary; {yt ,t = s − Q + 1,s − Q + 2,…,s − 1,s}. II. Testing Stage: embed the testing time series into Thus, the η -series is represented by the phase space; use the optimal temporal pattern Q Q Q Q {ηQ ,ηQ+τ ,ηQ+2τ ,…,ηQ+mτ ,…}. cluster for predicting events; evaluate testing stage Since all the η's are estimated over same sample results. size Q, they are comparable, and by selecting

appropriate values of window length Q, they can be b)Optimization Method – The adapted made to distributed in a reasonable . Genetic Algorithm include an initial random search and 4.2. An innovative mixture between η- hashing of fitness values. The creation of an elite population is followed by specific processes metric and GP/ FEP (selection, crossover, mutation, reinsertion). GP and FEP approaches are considered for use as Initializing the GA with the results of a Monte modeling methods. GP has a better search ability Carlo search has been found to help the than FEP, especially when dealing with more optimization's rate of convergence. predictable time series but FEP performs better when applied to noisier time series. For real world 3.5. Classic time series predictability metrics time series such as sunspot series and stock price series, its accuracy performance is similar to GP, ( η-metric) but with much less computational effort. Kaboudan η -metric measures the probability that The forecasting model is a regressive expression a time series is GP-predictable. By design, the that takes the past values in a time series as the computed metric should approach zero for a input and future values as the output. For example, complex signal that is badly distorted by noise. Kaboudan concluded that stock prices pt are mostly Alternatively, the computed metric should explained by ten variables: approach one for a time series with low complexity p , p , p ,hp ,hp ,lp ,lp , and strongly deterministic signal. This metric is t−1 t−2 t−3 t−1 t−2 t−1 t−2 based on comparing two outcomes: the best fit volt−1 ,djit−1 ,djit−2 model generated from a single before where p is the daily close price, hp and lp are the shuffling with the best fit model from the same set daily highest and lowest stock prices, respectively, after shuffling. The shuffling process is done by vol is the daily traded volume of that stock, dji is randomly re-sequencing an observed data set using BET index and t is the time index. Efron's bootstrap method. Following this suggestion, these ten variables are used for GP to evolve the forecasting model using 1-step predicting shown in the following equation. p = f (p , p , p ,hp ,hp ,lp ,lp , 4. A new methodology based on η- t t−1 t−2 t−3 t−1 t−2 t−1 t−2 metric based on GP and FEP volt−1 ,djit−1 ,djit−2 ) The main problems with Kaboudan's η-metric: the GP searches for an optimal function f that gives value of the metric largely depends on the length of the minimum prediction error over the training the time series; for long-term series, the value of data. the η -metric is distributed in a very narrow range and the resolution of the metric is limited. 4.3. The use of Artificial Neural Network (ANN) in η-metric 4.1. New η-metric The same inputs and output are used in the ANN For a long-term time series model as in the GP model:

Y = {}y ,t = 1,2,…,N , pt = NN(pt−1 , pt−2 , pt−3 ,hpt−1 ,hpt−2 ,lpt−1 , t . the η -metric is calculated on the first Q points, that lpt−2 ,volt−1 ,djit−1 ,djit−2 ) is, a sample series The function NN represents the neural network

{}yt ,t = 1,2,…,Q . system. It takes 10 ten past variables as the inputs Then, the sample series is shifted by τ, and the η- and gives one single output as the prediction. The metric is calculated again on the new sample feed-forward BP NN is created by using the {}y ,t = 1 +τ ,2 +τ ,…,Q +τ . MATLAB functions. t Continuing this process, a series of η 's is

ISBN: 978-960-6766-76-3 206 ISSN 1790-5109 9th WSEAS Int. Conf. on MATHEMATICS & COMPUTERS IN BUSINESS AND ECONOMICS (MCBE '08), Bucharest, Romania, June 24-26, 2008 5. Applications in investment timing The first time series considered is generated by the in emerging markets discretized Mackey-Glass equation: bx(t −τ ) Three different modeling methods, GP, ANN, and x()()t + 1 = x t + − ax()t time series data mining (TSDM) are used to test the 1 + x c ()t −τ effectiveness of the new metric. Kaboudan [4] proposed the following ten variable b) The Sunspot Time Series to explain stock prices pt dynamics: In modeling the sunspot time series, the accuracy p , p , p ,hp ,hp ,lp , t−1 t−2 t−3 t−1 t−2 t−1 performance between the two methods is similar. lpt−2 ,volt−1 ,djit−1 ,djit−2 The GP gives slightly better accuracy, but again, it which can be used for GP to evolve the forecasting takes three as long to compute as the FEP model: method.

pt = f (pt−1 , pt−2 , pt−3 ,hpt−1 ,hpt−2 ,lpt−1 , c) Stock Prices Time Series lp ,vol ,dji ,dji ) t−2 t−1 t−1 t−2 The results from two arbitrarily selected stock time The training period to predict the next day's price is series are similar to the sunspot results. The two 50 days and the window size Q = 20 : methods give similar error in both training and 20 20 20 20 {η 20 ,η21 ,η 22 ,…,η n ,…}. testing, but the GP is more time consuming. It was The metric is defined as noticed that the results generated by FEP in each 20 20 20 20 trial are consistent, but this is not the case for GP. η = η +η +η +η / 4 . n ( n n−10 n−20 n−30 ) There are larger in both GP's MSE and The behavior of the η-metric is obtained by time. One interesting observation in the comparing the performances of different trading is that as the generations increases, the strategies: buy and hold, trading based on the models evolved by FEP tend to become simpler prediction of GP only, and trading based on both while those evolved by GP always become more the GP prediction and the predictability metric complex (measured by the total number of nodes in (GP/η). The third strategy (GP/η) trades on those the GP tree). This explains why GP is not as days in which the stock has a high predictability consistent as FEP. As the GP runs the learned which a high confidence in the accuracy of model becomes more complex. This means that the prediction; therefore only trading on these days more of the solution space is being explored. Note can potentially reduce the risk and improve the the space of functions explored by the GP is much return. (GP/η) has fewer trades than the second one larger than the function space searched by the FEP. and gives a much lower variance (the risk is lower). Thus as the GP runs it will encounter more local The idea of the new timing strategy is to look at the minimum in each generation. In the experiments, market portfolio. Many stocks may have low the best solution is always found by GP. This also predictabilities, but there is a good chance that suggests that GPs have relatively stronger search several stocks with fairly high predictabilities can ability. be found. Investors can put their money in those In these two stock time series, FEP shows better stocks with the highest predictabilities. Thus, the performance in both accuracy and computation number of trading times increases while the time than GP. But as mentioned previously, the advantage of the high average returns per trade solutions found by GP have a fairly large variance shown in the previous strategy still being hold. compared with FEP. This is because that GP is Based on this consideration, a new improved more likely to fall into a local minimum and trading strategy is proposed. generate poor solutions. The results of GP could be improved further with throwing away these bad solutions. To demonstrate this, the 50% solutions 6. Other nonlinear time series that have low training MSE are kept for testing, and modeling approaches the remaining 50% of the high error solutions are discarded. The results after this process are shown 6.1. Fast Evolutionary Programming (FEP) below in Table 6.5. It can be seen that GP has FEP was proposed by Rao, Chellapilla to better accuracy performance that FEP. optimize the parameters of a reduced parameter In conclusion, the GP has been shown to have better bilinear model (RPBL) which is capable of search ability than FEP, especially when dealing effectively representing nonlinear models with with more predictable time series. FEP performs the additional advantage of using fewer better when applied to noisier time series. For real parameters than a conventional bilinear model. world time series such as sunspot time series and stock price time series, its accuracy performance is a) The Mackey-Glass Time Series similar to GP, but with less computational effort.

ISBN: 978-960-6766-76-3 207 ISSN 1790-5109 9th WSEAS Int. Conf. on MATHEMATICS & COMPUTERS IN BUSINESS AND ECONOMICS (MCBE '08), Bucharest, Romania, June 24-26, 2008 However, in the financial applications, the accuracy techniques, Fast Evolutionary Programming (FEP) performance is much more important than and Time Series Data Mining (TSDM), were computational performance. Therefore, GP is considered as modeling methods. considered to be a better modeling approach in this Possible future work of this research includes more particular application. FEP may be more useful in robust statistical analysis of the results, study of the some other applications where the computation Η -metric for other time series modeling techniques, time is more important. further empirical studies, and theoretical evaluation of the metric. By doing these researches, the current 6.2. Time Series Data Mining (TSDM) predictability metric may be generalized so that it TSDM adapts and innovates data mining concepts does not only apply for one specific modeling to time series analysis. The focus is on method. characterizing and predicting events. It does not require the time series to be stationary and it References: overcomes the limitations of traditional methods of [1] Box G.E., Jenkins G., Time series analysis: requiring normality and independence of the Forecasting and Control. Cambridge University residuals in the time series. Press, 1976. In literature is shown that TSDM is effective in [2] Brock W., Lakonishok J., LeBaron B. (1992) recognizing patterns contained in stock price time Simple Technical Trading Rules and the Sto- series; the patterns found in the training time series chastic Properties of Stock Returns, J of Finance also exist in the test time series, but TSDM could XLVII, no 5, pp. 1731-1764. also find patterns in a pure noise time series in the [3] D. Fogel, "Preliminary experiments on training stage. This fact leads to the result that the discriminating between chaotic signals and noise TSDM method found events in the reshuffled time using evolutionary programming." proceedings of series no worse than in the original time series. The Genetic Programming 1996, pp. 512-520 η –metric is not applicable to TSDM because it can [4] M. Kaboudan, "Genetic Programming hardly tell the differences between the original time Prediction of Stock Prices" Computational series and the reshuffled one. Another attempt is to Economic, 2007 use the probability value α as a possible [5] . J. Povinelli, Time Series Data Mining: predictability metric, where α is the probability to Identifying Temporal Patterns for reject the test hypothesis that the set of eventnesses Characterization and Prediction of Time Series associated with the temporal pattern cluster is Events, Ph.D. Dissertation, different from the set of eventnesses not associated [6] W.G. David, H.Wolpert, "No Free Lunch with the temporal pattern cluster [5]. The TSDM Theorems for Optimization," IEEE Trans. on method takes advantage of some kind of Evolutionary Computation, vol. 1, pp. 67-82, 1997. predictability information of a time series, and thus [7] B. Freisleben, "Stock Market Prediction with the attempt of trying to build predictability metric Backpropagation Networks," Lecture on computer on top of it could not do any better. science, vol. 604, 1992 [8] J. Koza, Genetic Programming: On the Programming of Computers by Means of Natural 7. Conclusions Selection. Cambridge, MA: The MIT Press, 1992. A new time series predictability metric which [9] Akaike, "A new look at the overcomes the main disadvantages of the pure η - identification," IEEE Trans. Auto Control, vol. 19, metric and provides the predictability changes over 1994. different subsequences in a time series is proposed. [10] S.S. Rao, "Evolving reduced parameter Successful attempts have been made with GP and bilinear models for time series prediction using fast ANN in the application of stock time series evolutionary programming," Proceedings of the prediction. It was demonstrated that the new metric First Annual Conference, Cambridge, MA, 1996 has successfully determined the difference between [11] Refenes A.N., Burgess A.N., Bentz Y. different kinds of time series including (1997) Neural Networks in Financial deterministic time series, time series, Engineering: A Study in Methodology. IEEE deterministic plus noise time series, Transactions on Neural Networks, pp. 1222-1267. time series and stock price time series. This feature [12] X. Yao, "Fast evolutionary programming," is used to develop a new stock trading strategy, Proceedings of 5th Annual Conference on which evaluates the predictability metric for a set of Evolutionary Programming., 1996, pp. 451-456 stocks, and trades on those stocks with relatively [13] Y. Zhang, "A Reduced Parameter Bilinear high predictability. Time Series Model" IEEE Trans.Signal Besides GP and ANN, two other modeling Processing, vol. 42, 1994

ISBN: 978-960-6766-76-3 208 ISSN 1790-5109