Multi-Layer Coupled Hidden Markov Model for Cross-Market Behavior Analysis and Trend Forecasting

The frequent global financial crisis indicates the increasing importance and challenge to analyze and forecast the future trends of stock market for investors and trading agents. Especially with the globalization of the world economy and integration of international financial markets, the complex relationships between markets from different countries should be considered in forecasting market trends, involving multi-layered, interactive, evolutionary, and heterogeneous financial variables and the couplings between variable sets from different countries. A variety of methods have been proposed and implemented for forecasting stock market trends, but there is very limited work reported on predicting a market’s movement based on analyzing the multi-layered, hidden coupling relationships between various markets in different countries. This involves the analysis of hierarchical coupled behaviors and their relationships across multiple markets, and the nonlinear market dynamics. To address this critical issue, this paper proposes a new approach Multi-layer Coupled Hidden Markov Model (MCHMM) for Hierarchical Cross-market Behavior Analysis (HCBA), namely exploring the complex coupling relationships between variables of markets from a country (Layer-1 coupling) and couplings between markets from various countries (Layer-2 coupling), to forecast a stock market’s movements. Toward capturing the hierarchical coupled market behaviors, a Multi-layered Coupled Hidden Markov Model (MCHMM) is built to infer movements of a stock market in a target country by forecasting its price return probabilities. The experimental results on 11 years of data from two types of markets (stock market and currency market) of 13 countries show that our proposed approach outperforms other four benchmarks from technical and business perspectives.


I. INTRODUCTION
The subprime mortgage crisis which occurred in the US in 2008 has caused a chain of destructive effects on global financial markets. An increasing number of researchers and practitioners recognize the need and challenge of exploring coupling relationships [1] between market behaviors of different markets (countries) (for short cross-market behaviors) in forecasting one market's movements. However, crossmarket behavior analysis and trend prediction is not a trivial thing. It involves a theoretical challenge, that is to learn the complex coupling relationships hidden in heterogeneous The associate editor coordinating the review of this manuscript and approving it for publication was Najah Abuali . financial variables, for example, those between markets within one country and between various countries. Complex coupling relationships are due to economic, social and other interactions and influence, and are subject to uncertain and evolutionary market dynamics.
Traditionally, market forecasting has been a popular topic in different areas. Roughly, we may categorize the corresponding approaches into two groups: time series analysis and model-based analysis. Time series analysis has been widely used and explored in financial markets, such as the Logistic regression model [2], AutoRegressive Integrated Moving Average (ARIMA) and Generalized AutoRegressive Conditional Heteroscedasticity (GARCH) models [3]. This kind of approach often requires time series data to be constructed, and overlook or are insufficient for handling other market behavioral properties such as hidden states, heterogeneous variables and more importantly, their complex coupling relationships and dynamics. In recent years, data mining and machine learning models have been explored in market dynamics analysis, such as Artificial Neural Networks (ANN) and Hidden Markov Models (HMM) [4]. They are more effective in capturing heterogeneous variables and their coupling relationships. Cross-market are coupled for various reasons. Taking two types of markets (stock market, currency market) in two respective countries (USA, China) as an example, as shown in Figure 1, the future behavior of the US stock market is not only determined by itself and the US currency market (we call intra-country market coupling), but is also influenced by the Chinese stock market 1 (we call inter-country market coupling). This was the situation in the 2008 global financial crisis [5]. Hence, we need to effectively capture the comprehensive couplings between the two markets in US and China in order to properly predict the trends of the US stock market.
Cross-market analysis has become increasingly interesting such as underlying-derivative market relation analysis in finance and economics [6]. However, very limited research has been conducted in computer science to deeply understand the relationship between financial variables from crossmarkets in different countries. The main challenges lie in key aspects including the involvement of heterogeneous financial variables, variables from different markets, complex coupling relationships between behaviors of different markets [7], and market dynamics. The couplings may involve intra-market interactions, inter-market interactions, intra-country interactions, and inter-country interactions; if cross-market analysis involves different countries, we call this hierarchical cross-market.
To address these issues, in this paper, we propose a novel approach: Multi-layer Coupled Hidden Markov Model (MCHMM) for Hierarchical Cross-market Behavior Analysis (HCBA), to identify systematic market behavioral patterns hidden in cross-market data, namely the complex hierarchical coupling relationships among financial markets in different countries, which are then used to forecast the movements of stock market. Here hierarchical coupling relationships refer to two layers of coupled market behaviors: intra-country market behavior couplings (Layer-1 coupling) reflecting the interactions between financial markets in the same country, and inter-country market behavior couplings (Layer-2 coupling) referring to the influence between the same type of markets across different countries.
The HCBA-based market trend forecasting works as follows. First, HCBA is introduced to formalize the complex coupling relationships between various markets in different countries. Second, two mapping processes are developed to model the forecasting issue. The first mapping relation is formed from HCBA to a MCHMM, in which a CHMM is used to model couplings between markets within a country, and then a MCHMM models the hierarchical market coupling relationships across countries. The second maps a MCHMM to the movement forecasting of a specific stock market. Finally, we infer a stock market trend by estimating its price return probabilities, from capturing the hierarchical coupled market behaviors within a MCHMM. Real financial data in stock and currency markets in 13 major countries is used to evaluate the performance of our MCHMM-based HCBA approach against other classic approaches, including ARIMA, Logistic, ANN and CHMM-based models, from technical and business perspectives. The recommendation results based on the HCBA show the potential for making decisions based on cross-market behavior analysis.
The remainder of this paper is organized as follows. In Section II, we introduce the related work and background. In Section III, the hierarchical coupled market behavior problem is illustrated by a case study, and the corresponding problem is defined. Modeling framework is introduced in Section IV, including HCBA and MCHMM. Forecasting methodology is illustrated in Section V. In Section VI, we show the performance of our approach through the corresponding experiments. Conclusions are drawn in Section VII.

II. RELATED WORK
In recent years, there has been much research into future trends forecasting in financial fields, and it can be divided into following two streams: 1)time series model; 2)machine learning models. Below we first discuss the relevant prediction models, and then coupled behavior analysis and CHMM, as related to this paper, will be introduced.

1) TIME SERIES MODELS
Time series analysis uses historical data to infer future trend behaviors. Authors in [8] employ the ARIMA model to predict monthly trends of metal price. The Logistic model is used in [9] to solve the bankruptcy prediction problem. Authors in [10] present a method to forecast the daily Taiwan stock index based on fuzzy multivariate time series analysis. Since the time series models often failed to capture nonlinear relationships and are unable to handle non-stationary time 158564 VOLUME 7, 2019 series, it is obvious that the methods cannot catch the complex coupled relationships between various time series.

2) MACHINE LEARNING MODELS
The typical models which have been applied in business and financial areas are ANN and HMM, with the basic idea to check for any systematic pattern in the time series and then try to use it to do the forecasting. ANN are data-driven and nonparametric models, and a large number of applications of ANN have been used in stock market prediction. Researchers in [11] apply ANN to establish fuzzy relationships in fuzzy time series for stock forecasting. ANN is used in [12] for forecasting the closing price of stock market index. HMM is employed in [13] to infer the future oil price trend by predicting the probability distribution of time cumulative price returns. Similarly, authors in [4] use HMM for forecasting stock price for interrelated markets. Although these models have been investigated to model market behaviors, the underlying interactions between different markets in various countries have not been considered. In addition, as a hierarchical model, the Hierarchical Hidden Markov Model (HHMM) is used to model the hierarchical structure existing in hidden states in natural sequences, such as speech and handwriting [14]. It cannot be used to model the complex coupled cross-markets with multiple observations.

B. COUPLED BEHAVIOR ANALYSIS
Financial variables associated with a market are more or less inter-related, as are traders' behaviors [15], as verified in [1], [16], financial time series are often highly correlated. In the cross-market situation, market behaviors of different markets are also coupled. This forms the so-called Coupled Behavior Analysis (CBA) problem [17], in which intra-and inter-coupling relationships exist within and between markets. In [17], [18], models have been built to capture the couplings within a trader's behaviors and between traders' behaviors.
Analyzing coupled cross-market behaviors is very challenging, since it involves relationships between financial variables in one market, as well as interactions between variables from different markets. Recently, some researchers have started to involve the information from correlated markets while conducting financial market forecasting [19], [20], and the results have demonstrated the importance and superiority of information from correlated markets. However, some of the existing work mainly focused on the correlations of same type of market, while overlooking the coupled relations from other types of financial markets. Moreover, limited work is reported on the deep analyzation and capture of crossmarket behavior interactions for forecasting stock market movements. To the best of our knowledge, little work has been done on exploring hierarchical coupled behaviors and interactions of various markets from multiple countries.
For convenience, below we refer to the complete set of parameters of a CHMM as λ(A, B, R, π).
Since Markov property plays an important role in financial time series prediction due to the fact that there exist shortterm and long-term correlations in the empirical time series, HMM has been widely employed in the financial markets prediction area [22], [23]. As an improved model of HMM, CHMM is capable of capturing more complex coupling relationships across multiple observation sequences [24], [25], which is very suitable for this study modeling multiple coupled financial markets.

III. PROBLEM STATEMENT A. A CASE STUDY
Financial markets are linked with each other, and index changes in one market are influenced by other market dynamics and interactions between markets. The 2008 global financial crisis shows that the cross-market effect transfers not only from one market to another in the same country, but also from one country to other countries [26]. We can verify it from a quantitative perspective, by using the market indexes of two major financial markets (stock market and currency market 2 ) from 13 major countries 3 , as shown in Table 1. Figure 3 illustrates the coupling relationships between the US stock market index ( ∧ DJI) and other financial market indexes from January 2008 to December 2018. We use the Detrended Cross-Correlation Analysis (DCCA) to quantify the cross-correlations coefficient ρ DCCA between two stationary time series. ρ DCCA is a dimensionless coefficient that ranges between [-1,1]. If two time series are completely crosscorrelated (anti cross-correlated) then ρ DCCA = 1(−1), and if there is no cross-correlation between two time series then ρ DCCA = 0. The vertical axis in Figure 3 represents the crosscorrelation coefficient, while the horizontal axis is the equal length of non-overlapping segments with the time series, more details refer to [28]. Figure 3 shows that there are strong cross-correlations between the US stock market and other financial markets, including the US currency market and stock markets in other 12 countries.
All the above discussions support our assumption that there are complex coupled relationships between not only financial markets in the same country (intra-country market coupling), but also the same markets in different countries (inter-country market coupling), we call this hierarchical cross-market behaviors. Also, the above analysis provides the potential of predicting the movement of a stock market 2 Here we choose Special Drawing Right (SDR) as its numeraire is a potential claim on the freely usable currencies of the International Monetary Fund (IMF) [27]. 3 Eight developed European countries, USA and BRIC (Brazil, Russia, India and China). BRIC accounted for more than 25% of the world's total GDP according to IMF. based on exploring complex coupling relationships within and between market behaviors. We discuss this in detail hereafter.

B. PROBLEM FORMALIZATION
This paper aims to forecast stock market trends based on hierarchical coupled market behaviors. The problem can be formalized as follows: the coupling function f (·) here is used to capture the complex hierarchical coupling relationships between different financial markets and countries, and the objective function g(·) is built to forecast the possibilities of two trends (upward and downward) for stock market on the following trading time, namely g S (up) represents the possibility of an upward trend in a stock market while g S (down) represents the possibility of a downward trend. If at time t, then time t + 1 is a upward trend, otherwise is a downward trend.
In order to perform the forecasting, our key task now is to build a proper model to determine the specific coupling function f (·) and the corresponding objective function g(·). Below, HCBA is introduced to understand the hierarchical coupled cross-market behaviors, some definitions are given, and then MCHMM is explored to capture the two-layer complex coupled relationships between multiple markets in different countries.

IV. MODELING FRAMEWORK A. HIERARCHICAL CROSS-MARKET BEHAVIOR ANALYSIS
Coupled cross-market behaviors refer to the activities from multiple markets with inter-and intra-relations between markets, while Hierarchical cross-market behaviors represent the two-layer coupled cross-market behaviors, Layer-1 is intra-country market coupled behavior, namely the coupled behaviors between markets in the same country, and Layer-2 is inter-country market coupling which represents the coupled behaviors among different countries. Suppose there are K countries {C 1 , C 2 , . . . , C K }, an country C k owns I mar- reflects the q th behavior property. Then a Market Behavior Feature Matrix with country C k FM (MB C k ) is defined as follows: Hence, Layer-1 coupling is the relationships within one Market Behavior Feature Matrix, including the relationships within one row and the couplings embodied through the columns. Layer-2 coupling is the coupled relationships between different Market Behavior Feature Matrixes. Definition 1 Hierarchical Market Behaviors: Hierarchical Market Behaviors (HMB) refer to two-layer coupled market behaviors. Level 1 MB 1 is the intra-country market coupling, which represents the coupling relationships between different markets behaviors Level 2 MB 2 is inter-country market coupling, which represents market behaviors MB C 1 i 1 j 1 and MB C 2 i 2 j 2 that are coupled in terms of relationships f (η(·)), where (i 1 Then Here f (θ (·), η(·)) is the coupling function denoting the corresponding relationships between different MB. θ(·) is the intra-country market coupling function, capturing the coupled relationships between markets in the same country. η(·) is the inter-country market coupling function, representing the coupled relationships between the same markets in various countries.
where T m is the number of market behavior instances for the m th market behavior sequence, f (·) illustrates the coupling relationships between two market behavior sequences (MB i ) and (MB j ), which can be represented by r ij which is a set for all m market behavior sequences ((1 ≤ i, j ≤ m)). So if r ij = ∅, there is no coupling relationship in market behavior sequences (MB i ) and (MB j ), and the bigger the r ij , the stronger the relationship between the two market behavior sequences (MB i ) and (MB j ).
Definition 3 Hierarchical Cross-Market Behavior Analysis: Hierarchical Cross-Market Behavior Analysis (HCBA) is to build the objective function g(·) under the condition that market behaviors between different markets and various countries are coupled with each other by coupling function f (·), and satisfy the following conditions: where θ (·) is the Layer-1 coupling, while η(·) captures Layer-2 coupling relationships.
The above discussion gives the basic concept of HCBA, and the vector-based market behavior representation shows us a roadmap from understanding to modeling HCBA in real financial markets. In the following we develop a MCHMM to model the HCBA and the specific mapping process will be introduced in Section 5.

B. MULTI-LAYER COUPLED HIDDEN MARKOV MODEL
The standard CHMM is briefly introduced in Section 2.3, and more details can be found in [29]. It is often used to model multiple processes with coupling relationships, but it cannot handle the complex hierarchical coupled relationships between markets in different countries, as mentioned above. We then propose a Multi-layer CHMM (MCHMM) architecture to fit the HCBA framework for solving problems such as capturing complex couplings between markets within one country and between countries.
As shown in Figure 4 with two countries (C 1 , C 2 ) as an example, each country owns two financial markets M 1 , M 2 . There exist two-layer coupled behaviors, Layer-1 is intracountry market coupling from the market aspect, where the state of one market in a country depends on the state of the markets in the same country (for example, the state of ). Layer-2 is inter-country market coupling from the country perspective, namely the state of one market in one country also relies on the state of the same markets in other countries (for example, the state Z C 1 M 1 t+1 relies on Z C 2 M 1 t ). The above discussion suggests the urgent need to build a MCHMM to model the complex hierarchical coupled interactions among different markets in various countries. Suppose there are K countries {C 1 , C 2 , . . . , C K }, a country C k owns I markets {M 1 , M 2 , . . . , M I }, and the elements of a MCHMM are as follows: VOLUME 7, 2019 Prior probability of initial state π = {π H is the number of states of the Markov chains, {Z 1 , Z 2 , . . . , Z H } is a set of hidden states, where z t is the hidden state at time t. V is the number of observation symbols, Then the state joint transition probability is: Based on the above discussion, similarly to standard CHMM, below we refer to the complete set of parameters of a MCHMM as = {A, B, CR, π}.

C. PARAMETER ESTIMATION
Here we can derive the P(O| ) by extending the forwardbackward procedure in [29]. The corresponding forward variable is calculated as follows: Then, P(O| ) can be represented by forward variables: From the above we can see that the corresponding parameters ω ∈ satisfy equality constraints, i.e. the sum equals to one. This leads us to learn the parameters by constrained optimization techniques. Here we solve it by the Lagrange multiplier method, following the discussion in [30]. It can be verified that P(O| ) is locally maximized when ω = ω∂P(O| )/∂ω ω∂P(O| )/∂ω (11) where ∂P(O| )/∂ω = k,i ( P(O| ) ) is derived similar to [29].
When each ω ∈ is estimated by Equation (11), we finish one iteration of optimization. P(O| ) is guaranteed to converge to some local maximum by iteratively updating w.r.t. (cf. Theorem 2 in [29]).

V. FORECASTING METHODOLOGY
This section describes the methodology to forecast the stock market trends: data preprocessing, modeling the cross-market behaviors using MCHMM, and forecast market trends.

A. DATA PREPROCESSING
To better fit the financial time series data into the MCHMM, here we mainly focus on the following two parts.

1) INDEX SELECTION
As mentioned above, in this paper there are 13 major countries and each country has two financial markets (stock market and currency market). In the MCHMM, we use one Markov chain to represent a market, and here we select two countries which have higher correlations with the stock market in the target country (US stock market) to build Layer-2 coupled relationships (inter-country coupling). This is because our focus is on the coupling relationships among 158568 VOLUME 7, 2019 various countries, hence higher correlation with the target market encloses a stronger discriminative power.

Definition 4 Country Index Correlation (CIC):
Suppose there are K countries {C 1 , C 2 , . . . , C K }, a country C k owns I markets {M 1 , M 2 , . . . , M I }, C k M i is the target market in target country, CIC C k M i ,C k M i refers to the correlations of the target market indexes in other countries where ρ DCCA is the cross-correlation coefficient indicated in Section 3.1.

2) DATA DECODING
The data we choose for each index is the weekly closing price.
Since the data may show various data types in different financial markets among various countries, this may lead to an extremely large set which would make the MCHMM exceedingly complex. Therefore, to better fit the MCHMM used after, it is imperative to find a way to encode the observed closing price into a set of symbols suitable for the MCHMM. Many researchers choose to use the return as the symbol which can be calculated by RI t = PI t −PI t−1 PI t−1 * 100%, here RI t and PI t are, respectively, the return and closing price at time t.
In this paper, we will use a discretization method to replace the return. This is because from the distribution perspective, the price change is not a uniform distribution, namely the returns which is a linear segment cannot represent it correctly. For example, the stock price change limit is 10%, but ∧ DJI weekly changes are around [-2%, 2%] from Jan 2008 to Dec 2018, and very limited changes achieve around 10% (-10%), which means the group [-2%, 2%] owns more data and the length of the segment should not be linear. So it is improper to choose the returns as the symbols.
The mapping of weekly returns into discrete symbols is similar to the quartile, which is a type of quantile. It is calculated as follows: we use four points that divide the data set into five groups: the first point is defined as the middle number between the smallest number and the median of the data set; the second point is the median of the data; the third point is the middle value between the median and the highest value of the data set; and the fourth point is the 0 4 . After this, each interval is associated with a different symbol, for example {−2, −1, 1, 2, 3} (upward symbol O + = {1, 2, 3} and downward symbol O − = {−2, −1}), and every return belongs to a particular interval is associated to the same symbol.

B. MCHMM-BASED HIERARCHICAL MARKET BEHAVIOR MODELING
Here, we model the forecasting problem in terms of HCBA and the MCHMM, which can be divided into two mapping processes: one from HCBA to the MCHMM, and 4 It is the break point of uptrend and downtrend.
another from the MCHMM, to the specific stock market trend forecasting problem. The first mapping process is to map the HCBA-based cross-market behaviors to a MCHMM model which captures the hierarchical coupling relationships between markets within and between countries, and the second is to handle the forecasting problem with the produced MCHMM.

1) MAPPING PROCESS FROM HCBA TO MCHMM
Following the general problem definition of cross-market behavior model by HCBA, we model the couplings in crossmarket in terms of Layer-1 and Layer-2. We select two countries (C 1 , C 2 ) that have the higher correlations with the target country C u , and two markets (stock market and currency market) from each country. Correspondingly, there are two Markov chains built for each country, namely HMM-C u M s and HMM-C u M c enclosing the stock market sequences ( (C u M s )) and currency market sequences ( (C u M c )) in the target country respectively, HMM-C 1 M s , HMM-C 1 M c representing the two sequences in country C 1 , and HMM-C 2 M s , HMM-C 2 M c capturing the two sequences in country C 2 . The representation of coupled market behavior sequences in Equation (4) and (5) shows the possibility of using MCHMM to model HCBA. The mapping from HCBA to MCHMM works in the following way: (HMB)|transition → A(Transitional probability) (14) (HMB)|observation → B(Observation probability) (15) r ij |intra − country → CR 1 (16) r ij |inter − country → CR 2 (17) (HMB)|prior → π (Prior Probability) (18) r(cm, c m) represents the correlations between the same markets in different countries while r(cm, cm ) represents correlations between different markets in same country. P(o C u M s t+1 | O 1:t , ) is to forecast stock market movement at time t + 1 based on the observations from all market sequences in the time interval [1, t] (O 1:t ). Then if the upward trend probability at time t + 1 (P(o C u M s t+1 ∈ O + )) is larger than the downward trend probability at time t (P(o C u M s t+1 ∈ O − )), time t +1 is an upward trend, otherwise the downward trend.

C. STOCK MARKET FORECASTING PROCESS
The above section explains how to convert the HCBA framework to stock market trend forecasting by implementing a MCHMM. Below we discuss the specific process for the forecasting, namely how to calculate the P(o C u M s t+1 ) | O 1:t , ). Figure 5 illustrates the general framework of the proposed forecasting process. At each time interval [1, t] (the length here is T), the first step is to train the MCHMM using the most recent T observations (O 1:t ) in the six market sequences mentioned above, and then we can obtain the current model = {A, B, CR, π} (every T days, the parameters in the MCHMM will be reestimated using the most recent T observations). After this, based on the trained model and the T observations O 1:t , the MCHMM gives the probability distribution for the following movements of the stock market in the target country at time t + 1. Then we can obtain the stock market trend at time t + 1 through comparing the probabilities of forecasted the upward trend P(o C u M s t+1 ∈ O + ) and the downward trend P(o C u M s t+1 ∈ O − ) at time t +1. w is the number of forecasting points, namely the number of sliding windows. The specific deviation steps are as follows 5 : 5 Here we omit the , rather than fixing it for simplicity. The conditional independence properties are used [31]. where z t is the states at time t from all the market sequences mentioned above.
Equation (23) can be evaluated with the following steps: firstly, we will run a forward recursion, from which we will obtain P(z t , . After this, we compute the final summation over z t and z t+1 . Then we will obtain the probabilities of upward and downward trends at time t + 1. Once the observation at time t + 1 is observed, we can run the α recursion forward to the next step in order to predict the subsequent movement at time t +2, and this can carry forward indefinitely.

D. THE FORECASTING ALGORITHM
With the probabilities obtained from Equation (26), we further determine the specific follow-up trend of the stock market through comparing the probabilities of the following two trends (upward and downward). The corresponding algorithm is described in Algorithm 1. The input is the observations of all market sequences O i (O i = O i:t+i−1 ), and the time interval is T . It is a loop process to obtain w times of forecasting, namely the number of forecasting windows is w. We firstly train the model i (1 ≤ i ≤ w) according to the observations O i (O i = O i:t+i−1 ), then we forecast the probabilities of two trends respectively. The output of the algorithm includes two sets: upward set UWS and downward set DWS, and the total objects in the two sets is w.

VI. EXPERIMENTS A. EXPERIMENTAL SETUP 1) DATA SET
In this section, we illustrate the use of the MCHMM for predicting US stock market movements based on capturing the hierarchical coupling relationships between the financial markets in various countries. Thus, the data set of interest is the historical prices of indexes in different financial markets. We choose two countries Netherlands and Germany which have the high correlations with the US based on Equation (12), and two types of markets: the stock market and currency market within these three countries for the case studies. Compute the probability of the two trends given the model i and observations O i at time t + i, respectively:  The data set used in this section includes weekly closing prices from Jan 2008 to Dec 2018, obtained from the Economic Research 6 , and the prices are decoded into symbols based on Section 5.1.2. As indexes in different markets may appear on different trading days, we delete those days on which some market data is missing and only choose the days with trading data from all financial markets.

2) PARAMETER SPECIFICATION
• Specification of the MCHMM Elements The MCHMM elements are shown in Table 2. As mentioned in Section 5, there are three related countries and each country has two markets, so the number of Markov chains is six. In this paper, the number of states is set equal to 10 based on the tests in the experiments. In addition, the size of the forecasting window, namely the forecasting interval T, was chosen which is neither too long (because of the uncertainty), nor too small (because of the high volatility of prices). So, according to the domain knowledge and several tests in the experiments, here we set T equal to 39 weeks.
• MCHMM Initial Parameter Settings Good starting values for parameters in the algorithm can help in speeding up the algorithm and ensuring promising results. Several possible kinds of initializations have been proposed. Using random starting values for the parameters and starting the algorithm from several different starting points and then selecting a better one is often used by 6 http://research.stlouisfed.org/ researchers [32]. Here the initial parameter value of π, A and B follow the random selected method.

B. FORECASTING BENCHMARKS
We compare the technical and business performance of our MCHMM-based approach with the following approaches: • ARIMA This is a statistical method for analyzing and building a forecasting model which best represents a time series by modeling the correlations in the data. Taking advantage of its strictly statistical approach, the ARIMA approach only requires the prior data of a time series to generalize the forecast. The form of an ARIMA(p, d, q) model is as where p is the number of autoregressive terms, d is the number of non-seasonal differences, q is the number of lagged forecast errors, φ i are the regression coefficients, θ i are the parameters of the moving average part, ε t are error terms and L is the lag operator. New forecasts can be made for the process Y t = (1 − L) d X t , using a generalization of the method of autoregressive forecasting.
• Logistic This is used for predicting the outcome of a categorically dependent variable based on one or more predictable variables. Suppose Y t = 1 represents an upward trend at time t, and Y t = 0 represents a downward. P t is the probability of having an upward trend at time t, is explanatory variable, ε is the error term. Then the log-likelihood function is written as: , where T is the number of periods. The parameters can be obtained through MLE.
• ANN ANN is a processor made up of massively parallel distributed simple processing units, which has a natural propensity for storing experiential knowledge, doing logical and quantitative analysis, and generalizing new information from acquired knowledge. An ANN network consists of an interconnected group of artificial neurons and processes information using a connectionist approach, with functions to map input values into output values. In recent years, one major area of application for ANN is time series forecasting. Here we will use ANN similar to [11], [33], with the cross-market data series.
• CHMM The different performance of CHMM and MCHMM will reflect the effect of hierarchical coupled analysis (the inter-country couplings). Here we use CHMM as a benchmark, and the specific steps refer to [29].
• Buy and Hold The buy and hold strategy is a long-term investment strategy based on the view that in the long run financial markets give a good rate of return despite periods of volatility or decline. According to the trading strategy, an investor buys an asset and holds it for a long period of time. In our case, the investor uses the strategy to buy the stock market index in the beginning and maintains this position during the whole trial.

C. PERFORMANCE METRICS
We compare the performance of the MCHMM based approach and other approaches from technical and business perspectives.

1) TECHNICAL PERSPECTIVE
• Accuracy. Accuracy is the percentage of correctly classified instances. Accuracy=

TN +TP
TP+FP+FN +TN , where TP, TN, FP and FN represent true positive, true negative, false positive and false negative, respectively. We treat the upward trend cases as the positive class here.
• Precision. Precision is the percentage of correctly classified positive instances. Precision= TP TP+FP . • Type I error. The percentage of the number of times with no upward forecasting when there is an upward trend, against the times that there is an upward trend.

2) BUSINESS PERSPECTIVE
Here, we analyze the returns obtained by an investor who uses the predictive outcomes of each approach to make trading decisions. The trading strategy adopted by the investor is as follows: if the approach forecasts an upward trend, the investor makes a buy decision in the stock market, otherwise, if there is a downward trend from the forecasting, a sell action is taken.
• Rate of Return (ROR). This is the ratio of money gained or lost on an investment relative to the amount of money invested.  Tables 3 and 4, and Figures 6 and 7. Table 3 shows the performance of the five approaches over the whole testing period, while Table 4 gives the accuracy of the five approaches in each financial year. From the two tables we can see that our MCHMM-based approach has the best performance, both over the whole time period and yearly. For instance, the MCHMM has the highest accuracy increase of about 15% improvement over the ARIMA approach, and has around a 10% gain over the Logistic and ANN methods.    Figures 6 and 7 show the technical performance, where the horizontal axis (P-Num) stands for the number of detected upward trends, namely the number of trading weeks with upward trends in the US stock market, and the vertical axis represents the values of technical measures. We can see that the MCHMM performs the best, followed by the CHMM. For example, precision improvement could be as high as about 20% against the ARIMA approach, and around 5% against the CHMM method when P-Num is bigger.
The results in the above tables and figures lead to the following conclusions: our MCHMM-based approach has the best performance compared to other approaches. This clearly shows that the HCBA is a promising approach in stock market trend forecasting. The main reason being that it can capture the hierarchical coupled hidden relationships between different financial markets in various countries. Also, the MCHMM is demonstrated as a useful tool to undertake HCBA.

2) BUSINESS PERFORMANCE
Here, we compare the performance of our approach against the other five approaches from a business perspective.     Tables 5 and 6 illustrate ROR and ARR results, as ROR and ARR indicators are important for investors to validate the actionability of outcomes in real financial markets. The tables show that our approach performs much better than the other approaches. For instance, our approach is with the highest ROR and has a gain of about 13% compared to the ARIMA method by 2015, and 8% over CHMM model by 2018. During the whole testing period, our MCHMM-based method has the biggest ARR, and higher by 8% than ANN and around 3% than the best performing CHMM. Figure 8 shows an investor's wealth evolution by investing six trading strategies from Jan 2014 to Dec 2018. We have the following settings for the investment: (1) the initial capital investment is USD100; (2) no new capital will be added thereafter; (3) the investor buys and sells the index according to the trends forecasted by each approach (buy when there is an upward forecasting and sell while downward); (4) there are no transition fees. The following conclusions can be drawn from the figure: the MCHMM-based approach performs best, that is, an investor taking the recommendations from the approach can make profit at $156.60, which represents a return of 156% in five years after the financial crisis period. MCHMM-based HCBA has been demonstrated to be a useful tool to help investors to make wiser trading decisions. In addition, our approach and the standard CHMM perform better than other five approaches, which verifies that hierarchical coupled relationships really exist among the financial markets in various countries.

VII. CONCLUSION
Predicting market trends is very challenging especially under the fluctuation of financial markets due to financial recession and crisis. The analysis of hierarchical coupling relationships between relevant markets and multiple countries can contribute to the forecasting of market movements and resultant investment profitability. In this paper, we propose a hierarchical coupled cross-market behavior analysis framework and a MCHMM to capture the complex hierarchical coupling relationships between various markets in different countries; the MCHMM-based forecasting model further predicts the movements of a market by considering the couplings with other markets across countries. The results show that the recommendations from the proposed method can gain better investment outcomes compared to those from ARIMA, Logistic, ANN, CHMM and the Buy and Hold strategy.
WEI CAO received the Ph.D. degree in information technology from the University of Technology, Sydney. She is currently an Associate Professor with the School of Economics, Hefei University of Technology. Her research interests include data mining, machine learning, deep learning, and coupling analysis in finance.
WEIDONG ZHU received the Ph.D. degree in management science and engineering from the Hefei University of Technology. He is currently a Professor with the School of Economics, Hefei University of Technology. His research interests include evidence theory, decision theory, and data mining, with applications in: business management and finance.
YVES DEMAZEAU received the Ph.D. degree from INPG Grenoble. He is currently an ECCAI Fellow and the Doctor Honoris Causa at SDU Odense, the Director of Research at CNRS and an Invited Professor at SDU, and the President of the French Association for AI (AFIA), since 2011. His current research in AI includes user centration, ethics by design, organizations dynamics, observation and evaluation, with applications in: energy management, financial modeling, and social network analysis. 158574 VOLUME 7, 2019