New Frame for Financial Risk Management by Using Hidden - Hikari

New Frame for Financial Risk Management by Using Hidden - Hikari

International Journal of Contemporary Mathematical Sciences Vol. 11, 2016, no. 9, 437 - 454 HIKARI Ltd, www.m-hikari.com https://doi.org/10.12988/ijcm...

1MB Sizes 0 Downloads 2 Views

Recommend Documents

Financial Risk Measurement for Financial Risk Management
Financial Risk Measurement for Financial Risk Management. Torben G. Andersen, Tim Bollerslev, Peter F. Christoffersen, a

Using Data for Systemic Financial Risk Management - CiteSeerX
Jan 12, 2011 - Using Data for Systemic Financial Risk Management. Mark Flood. University of Maryland [email protected]d

Financial Risk Management for Management Accountants - CIMA
commodity prices, equity prices, credit quality, liquidity, and an organization's access to financing. These financial r

FINANCIAL RISK AND FINANCIAL RISK MANAGEMENT - CiteSeerX
basic definitions and issues related to risk, and the management of financial risk and financial risk management technol

Financial Risk Management RISK MANAGEMENT ORGANIZATION
1. Financial Risk Management. RISK MANAGEMENT ORGANIZATION. The LBP Group is involved in various banking activities that

Financial Risk Management
This course is about what-why-when-where-how issues of hedging and risk monitoring. Case studies are analyzed to learn f

Financial Risk Management
The subject of financial risk management continues to be the topic that dominates the global financial headlines. The fa

Financial Risk Management - CIMA
Financial Risk Management. Topic Gateway Series. 1. Prepared by Jasmin Harvey and Technical Information Service. Februar

Financial Engineering & Risk Management
Founder and President of Entropy Capital LLC, a proprietary derivatives broker-dealer and market maker (current). ▫ Fo

Financial Risk Management Policy
Financial Risk Management. Policy. This policy was adopted by the Board of Directors of Armagh Credit. Union Limited. Si

International Journal of Contemporary Mathematical Sciences Vol. 11, 2016, no. 9, 437 - 454 HIKARI Ltd, www.m-hikari.com https://doi.org/10.12988/ijcms.2016.6953

New Frame for Financial Risk Management by Using Hidden Markov Models Mona N. Abdel Bary Faculty of Commerce, Department of Statistics and Insurance Suez Canal University, Al Esmalia, Egypt c 2016 Mona N. Abdel Bary. This article is distributed under the Creative Copyright Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract Traditional time series analysis methods such as Autoregressive Moving Average Models or known as ARMA Family Models are limited by the requirement of stationary of the time series and normality and independence of the residuals. Moreover, traditional time series analysis methods are unable to identify complex (no periodic, nonlinear, irregular, and chaotic) characteristics because they attempt to characterize and predict all-time series observations. There are three major difficulties about accurate forecast of financial time series; (1) The patterns of financial time series are dynamic, i.e. there are no single fixed models that work all the time; (2) An efficient system must be able to adjust its sensitivity as time goes by; (3) Misleading information must be identified and eliminated. Thus, a Hidden Markov Model (HMM) aims to solve these problems. In HMM, instead of combining each state with an output (transition matrix), each state is associated with a probabilistic function. At time t, an observation is generated by probabilistic function, which is associated with state j, with the probability. Unlike the Markov chain, the HMM has different strategies depending on expertise. The model picks the best overall sequence of strategies based on an observation sequence. The main objective of this study is to improve the portfolio management process by incorporating technique to rotating the stocks of optimal portfolio by using HMM.

Keywords: Financial Time Series, Markov Model, Hidden Marov Model, Risk Management, Egyptian Stock Market

438

1

Mona N. Abdel Bary

Introduction

Time series forecasting, which analyzes and predicts a variable changing over time, has received much attention to its use for forecasting stock prices. Time series analysis is also useful for pattern recognition and data mining. Stock markets in the recent past have become an integral part of the global economy. Any fluctuation in the market influences our personal and corporate financial lives and also the economic health of the country. The stock market has always been one of the most popular investments due to its high returns. However, there is always some risk associated with the investment in the stock market due to its unpredictable behavior. There are three major difficulties about accurate forecast of financial time series. First, the patterns of financial time series are dynamic, i.e. there are no single fixed models that work all the time. Second, an efficient system must be able to adjust its sensitivity as time goes by. Third, misleading information must be identified and eliminated. Thus, HMM aims to solve these problems. HMM is an extension of the Markov Model (MM). The basic HMM was published by Baum and his colleagues in late 1960s and early 1970s (see; (4), (5)) and has been implemented in speech recognition (see; (23), (15)). In HMM, instead of combining each state with an output (transition matrix), each state is associated with a probabilistic function. At time t, an observation ot is generated by probabilistic function, which is associated with state j, with the probability bj (ot ) = P (ot /Xt = j). Unlike the Markov chain, the HMM has different strategies depending on expertise. The model picks the best overall sequence of strategies based on an observation sequence. In HMM, the transition probabilities as well as the observation generation probability density function are both adjustable. The function bj (ot ) is a continuous probability density function or a mixture of pdfs. The most generally used form of the continuous pdf is the Gaussian mixture, which they can model series that does not fall into the single Gaussian distribution. The parameters of HMM are updated each iteration with an adddrop Expectation-Maximization (EM) algorithm (38). Furthermore HMM, which is a doubly embedded stochastic process with an underlying stochastic process that is not observable (hidden), but can be only observed through another set of stochastic processes that produce the sequence of observations. The paper is arranged as follows: Section 2 gives a brief literature review, Section 3 sheds light on assumptions of the study, objective of the study is give in Section 4. contribution of the study introduced in Section 5, the Proposal frame described in Section 6. A summary and concluding remarks are give in Section 7.

439

New frame for financial risk management

2

Literature Review

A large amount of research has been and continues to be published in recent years with the purpose of finding an optimal prediction model for the financial time series, (20). Most of the forecasting research has employed the statistical time series analysis techniques, such as Auto-Regression Integrated Moving Average (ARIMA) (see; (17), and (21)) as well as the multiple regression models. In recent years, numerous stock prediction systems based on artificial intelligence techniques have been proposed including Artificial Neural Networks (ANN) (see; (33), (16)), and (21)), fuzzy logic (26), hybridization of ANN and fuzzy system (see; (28), and (1)), support vector machines (6). The studies of speech recognition by using HMM still continues (2). Many recent works in economics are based on Hamilton’s time series model with changes in regime which is essentially a class of HMM (see; (10), (11), (12), and (13)). The fluctuating economic numbers such as stock index is very much influenced by the business cycle which can be seen as the hidden states with seasonal changes (36). Additionally, they are used in many other applications such as modeling general audio (9), protein sequences and genetic sequence alignment and analysis (18), studying vegetation dynamics (see; (29), and (30)), study of the climate (see; (36) and (34)), psychological data and bio-informatics (see; (14), and (7)). Study (38) uses HMM for predicting the financial time series. Study (37) compares the applicability of Hidden Markov Model (HMM) with GARCH(1,1) model. The results of this study indicates that HMM outperforms GARCH(1,1), (3) introduces a study about modeling portfolio defaults using HMM with covariances, volatility estimation, price prediction, additional to forecasting the change directions of financial time series (see; (25), (35), (37), and (27)).

3

Assumptions of the Study

There are two assumptions for the structure of HMM: 1. Markov Assumption: Markov assumption means that the probability of generating the next state depends only on the current state, P (xt+1 |xt , xt−1 , . . . , x0 ) = P (xt+1 |xt ), ∀t.

(1)

2. Independence Assumption: The independence assumption indicates that the probability distribution of generating the current observation symbol depends only on the current state, P (Yt+1 |Xt , λ) =

T Y t=1

P (Yt |Xt , λ).

(2)

440

4

Mona N. Abdel Bary

Objective of the Study

Financial time series data is a sequence of prices of some financial assets over a specific period of time. Financial time series consists of multi-dimensional and complex nonlinear data that give rise to difficulties in accurate prediction. Traditional studies use various forms of statistical models to predict volatile financial time series. Sometimes stocks move without any news, as the Daw Jones Industrial Index did on Monday, October 19, 1987. It fell by 22.6% without any obvious reason. We have to identify whether an irrational price movement is noise or it is part of a pattern. So that, there is a need to a modern models for studying the financial time series. There are three major difficulties about accurate forecast of financial time series. 1. The patterns of financial time series are dynamic, i.e., there is no single model that works all the time. 2. An efficient system must be able to adjust its sensitivity as time goes by. 3. Misleading information must be identified and eliminated. The main objective of this study is to improve the risk management process by incorporating technique to rotating the stocks and rotating the optimal portfolios by using HMM. So the study aims to answer the following questions: • What is the expected performance of the investors about each stock? • What is the expected stock movements? • What is the expected adequate time for buying or keeping and selling ?

5

Contribution of the Study

In this paper we address the following problem: 1. Offering trading rules: There is an obvious lack of trading rules for risk management to determine the adequate time for buying and selling the stock. We introduce such trading rules in this study. 2. Introducing Hidden Markov Model: The study offers a new frame that takes into account the problems associated with the traditional formulation of financial time series. 3. Application on Egyptian Stock Market: The study applied the introduction frame on Egyptian Stock Market.

New frame for financial risk management

6

441

The Proposal Frame

The study introduces the frame for risk management to determine the adequate time for buying and selling the stock. So we aim to answer the following three questions: • What is the expected performance of the investors about each stock? • What is the expected stock movements? • What is the expected adequate time for buying or keeping and selling ? The proposed frame in Section 6 for learning from time series data consists of detecting patterns within the data, describing the detected patterns, clustering the patterns, and creating a model to describe the data. It uses a change-point detection method to partition a time series into segments, each of the segments is then described by Hidden Markov Model (HMM). Then, it partitions all the segments into clusters, each of the clusters is considered as a state for the HMM. It then creates the transitions between states in the Markov model based on the transitions between segments as the time series progresses. The proposed frame for using the learned model for forecasting consists of identifying current state, forecasting trends, and adapting to changes. It uses a moving window to monitor real time data and creates an Hidden Markov model for the recently observed data, which is then matched to a state of the learned Hidden Markov model. The study suggests the following steps for constructing a frame for trading the stocks by HMM as shown in Figure 1.

Figure 1: Study’s Trading Model.

442

Mona N. Abdel Bary

1. Determine the states; we introduce two states; the first state is buying state, the second state is selling state, {Buy, Sell}; N = 2. 2. Determine the number of distinct observation symbols in each state; the return time series includes five movements symbols {large increase, small increase, no change, small decrease, large decrease}; M = 5. 3. Transform the observation sequence Y = {y1 , y2 , . . . , yT } into the state sequence S = {s1 , s2 , . . . , sT }. 4. Calculate the initial parameters λ = (A, B, π) of HMM: • The initial state distribution; πi = Probability of being at state i at time t − 1. • Transition matrix:

aij =

expected number of transitions from state i to j expected number of transitions from state i

(3)

• Emission Matrix. bi (m) =

expected no. of times in state i and observing symbol m expected no. of times in state i.

(4)

5. Find the new optimal state sequence S based on the initial parameters λ = (A, B, π) through solving the three basic HMM problems: • Find the probability of an observation. Given an observation sequence Y = {y1 , y2 , . . . , yT } and HMM parameters λ = (A, B, π) by using forward-backward algorithm (see; (22), and (23)). • Find the best state sequence. Given an observation sequence Y = {y1 , y2 , . . . , yT } and HMM parameters λ = (A, B, π) by using the Viterbi algorithm (see; (8), and (23)). • Parameters re-estimations, Given an observation sequence. This problem can be solved by the Baum Welch algorithm as mentioned in (32). Section 6.1 proposes a way for risk management of the stocks. Section 6.3 proposes applying the proposed trading rule to the Egyptian Stock Market.

New frame for financial risk management

6.1

443

Trading Rule by Financial HMM

The hidden Markov model (HMM) is a class of probabilistic models which is able to capture the dynamic properties of ordered observations. An HMM relates the observations sequence Y = {y1 , y2 , . . . , yT } to a hidden state sequence S = {s1 , s2 , . . . , sN }. The sequence of hidden states is assumed to be a Markov process. The initial distribution π gives the (prior) probability of a sequence starting in each of the hidden states. The transitions from state to state are then determined by a transition matrix A, with aij = p(st+1 = j|st = i). The parameter set {π, A, B} defining an HMM is collectively denoted by λ.

Figure 2: Pictorial Representation of the HMM. Source: (20) Figure 2 indicates that the nodes are Markov states, corresponding to values of the hidden variable st . The vertices are state transitions, labeled with their probabilities from the transition matrix A. The dashed lines are outputs, defined by the probability distribution B. A trained HMM represents a distribution of sequences within a determinate output space. It allows every possible sequence of observations in that space to be assigned a likelihood, which is just the posterior probability of the sequence being randomly generated by the model (in practice, the likelihood of most arbitrary sequences may be extraordinarily close to zero). This is equal to the sum of the joint probabilities with all possible state sequences: X P (Y |λ) = p(Y |S, λ)p(S|λ). (5) S

Since the number of sequences grows exponentially with T, and the number of steps required to process each sequence grows linearly, computing this sum

444

Mona N. Abdel Bary

directly requires 2T N T operations. Fortunately, by summing the state probabilities of all paths at each time step, it is possible to find the posterior in N 2 T (23). HMM allows for timing investment decision prediction about the stocks. We have two investment decisions; each of them gives a distinctive prediction about the return stock movements on a certain time. Each of the two decisions is a hidden state in the HMM. The return stock movements set has all the movement symbols and each symbol is associated with one state. Each decision has a different probability distribution for all the return stock movements. Each state (decision) is connected to all the other states with a transition probability matrix. The function at each state is called a discrete probability density function. We model the direction of the return movements as follows: Large Increase, Small Increase, No Change, Small Decrease, Large Decrease. But if the stocks don’t have movements that include these degree; we can reduce the number of symbols into three symbols only: Increase, No Change, Decrease. The number of the symbols depends on the natural of the stock movements. The process of risk management of the investment is the major investor problem. The proposed trading rule is used to determine the adequate time for buying and selling the stock.

6.2

Data Set

We use the general index of Egyptian Stock Market (GI) data set, which is composed mainly of 45 stocks highest transaction volume. The return of the monthly closing values are used as the monthly return value of each stock. The data from January 2004 to April 2008 are freely available on www.efsa.gov.eg.

6.3

Applications to the Egyptian Stock Market

We illustrate the suggested steps with all details for constructing financial HMM for trading rule using stock1 as example by using (19). • Number of the states N = 2, we have two states; the first state is buying state and the second state is selling state; S = {buying, selling}. St =

n

1 2

if Yt > 0, t = 1, . . . , T, otherwise. Yt =

Pt − Pt−1 Pt−1

(6) (7)

where Yt is the stock return at time t, Pt is the stock price at time t, and Pt−1 is the stock price at time t − 1.

445

New frame for financial risk management

• Transform the observation sequence Y = {y1 , y2 , . . . , yT } into the state sequence S = {s1 , s2 , . . . , sT } as in Table 1. • The return time series includes five movements or symbols (M = 5). The movements of the return stock as follows: (1) Large Increase (LI), (2) Small Increase (SI), (3) No Change (NC), (4)Small Decrease (SD), (5) Large Decrease (LD).

Mt

 1      2 3 =   4    5

if if if if if

Yt > 0.5, 0.01 < Yt < 0.5, 0.00 < Yt < 0.01, − 0.05 < Yt < 0.00, Yt < −0.05.

(8)

• Calculate the initial parameters: – The starting state probabilities: {π1 , π2 , . . . , πN }. πi is the probability of being at state i at time t−1. The probability of being at state 1 (i.e. buy) at the first time = 1. – The Initial state transition probabilities matrix is calculated as follows :

aij =

Number of transitions from state i to j . Number of transitions from state i 39 62 22 = 37

(9)

23 = 0.37, 62 15 = = 0.40. 37

a11 =

= 0.63, a12 =

a21

= 0.60, a22

The Initial state transition probabilities matrix A is present in Table 2, with aij . – The Initial emission matrix is calculated as follows :

bi (m) =

No. of times in state i and observing symbol m . No. of times in state i

(10)

446

Mona N. Abdel Bary

Table 1: State Sequence and Emission Sequence; The Stock Prices Application Data (Jan 2000–April 2008). t 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

Yt –0.049 –0.019 –0.084 –0.084 –0.157 –0.168 0.159 0.304 –0.078 –0.053 –0.169 –0.004 –0.118 –0.088 0.064 –0.004 0.007 –0.055 0.019 –0.167 0.062 –0.028 –0.101 –0.135 0.040 –0.004 0.124 0.153 –0.019 0.054 0.002 –0.011 0.059

St 2 2 2 2 2 2 1 1 2 2 2 2 2 2 1 2 1 2 1 2 1 2 2 2 1 2 1 1 2 1 1 2 1

Mt 4 4 5 5 5 5 1 1 5 5 5 4 5 5 1 4 3 5 2 5 1 4 5 5 2 4 1 1 4 1 3 4 1

t 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66

Yt 0.131 –0.075 0.413 –0.124 0.132 0.028 0.091 –0.012 0.085 0.088 0.024 –0.020 0.075 –0.116 0.011 –0.053 0.001 0.189 –0.045 –0.015 0.060 –0.004 0.099 0.008 0.048 –0.073 0.055 0.071 –0.035 –0.029 –0.171 0.046 0.053

St 1 2 1 2 1 1 1 2 1 1 1 2 1 2 1 2 1 1 2 2 1 2 1 1 1 2 1 1 2 2 2 1 1

Mt 1 5 1 5 1 2 1 4 1 1 2 4 1 5 2 5 3 1 4 4 1 4 1 3 2 5 1 1 4 4 5 2 1

Table 2: Initial Transition Matrix of Stock1. Current State Buy Sell

Buy 0.63 0.60

35 0 = 0.66, b2 (1) = 53 46 12 0 b1 (2) = = 0.23, b2 (2) = 53 46 6 0 b1 (3) = = 0.11, b2 (3) = 53 46 0 21 = 0.00, b2 (4) = b1 (4) = 53 46 0 25 b1 (5) = = 0.00, b2 (5) = = 0.54. 53 46 b1 (1) =

Sell 0.37 0.40

= 0.00, = 0.00, = 0.00, = 0.46,

t 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

Yt –0.016 0.243 0.141 –0.012 0.084 0.079 –0.176 –0.138 0.008 –0.167 –0.108 0.180 0.049 0.061 0.069 0.055 0.113 –0.097 0.116 0.019 0.156 –0.006 0.016 –0.006 0.056 –0.013 0.040 0.007 –0.091 0.029 0.083 0.224 –0.012

St 2 1 1 2 1 1 2 2 1 2 2 1 1 1 1 1 1 2 1 1 1 2 1 2 1 2 1 1 2 1 1 1 2

Mt 4 1 1 4 1 1 5 5 3 5 5 1 2 1 1 1 1 5 1 2 1 4 2 4 1 4 2 3 5 2 1 1 4

447

New frame for financial risk management

Table 3 shows the initial emission matrix B, with bi (m). Table 3: Initial Emission Matrix of Stock1. States Buy Sell

LI 0.66 0

The Stock Movements SI NC SD 0.23 0.11 0 0 0 0.46

LD 0 0.54

• Parameters re-estimations can be solved by the Baum Welch algorithm. – Transition matrix: Table 4 shows that Stock1 will continue in buying state for %63 of the next month and there are transition from selling state to buying state for %63 of the time. Table 4: Re-Estimation Transition Matrix of Stock1. Current State Buy Sell

Next State Buy Sell 0.63 0.37 0.63 0.37

– Emission matrix: Table 5 shows that buying state leads to increasing the rate of the return for %87 (%49 + %38) of the buying time and %13 of the buying time is in a non change of the rate of the return. Selling state leads to decrease in the rate of the return %38 of the selling state time. Table 5: Re-Estimation Emission Matrix of Stock1. States Buy Sell

LI 0.49 0

The Stock Movements SI NC SD 0.38 0.13 0 0 0 0.61

LD 0 0.39

• The decision: Referring to the transition matrix in Table 4 and emission matrix in Table 5, the decision is to keep Stock 1 in the portfolio if it is in the portfolio. This stock is a good investment for short time investments. Similar calculation can be performed for all high return stocks that are similar to Stock1. The transition and emission matrices all other stocks can be obtained in a similar way as for stock1. These are shown in Tables 6 and 7, respectively.

448

Mona N. Abdel Bary

Table 6: Emission Matrix for Stocks Movements. Stock 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

LI 0.4921 0.5175 0.5356 0.5736 0.4969 0.5350 0.5965 0.4813 0.6536 0.6905 0.6306 0.5031 0.5131 0.3673 0.6423 0.5183 0.4096 0.6319 0.8000 0.6111 0.8397 0.6178 0.6178 0.5886 0.3333 0.7353 0.6747 0.6746 0.6170 0.6685 0.8013 0.7647 0.6318 0.7170 0.4494 0.3801 0.2920 0.6188 0.6211 0.4699 0.4768 0.7108 0.8074 0.5793 0.4432

Buy SI 0.3810 0.3427 0.3038 0.3299 0.2099 0.1683 0.3026 0.3688 0.2288 0.3054 0.2675 0.2303 0.2364 0.5000 0.2555 0.3841 0.4202 0.2945 0.1143 0.1894 0.1263 0.2461 0.2461 0.3797 0.5497 0.1882 0.2470 0.2899 0.3219 0.2155 0.1854 0.1895 0.1848 0.2075 0.3596 0.4297 0.2824 0.3125 0.3168 0.3976 0.4570 0.1928 0.0667 0.3034 0.3523

Sell NC 0.1270 0.1399 0.1507 0.0964 0.2932 0.2967 0.1009 0.1500 0.1176 0.0041 0.1019 0.2665 0.2505 0.1327 0.1022 0.0976 0.1702 0.0736 0.0857 0.1995 0.0340 0.1361 0.1361 0.0318 0.1170 0.0765 0.0783 0.0355 0.0611 0.1160 0.0132 0.0458 0.1834 0.0755 0.1910 0.1102 0.4256 0.0688 0.0621 0.1325 0.0662 0.0964 0.1259 0.1172 0.2045

SD 0.6126 0.6115 0.5372 0.3495 0.6377 0.6110 0.6420 0.5214 0.4490 0.4845 0.3497 0.5482 0.4425 0.5962 0.3681 0.4632 0.6250 0.4672 0.1625 0.7207 0.5003 0.6156 0.3303 0.4507 0.7054 0.4231 0.5896 0.3969 0.5295 0.4454 0.1678 0.4830 0.5311 0.3901 0.5000 0.5824 0.2204 0.4429 0.4604 0.3955 0.4027 0.3881 0.2970 0.5355 0.6532

LD 0.3874 0.3885 0.4628 0.6505 0.3623 0.3890 0.3580 0.4786 0.5510 0.5155 0.6503 0.4518 0.5575 0.4038 0.6319 0.5368 0.3750 0.5328 0.8375 0.2793 0.4997 0.3844 0.6697 0.5493 0.2946 0.5769 0.4104 0.6031 0.4705 0.5546 0.8322 0.5170 0.4689 0.6099 0.5000 0.4176 0.7796 0.5571 0.5396 0.6045 0.5973 0.6119 0.7030 0.4645 0.3468

The decision: Referring to the transition matrix in Table 4 and emission matrix in Table 5, the decision is to keep Stock1 in the portfolio if it is in the portfolio. This stock is a good investment for short time investments. Similar calculation can be performed for all high return stocks that are similar to Stock1. The transition matrices and the emission matrices for all other stocks are obtained in Table 6 and Table7.

449

New frame for financial risk management

Table 7: Transition Matrix for Stocks.

Stock 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

7

Next State Buy Sell 0.6296 0.3704 0.6306 0.3694 0.5517 0.4483 0.4065 0.5935 0.2650 0.7350 0.4392 0.5608 0.6231 0.3769 0.7228 0.2772 0.4969 0.5031 0.5912 0.4088 0.5104 0.4896 0.6101 0.3899 0.5135 0.4865 0.3030 0.6970 0.5528 0.4472 0.5108 0.4892 0.5556 0.4444 0.4626 0.5374 0.4722 0.5278 0.5326 0.4674 0.5796 0.4204 0.4615 0.5385 0.5722 0.4278 0.5223 0.4777 0.6000 0.4000 0.5473 0.4527 0.7259 0.2741 0.5146 0.4854 0.5580 0.4420 0.3704 0.6296

Stock 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Next State Buy Sell 0.5333 0.4667 0.5630 0.4370 0.6368 0.3632 0.6091 0.3909 0.5671 0.4329 0.5147 0.4853 0.5106 0.4894 0.4277 0.5723 0.6078 0.3922 0.4486 0.5514 0.5133 0.4867 0.3137 0.6863 0.5907 0.4093 0.7196 0.2804 0.5717 0.4283 0.7296 0.2704 0.5031 0.4969 0.5532 0.4468 0.6821 0.3179 0.4173 0.5827 0.5118 0.4882 0.6385 0.3615 0.5357 0.4643 0.5758 0.4242 0.5118 0.4882 0.6308 0.3692 0.4698 0.5302 0.5239 0.4761 0.6593 0.3407 0.5169 0.4831

Stock 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

Next State Buy Sell 0.5359 0.4641 0.4694 0.5306 0.5294 0.4706 0.4898 0.5102 0.5649 0.4351 0.5520 0.4480 0.5342 0.4658 0.5252 0.4748 0.6180 0.3820 0.5574 0.4426 0.6620 0.3380 0.5157 0.4843 0.7339 0.2661 0.6091 0.3909 0.6149 0.3851 0.4388 0.5612 0.5149 0.4851 0.5388 0.4612 0.5689 0.4311 0.5338 0.4662 0.5526 0.4474 0.4527 0.5473 0.5964 0.4036 0.5000 0.5000 0.3971 0.6029 0.4939 0.5061 0.4490 0.5510 0.5163 0.4837 0.6250 0.3750 0.5323 0.4677

Conclusion and Remark

The study introduces trading rule for determining the timing of exchange of stocks. This trading rule reflects the effective of using HMM instead of MM. Figure 3 shows that instead of combining each state with deterministic output as in Markov Model (MM), each state of HMM is associated with probability function. Moreover, each state is connected to all the other states with the transition probability distribution. The proposal trading model don’t only determine the adequate decision for each stock but also allowed to determine the rate of return of timing of each decision. So, we can determining the best time for this decision, see Table 8. The proposal trading rule for timing of exchange of the stocks includes these advantages: • Portfolio investors; trading rule can be used for rotating the portfolio or risk management.

450

Mona N. Abdel Bary

Figure 3: From left to right: (1) Each State with Deterministic Output as in MM, (2) Each State of HMM is Associated with Probability Function.

Table 8: Proposal Trading Rule. Probability State Buy Sell Probability Return LI SI NC SD LD

Trading Buy Sell X X Timing Buy Sell X X X X X

• Individual stocks investors; determining the best stocks for both of conservative and aggressive investors. • Transaction for short time; determining the best time for buying and selling the stocks.

New frame for financial risk management

451

References [1] A. Abraham, B. Nath and P. K. Mahanti, Hybrid Intelligent Systems for Stock Market Analysis, Chapter in Computational Science-ICCS 2001, Springer, 2001, 337–345. https://doi.org/10.1007/3-540-45718-6 38 [2] T. Asghar, R. T. Mohammad, A. Hassan and B. Hassan, Fuzzy Hidden Markov Models for Speech Recognition on Based on FEM Algorithm, World Academy of Science, Engineering and Technology, 4 (2005), 59–61. [3] K. Banachewicz, A. Lucas and A. Vaart, Stock Returns and Volatility, Econometrics Journal, 10 (2007), 1–18. [4] L.E. Baum and J.A. Eagon, An inequality with applications to statistical estimation for probabilistic functions of Markov processes and to a model for ecology, Bull. Amer. Math. Soc., 73 (1967), 360–363. https://doi.org/10.1090/s0002-9904-1967-11751-8 [5] L.E. Baum, T. Petrie, G. Soules and N. Weiss, A Maximization Technique Occuring in the Statistical Analysis of Probabistic Functions of Markov Chains, Annals of Mathematical Statistics, 41 (1970), 164–171. https://doi.org/10.1214/aoms/1177697196 [6] L. Cao and F.E.H. Tay, Financial Forecasting Using Support Vector Machines, Neural Computing and Application, 10 (2001), 184–192. https://doi.org/10.1007/s005210170010 [7] V. De Fonzo, F. Aluffi-Pentini, V. Parisi, Hidden Markov Models in Bioinformatics, Current Bioninformatics, 2 (2007), no. 1, 49–61. https://doi.org/10.2174/157489307779314348 [8] D. Forney, The Viterbi Algorithm, Proc. IEEE, 61 (1973), no. 3, 268–278. https://doi.org/10.1109/proc.1973.9030 [9] M.J.R. Gomez and P.W. Daniel, Selection, Parameter Estimation and Discriminative Training of Hidden Markov Models for General Audio Modelling, 2003 International Conference on Multimedia and Expo. ICME ’03, (2003). https://doi.org/10.1109/icme.2003.1220857 [10] J.D. Hamilton, Rational Expectations Econoetrics Analysis of Changes in Regimes: An Investigation of the Term Structure of Interest Rates, Journal of Economic Dynamics and Control, 12 (1988), 385–423. https://doi.org/10.1016/0165-1889(88)90047-4

452

Mona N. Abdel Bary

[11] J.D. Hamilton, A New Approach to the Economic Analysis of Nonstationary Time Series and the Business Cycle, Econometrica, 57 (1989), 357–384. https://doi.org/10.2307/1912559 [12] J.D. Hamilton, Analysis of Time Series Subject to Change in Regime, Journal of Econometrics, 45 (1990), 39–70. https://doi.org/10.1016/0304-4076(90)90093-9 [13] J.D. Hamilton and P.Q. Gabriel, What Do the Leading Indicators Lead?, The Journal of Business, 69 (1996), no. 1, 27–49. https://doi.org/10.1086/209678 [14] Ingmar Visser, Maartje E.J. Raijmakers, Peter C.M. Molenaar Fitting Hidden Markov Models to Psychological Data, Scientific Programming, 10 (2002), 185–199. https://doi.org/10.1155/2002/874560 [15] B.H. Juang and L.R. Rabiner, Hidden Markov Models for Speech Recognition, Technometrics, 33 (1991), no. 3, 251–272. https://doi.org/10.1080/00401706.1991.10484833 [16] S.H. Kim and S.H. Chun, Graded forecasting using an array of bipolar predictions: application of probabilistic neural networks to a stock market index, International Journal of Forecasting, 14 (1998), 323–337. https://doi.org/10.1016/s0169-2070(98)00003-x [17] T. Kimoto, K. Asaka, M. Yoda and M. Takeoka, Stock Market Prediction System with Modular Neural Networks, International Joint Conference on Neural Networks, San Diego, 1 (1990), 1–6. https://doi.org/10.1109/ijcnn.1990.137535 [18] R.J. Mackay, Estimating the order of a hidden Markov model, The Canadian Journal of Statistics, 30 (2002), no. 4, 573–589. https://doi.org/10.2307/3316097 c [19] MATLAB (2007), 1984-2007, Version 7.5, the Mathworks Inc. www.mathworks.com [20] Md. Rafiul Hassan and N. Baikunth, Stock Market Forecasting Using Hidden Markov Model: A New Approach, Proceedings of the 5th International Conference on Intelligent Systems Design and Applications, (2005). https://doi.org/10.1109/isda.2005.85 [21] N. A. Mona, Use of Time Series Models and neural networks in the prediction of Stocks’ prices in the Egyptian Stock Market, The 39th Annual

New frame for financial risk management

453

Conference of Statistics, Computer Science and Operations Research, Second Part, Applied Statistics, Institute of Mathematical Statistics, Cairo University, (2004), 1–24. [22] B. Phil, Hidden Markov Models, (2004). [23] L.R. Rabiner, A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition, Proceedings of the IEEE, 77 (1989), no. 2, 257–286. https://doi.org/10.1109/5.18626 [24] L.H. Robert and E.K. Han, Capital Asset Pricing with Price Level Changes, Journal of Financial and Qualitative Analysis, 11 (1976), 381– 391. https://doi.org/10.2307/2330414 [25] J.E. Robert, C.H. William and M.J. Barbara, Drift and Volatility Estimation in Discrete Time, Journal of Economic Dynamics and Control, 22 (1998), 209–218. https://doi.org/10.1016/s0165-1889(97)00052-3 [26] Y. Romahi and Q. Shen, Dynamic Financial Forecasting with Automatically Induced Fuzzy Associations, Proceedings of the 9th International Conference on Fuzzy Systems, (2000), 381–391. https://doi.org/10.1109/fuzzy.2000.838709 [27] Sang-Ho Park, Ju-Hong Lee, Jae-Won Song and Tae-Su Park, Forecasting Change Directions for Financial Time Series Using Hidden Markov Model, Chapter in Rough Sets and Knowledge Technology, Springer Berlin Heidelberg, 2009, 184–191. https://doi.org/10.1007/978-3-642-02962-2 23 [28] A. Thammano, Neuro-fuzzy Model for Stock Market Prediction, Proceedings of the Artificial Neural Networks in Engineering Conference, ASME Press, New York, (1999), 587–591. [29] B.C. Tucker, Application of Hidden Markov Models in Ecology, M.Sc, Laurentian University, Sudbury, Ontario, Canada, 2003. [30] B.C. Tucker and M. Anad, The Use of Matrix Models to Detect Natural and Pollution-Induced Forest Gradients, Community Ecology, 4 (2003), 89–100. https://doi.org/10.1556/comec.4.2003.1.13 [31] B.C. Tucker, Application of Hidden Markov Models in Terrestrial Ecology, Oral Paper, Laurentian University, Sudbury, Ontario, Canada, (2004). [32] L.R. Welch, Hidden Markov Models and the Baum Welch Algorithm, IEEE Information Theory Society Newsletter, 53 (2003), no. 4, 1–24.

454

Mona N. Abdel Bary

[33] H. White, Economic Prediction Using Neural Networks: The Case of IBM Daily Stock Returns, IEEE International Conference on Neural Networks, (1988). https://doi.org/10.1109/icnn.1988.23959 [34] J. P. Whiting, Identification and Modeling of Hydrological Persistence with Hidden Markov Models, Ph.D Thesis, University of Adelaide, Australia, 2006. [35] B. Wilfling, Volatility Regime-Switching in European Exchange Rates Prior to Monetary Unification, Journal of International Money and Finance, 28 (2009), 240–270. https://doi.org/10.1016/j.jimonfin.2008.08.005 [36] T. Xuan, Autoregressive Hidden Markov Model with Application in an El Nino Study, Master Thesis, University of Saskatchewan Saskatoon, 2004. [37] P. Yin, Volatility Estimation and Price Prediction using A Hidden Markov Model with Empirical Study, Ph.D Thesis, University of Missouri Columbia, 2007. [38] Y. Zhang, Prediction of Financial Time Series with Hidden Markov Models, M.Sc, Simon Fraser University, China, 2004. Received: September 29, 2016; Published: November 7, 2016