Abstract

The main objective of this paper is to analyse investment returns using a stochastic model and inform investors about the best stock market to invest in. To this effect, a Markov chain random walk model was successfully developed and implemented on 450 monthly market returns data spanning from January 1976 to December 2020 for Canada, India, Mexico, South Africa, and Switzerland obtained from the Federal Reserves of the Bank of St. Louis. The limiting state probabilities and six-month moving crush probabilities were estimated for each country, and these were used to assess the performance of the markets. The Mexican market was observed to have the least probabilities for all the negative states, while the Indian market recorded the largest limiting probabilities. In the case of positive states, the Mexican market recorded the highest limiting probabilities, while the Indian market recorded the lowest limiting probabilities. The results showed that the Mexican market performed better than the others over the study period, whilst India performed poorly. These findings provide crucial information for market regulators and investors in setting regulations and decision-making in investment.

1. Introduction

According to Tealab [1], time series is a general problem of great practical interest in many disciplines, including economics and finance. Tealab [1] acknowledged that time series allows one to discover future series values from past values with some margin of error. In the late 70s, Box and Jenkins did important work in studying linear mathematical models for time series data [2]. These models are autoregressive (AR), moving average (MA), and their extensions (ARMA and ARIMA). However, these linear models are based on some distributional and dependency assumptions that most time series data do not often exhibit. This led to the development of GARCH and EGARCH models to account for error terms’ dependence on time series data.

It has, however, been observed that most real-time series appear to follow nonlinear behaviour and that the approach by Box and Jenkins is not sufficient to represent their dynamics [3, 4]. Hence, in the most relevant literature, a wide range of models that suggest different mathematical representations of the nonlinear presence in data have been presented, such as models based on schemes [5] and different types of artificial neural networks (ANNs) [4, 68]. Other researchers have presented hybrid models of ANNs and others [912].

Furthermore, due to challenges of volatility and randomness, which bedevil most statistical time series models, some researchers have resorted to the stochastic model presentation of time series, ignoring the random walk nature [1214]. Though the theory of random walk was initially associated with market returns, a lot of stochastic time-series research [15] does not include the random walk characteristics.

One of the time series data that have much attention from researchers is stock market returns. Stock market returns facilitate the trading of shares of companies or organisations in a country [16]. The strength of the economy can be determined by looking at the stock market. Increased investments are correlated with higher share prices, and decreased investments are correlated with lower share prices. Earning profit is everyone’s goal when they invest in the stock market. However, because the stock market is a highly volatile financial market, an investor’s success or failure will depend greatly on the choices made. This depends on his understanding of the stock market and the strategies or models used to forecast price fluctuations that may occur as a result of a wide range of different factors. Many models have been used over the years to attempt to predict the behaviour of the movement of stock prices to minimise if not eliminate the risk of suffering losses in the stock market. Hossain and Ali [17] noticed that the daily stock price exhibits randomness. Therefore, finding the right model for prediction and analysis has been a concern for many researchers. For instance, Adesokan et al. [18] claim that the geometric Brownian motion (GBM) can only be used to predict prices for a maximum of two weeks, even though their research focused on small businesses. Also, the GBM fails to account for periods of constant values [19]. The Capital Asset Pricing Model (CAPM) uses a risk-free rate in determining the expected return, but this risk-free rate is also susceptible to volatility. All of these shortfalls give fuel to the debate as to which model is reliable for making decisions in the stock market. Hence, there is a continuous need to come up with new models or review and upgrade existing models to try as much as possible to reduce to the barest minimum the chances of failure in investing in a stock market. The importance of making well-informed decisions that would enhance the chances of success in the stock market cannot be overemphasised; one needs to observe the trend and behaviour of equity before purchasing stakes in it, as the size of loss which may arise from poor decisions cannot be overlooked. Since the stock market is a volatile market which has the random walk property, models which capture volatility would be expected to inform good predictions. Therefore, the goal of this paper is to propose a method for analysing investment returns as a Markov chain random walk where the assumptions of Markov chain and randomness are incorporated. In this paper, the Markov chain is defined as the number of consecutive changes in the investment return of a stock market with infinite state space. The data used were 450 monthly returns from five randomly selected countries, and the limiting probabilities and the mean recurrence times of the Markov chain were estimated to determine which of the selected countries exhibited the least risk for investment.

The rest of the paper is organised as follows. Section 2 reviewed some related literature on the paper. Section 3 involves the theoretical framework, which reviews the relevant definitions and theorems (with proofs where necessary) based on the methodology developed. Section 3 also contains a model specification, which provides the mathematical basis for estimating the parameters of the model to be used. Estimation of model parameters which discusses the estimation procedure then follows. In Section 4, the proposed model was applied to real-life data and the results were presented. Section 5 provides conclusions and recommendations of the study.

2. Review of Literature

The most prominent feature of the stock market is its volatility; hence, many researchers have investigated the risk-return trade-off in various stock markets. For instance, Fang et al. [20] investigated the risk-return trade-off in the Vietnam stock market from 2007 to 2014. They noticed that in emerging stock markets, systematic risks continue to dominate asset returns and that idiosyncratic risk has little bearing on stock market pricing. Fang et al. [20] focused on the volatility of one stock market (the Vietnam stock market) using idiosyncratic volatility and conditional idiosyncratic volatility, while this study investigated the volatility of 5 stock markets across the world using a random walk Markov chain. Amiri et al. [21] investigated the risk-return trade-off in the stock market by accounting for the presence of noise traders. The noise traders present the group of investors who either base their investment strategies on feelings or hold unjustified optimistic/pessimistic views regarding market prospects. Amiri et al. [21] analysed the volatility of the US stock market using the Baker and Wurgler sentiment index and the Michigan Consumer Confidence Index, while this study analysed the volatility of stock markets using Markov Chain random walk. Jayawardena et al. [22] used high-frequency data of related assets traded in other markets where intraday data are available to examine the risk-return trade-off in the Australian Securities Exchange (ASX). Jayawardena et al. [22] focused on risk-return trade-off, while this study focused on the volatility of stock market returns.

Another aspect of the stock market that has been investigated is the efficiency of the stock returns [23, 24]. For example, Zhu et al. [24] examined the efficiency of 7 Latin stock returns using mean-variance analysis, Hurst exponent and runs, and variance-ratio tests. The seven Latin American stock markets include Colombia, Argentina, Brazil, Chile, Ecuador, Peru, and Mexico’s daily stock returns from January 2003 to December 2014. Their results show that the randomness and efficiency of various Latin American markets have improved after the recent global financial crisis (GFC) in most of the stock markets. Derbali [23] employed runs, autocorrelation, and unit root analysis to examine the market efficiency in emerging and Frontier markets in the Middle East and North Africa (MENA). Using daily and weekly market index returns, their results indicate that both emerging and frontier markets show a lack of market efficiency. These researchers assessed the efficiency of the stock returns using mean-variance analysis, Hurst exponent and runs, and variance-ratio tests without considering stochastic models, and this study bridged the gap by using the Markov chain to assess the efficiency of stock markets.

Some researchers have also examined the links between the stock market index and commodities such as crude oil and natural gas. Nagayev et al. [25] investigated the relationship between commodities such as gold, gas, agriculture, and livestock and the Islamic equity index. Their results revealed that the link between commodities and Islamic equities is time-varying and volatile. Chebbi and Derbali [26] use Dynamic Conditional Correlation (DCC) to examine the dynamics of the correlations between commodities (crude oil and natural gas) and Islamic indices. The empirical results indicate that the volatilities of commodity returns are strongly correlated to those of the stock index. The articles reviewed under this section focused on the relationship between stock market indexes and commodities, while this study assessed the volatility of stock market returns.

Other researchers have resorted to stochastic models in analysing the stock market indices [12, 15]. Using the properties of the time-homogeneous, the Markov chain model was established by Zhang and Zhang [27] to examine the daily stock market index of China to avoid the blind and irrational behaviour of investors. Mettle et al. [15] modelled share prices as geometrically ergodic Markov chains with countably infinite states based on ideas about stochastic processes elsewhere. Some researchers have also used random walk-in analysis of the market efficiency of countries based on the stock market. For example, Dias et al. [28] used a random walk to examine the market efficiency of US, Chinese, and European capital markets within the context of the global COVID-19 pandemic. However, these studies do not factor in the random walk nature into stochastic models.

From the literature reviewed, even though all papers focused on the volatility or the efficiency of the stock market, they do not consider the stock market randomness in the stochastic models. Hence, this paper contributes to the literature by adding the random walk characteristics of the stochastic Markov chain model to enhance good decision-making in investment.

3. Materials and Methods

This section entails a theoretical framework which reviews the relevant definitions and theorems (with proofs where necessary) upon which the methodology is based, followed by research design, estimation techniques, model specification, and a detailed explanation of the estimation of model parameters.

3.1. Theoretical Framework

This section of the paper reviews relevant definitions and theorems, most of which are without proof, to this study. The proofs of the theorems may be found in Bhat [29] or any standard textbook on stochastic processes.

Definition 1. Stochastic Process.
A stochastic process is a set of random variables that are known as the parameter space of the process, and the set of all possible values assumed is called the state space of the process. Each of the spaces can be continuous or discrete. Hence, one can talk about four types of stochastic processes depending on the type of space. The study considers the processes with discrete state space and discrete parameter space.

Definition 2. Probability Distribution.
Suppose that . Then, the functionwhere the state space, is called the conditional distribution function of a stochastic process . The probability in (1) is called transition probability.

Definition 3. Time-Homogeneous.
The stochastic process is said to be time-homogeneous ifThus, the probability depends on the time difference and not on the points in time. If they do not, the processes are not time-homogeneous.

Definition 4. Markov Dependence.
The stochastic process with state space is said to exhibit Markov dependence iffor any and all .
Stochastic processes with discrete state space which satisfy equation (3) are called Markov chains.
The most powerful equations in the analysis of Markov chains with discrete parameter space known as the Chapman–Kolmogorov equations are discussed presently.

Definition 5. The Chapman–Kolmogorov Equations.
For a Markov chain with discrete parameter space.where are the time parameters and . is the state space and are the states, i.e., . is the probability of moving from state at time to state at time . is the probability of moving from state at time to state at time . is the probability of moving from state at time to state at time .

Definition 6. One-Step Dependence Assumption.
For a Markov chain with discrete parameter space, the probability of state at time given state at time isThe assumption of time homogeneity (stationary) implies, we can writeIf , it can be shown by the total probability rule thatwith being the initial time.
In the matrix form (7) can be written aswhere and is a square matrix.
The result of repeated application of equation (8) iswhere is the matrix raised to the power . The elements of matrix satisfies the following postulates.(a)(b)A square matrix, whether finite or infinite that satisfies these two postulates is called a stochastic matrix or a transition probability matrix or simply a transition matrix.
Similar definitions exist for nonhomogeneous chains, which may be obtained from any standard book on stochastic processes.

Definition 7. n-Step Transition Probability.
For a Markov chain with discrete parameter space, the probability of state at time given state at time (the n-step transition probability) is.If the process is time-homogeneous, equation (10) becomesThe following is a theorem that deals with n-step transition probabilities for time-homogeneous Markov chains.

Theorem 8. n-Step Transition Probabilities for Time-Homogeneous Markov Chains.

If a time-homogeneous Markov chain is subject to the transition matrix , then the n-step probabilities are the elements of the matrix (i.e., raised to power n).

Proof. By using the Chapman–Kolmogorov equations and acknowledging the Markovian property, the proof can be established by mathematical induction.

Definition 9. Communication Relation .
The state is said to be accessible from state , if can be reached from in a finite number of steps. If two states and are accessible to each other, then they are said to communicate. Consequently, the communication relation is an equivalence relation since it exhibits reflexivity, symmetry, and transitivity [29].

Definition 10. Irreducible.
A Markov chain is irreducible if all its states belong to one equivalence class (i.e., all its states communicate).

Definition 11. Periodicity.
The period of a state is defined as the greatest common divisor of all integers , for which . When the period is 1, the state is said to be aperiodic. States in the same equivalence class have the same period, which is also the period of that class.

Definition 12. Recurrent.
A state is said to be recurrent if starting from state , eventual return to this state is certain.
When state is recurrent, its mean recurrence time iswhere is the mean recurrence time in state , and is the probability that starting from the process returns to for the first time in steps.

Theorem 13. Limit of Markov Chain.

Let be the transition probability matrix of an aperiodic and irreducible Markov chain. Then,where with and . is the limiting probability of the column of the Markov Chain, and is the number of columns of the limiting matrix and represent the steps.

Proof. If is a transition probability matrix of an aperiodic and irreducible Markov chain. Then, the matrix has no zero element. Let be the smallest element of . Let be an -component column vector with a in the place and elsewhere. Further let and be the minimum and maximum components of the vector . Clearly, and . We haveWriting in and , we obtainLet ; we then havewhich shows that as , , and hence and approach a common limit.
Also, is the column of approaches a constant, say , as . Further for all but and and hence .
Clearly, for all , which should be true of . Hence, the theorem is proved.

Theorem 14. Limiting Distribution of the Process of Markov Chain
Given the transition probability matrix of an aperiodic and irreducible Markov chain, there exists a unique probability vector such that andwhere is a matrix of identical rows, represented by . The probability vector is the limiting distribution of the process.

Proof. The proof is trivial by noting that from Theorem 13.

3.2. Research Design

This paper employed a descriptive research design. A descriptive study is concerned with the estimations and the relationship between variables [30]. This approach is appropriate for this study since we intend to analyse investment returns for good investment decisions.

3.3. Estimation Techniques

In our paper, we use the Markov chain random walk to analyse the investment returns of the countries. First, we defined the Markov chain to exhibit infinite state space . Then, the limiting probabilities and the mean recurrence times of the state space are estimated from the proposed methods (Markov chain random walk). We then estimate the six-month moving crush probabilities of the investment returns to know the performance of the investment returns of the various selected countries over the period.

3.3.1. Model Specification

Define to be the number of consecutive changes in the investment return of a stock market on the market period. Then so defined, with emphasis on positive and negative changes, is a Markov chain with state-space . If we let the probabilities of negative change, no major change and positive change of the investment return of the market be , , and , respectively; then assuming independence of price change each market period, the one-step transition probabilities are given as follows:with otherwise.

Clearly, the Markov chain exhibits Markov dependence since the current state of the process depends on the state at the immediate past period; for or 0 if and only if the process was at state −1 (i.e., or ) if and only if it was at state at the immediate past market period (i.e. ). Figure 1 depicts the directed multigraph of the process.

Obviously, from Figure 1, the chain is irreducible since all the states communicate and aperiodic because each state has period one. Hence, the chain is ergodic and has a limiting distribution.

Assume  = (, , , , , , ) is the limiting distribution and is the one-step transition matrix of the chain. Then, assuming time homogeneity, equation which is a consequence of Theorem 14, results in the following sequence of equations:

Relation (19) is an infinite sequence of equations which is difficult to solve. However, if it is assumed that at some number ; , , the sequence of equation (19) becomes.which can be solved iteratively. In this paper, we take to be the number of consecutive negative changes in the investment return of a market to crush (market failure). If , the sequence of equation (20) becomes

Now, solving the sequence of equations iteratively in a backwards manner, we havewhich results inwhereandwith

Now, taking and solving for , we have  = 1, which implies that

The truncated limiting distribution of the Markov chain (also a random walk) is

3.4. Estimation of Model Parameters
3.4.1. Limiting State Probabilities

Suppose is the all share index of a stock market at time and let be the investment return at time . Define the indicator functions aswhere is a value to be determined intuitively based on empirical data.

It is clear from equation (29) that . The estimates of r, , and in equation (18) may be obtained, respectively, using proportions.where is the summation of the number of negative changes, is the summation of the number of no changes, and is the summation of the number of positive changes. is the number of investment return in the dataset.

These estimates may then be substituted in equation (26) which will subsequently lead to the estimation of the limiting distribution in equation (28) represented by the components.

The pictorial display may be obtained by plotting the points.where is an estimate of the mean recurrence time of state given as

The paper proposes that markets with comparably lower limiting probabilities (or higher mean recurrence times) for negative states and higher limiting probabilities (or lower mean recurrence times) for positive states are the best-performing markets.

3.4.2. Six-Month Moving Crush Probabilities

Suppose the data resulted in investment returns . Define to be the six-month sliding vector of consecutive investment returns of the original data with . From the sliding vector of consecutive investment returns based on equation (23), we have the sliding crush probability of the given market to be

Substitute equation (24) into equation (34), we have

Again, suppose , and are the corresponding estimates of , and in equation (18), then the sliding crush probability of the given market based on equation (35) iswhere is based on the estimates , and using equation (27). A pictorial display of the crush probabilities may be obtained by plotting the points ; . The best-performing markets are those with smaller crush probabilities.

4. Results and Findings

This section displays the results and findings of the studies. It includes descriptive statistics and estimates of the parameters of increases, stability, and decreases in stock returns. The long-run distributions of random walk by country and six-month sliding crush probabilities by country are also presented in this section. The empirical results are also discussed in Section 4.

4.1. Data and Empirical Tests

The data used in this study are 450 monthly returns per country, spanning from January 1976 to December 2020 for five randomly selected countries (i.e., Canada, India, Mexico, South Africa, and Switzerland). The selection of countries was as follows; firstly, countries with data available from the study spanned time were selected. Then, out of these selected countries, five countries were randomly selected.

The investment returns were computed from the monthly all share index with 2015 as the base year for all five countries obtained from the Federal Reserve Bank of St. Louis (https://fred.stlouisfed.org/categories/32264). The supplementary material attached contains the stock market for all the five countries used for the study. Figure 2 displays the line graphs of all the countries for the period under investigation.

As can be observed, the returns from all the countries are almost stationary and fluctuate around zero. The fluctuations recorded by Canada, South Africa, and Switzerland are comparatively minimal, while those of India and Mexico are comparatively larger, especially in the first half of the period, with Mexico recording a prominent negative spike in November 1987.

4.2. Descriptive Statistics of Investment Returns by Country

Table 1 presents some descriptive statistics of the 540 investment returns for each country. Over the study period, Mexico recorded the highest range , spanning from −56.6% to 36.2%, followed by India with a range of , then South Africa (44.3%; −30.2% to 14.0%), Switzerland (42.4%; −28.2% to 14.2%), and lastly, Canada with a range of 36.2% spanning from −25.0% to 11.2%. These culminate in Mexico recording the highest volatility of approximately 9.0%, followed by India (6.2%), then South Africa (4.9%), with Canada and Switzerland recording the least volatility of approximately 4.0%. Here, the results corroborate the earlier position from the analysis that the returns of India and Mexico exhibit larger fluctuations. Analytical observation of the 95% confidence intervals (CIs) of the mean investment return of the countries over the period indicates that Mexico recorded a significantly higher mean investment return of approximately 2.3%, followed by India with a mean return of approximately 1.2%, then South Africa (0.9%) with Canada and Switzerland recording the least mean return of approximately 0.5%.

4.3. Parameter Estimates by Country

One of the major concerns of this paper is that of analysing the investment returns as a Markov chain random walk and not too many descriptive statistics. This led to the creation of data vectors each of length 540 and containing the values observed on the corresponding indicator variables in equation (29) with .01. The paper considers 1% changes in returns to be negligible. Therefore, we set the parameter theta to be 0.01. Hence, using equation (30), estimates of the parameters r, and were computed for each country. Table 2 shows the estimates by country, and the R-codes employed in the estimation procedure are presented in “Appendix A: R codes 1.”

The estimates in Table 2 for show that Mexico (56.3%) has the highest percentage of investment returns greater than or equal to 1%, followed by India and South Africa with the same percentage of approximately 53.7%, while Canada and Switzerland provided the least percentage of approximately 50.0% each. Concerning the estimates of , India (12.6%) has the least proportion of investment returns in the neighbourhood of zero (i.e., ), followed by Mexico (14.8%), then South Africa (18.0%), and Canada (19.4%) with Switzerland having the largest value of approximately 20.9%. In the case of the estimates of , South Africa (28.3%) recorded the lowest percentage of investment returns less than or equal to 1%, followed by Mexico (28.9%), then Switzerland (29.1%), and Canada (30.7%) with India recording the largest percentage of 33.7%. Hence, one can infer that, over the period under investigation, the Mexican market performed better, while the Canadian and Swiss markets performed poorly.

4.4. Long-Run Distribution of Markov Chain Random Walk by Country

Based on the estimates of these parameters and using equation (23) together with equations (24) through (27), the long-run probability distributions of the Markov chain random walk were estimated and are presented in Table 3, using Excel.

Higher values of limiting probabilities for positive states represent good stock market returns. It implies that the likelihood that the stock market price will consecutively increase is high; hence, investing in such a market is good. Low values of limiting probabilities for negative states indicate that the possibility that the stock market will decrease is low. It is clear from Table 3 that Mexico recorded the least limiting probabilities for all the negative states, followed, on average, by South Africa, then Switzerland and Canada, with India recording the largest limiting probabilities. However, in the case of the positive states, Mexico recorded the highest limiting possibilities for all the states, followed, on average, by South Africa, then Switzerland and Canada, with India recording the lowest limiting probabilities. This implies that the likelihood that the Mexico stock market price index will increase consecutively is high, and the possibility that the Mexico stock market price index will decrease consecutively is very low among the rest of the countries.

These go to buttress the point that the Mexican market performed better over the period under consideration. Figure 3 presents a better appreciation of these results.

For further assessment of the markets under investigation, the study estimated the six-month sliding crush probabilities (from 2016 to 2020) for each country based on equation (34). Figure 3 displays the sliding crush probabilities by country. The R codes for the computation of the sliding crush probabilities are presented in “Appendix B: R codes 2.”

Low crush probability signifies a good-performing market for the six-month sliding period (2016–2020). From Figure 4, it is evident that over the last five years (2016–2020) of the study period, the six-month crash probabilities of India are higher than all the countries, followed by those of Canada. Next is Switzerland, which showed a slight negative trend over the five years, while Mexico and South Africa presented comparably smaller crush probabilities. However, South Africa recorded higher values for the first three years (2016–2018) of the last five years than Mexico, which gave almost stable (no trend) crush probabilities. The last two years presented a situation in which Mexico and South Africa recorded almost the same crush probabilities, with Mexico (which has an increasing trend in crush probabilities) having a slightly higher crush probability during the last two years than South Africa. These show again that the Mexican market performed better over the period under investigation, followed by South Africa, with those in Canada and India performing poorly.

4.5. Discussion of Empirical Results

In choosing the right market to invest in, one should consider the limiting probability values for each market such that the market with the highest limiting probability values for positive states and the lowest limiting probability values for negative states should be considered. It was recorded that Mexico has the least limiting probabilities for all the negative states and the highest limiting possibilities for all the positive states than the rest of the countries, namely, South Africa, Switzerland, Canada, and India. This implies that the Mexican market performed better over the period under consideration. This finding corroborates with Zhu et al. [24], who observed that the Global Financial Crisis (GFC) positively influenced Latin American markets, making them more efficient and random. According to López Herrera et al. [31], the Mexican market was still performing better during COVID-19 than other markets. According to Díaz et al. [32], in choosing the right market to invest in, one has to consider selectivity, timing, and diversification. They explained selection as an analysis of values and focus on the outcome of individual value price movements. The timing involves the forecast of movements in the price of ordinary assets from the values of fixed income as corporate fertilisers and the treasure letters. Diversification, on the other hand, is the construction of the portfolio investor that minimizes risk subject to certain restrictions. They explained that using these criteria Mexican stock market performs well.

5. Conclusions, Practical Implications, Limitation, and Further Research

As observed earlier, the main objective of this study is to analyse investment returns as Markov chain random walk, which was successfully done. The Markov chain random walk is also suitable for modelling investment returns to enhance investment decisions among the stochastic models. The model was used to analyse 450 monthly market returns spanning from January 1976 to December 2020 for each of five randomly selected countries, namely, Canada, India, Mexico, South Africa, and Switzerland.

In the process, limiting state probabilities and crush probabilities were estimated for each country. Mexican market recorded the largest limiting probability values for positive states. This means that when investors invest in the Mexican market, they can earn more returns than in the rest of the other markets. Hence, the Mexican market performed better over the study period, followed by the South African market, then Switzerland and Canada, with the Indian market recording less efficiency.

The paper is of the view that investors should consider the Mexican market in their investment decisions this is because it exhibits the largest limiting probability values for positive states. Therefore, just like other stochastic models, the Markov chain random walk model can also be used to analyse other time series data for policy decisions using the limiting probability values of the states.

The limitation of the study is that of converting the time series data to suit the Markov chain model, which is laborious. However, this is manageable with the use of programming software.

For further research, the paper suggests applying the proposed model to series from other disciplines and analysis of time series as a Markov chain random walk in a varying environment.

Appendix

A. R codes 1

dt < -datav1<-c(rep(NA, 540))v2<-c(rep(NA, 540))v3<-c(rep(NA, 540))for (i in 1 : 540) {if (dt[i] ≤ −0.01) v1[i] < −1 else v1[i]<- 0if (abs(dt[i]) ≤ 0.01) v2[i] < −1 else v2[i] < −0if (dt[i] ≥ 0.01) v3[i] < −1 else v3[i] < −0}a<-sum (v1)b < -sum (v2)c < -sum (v3)n < -sum (v1, v2, v3)r = a/np = b/nq = c/n

B. R codes 2

M < -cbind.data.frame (v1, v2, v3)e < -NAf < -NAY < -c (rep(NA, 3))M1 < -matrix (data = c(rep(NA, 1440)), ncol = 3, nrow = 480)X < -matrix (data = c(rep(NA, 30)), ncol = 3, nrow = 10)for (j in 1 : 10) {e < -NAf < -NAe = 6  (j − 1) + 1f = 6  (j − 1) + 480M1 < -matrix (data = c (rep(NA, 1440)), ncol = 3, nrow = 480)M1 = M[(e : f),]Y < -colSums (M1)X[j, 1] < -Y[1]/sum (Y)X[j, 2] < -Y[2]/sum (Y)X[j, 3] < -Y[3]/sum (Y)}pcrush < -function (r, p, q){d < -((1 − p)(5)) − ((4 qr)  ((1 − p)(3))) 3 qqrr (1 − p)hn5 < -(r(5))/dhn4 < -((r(4))  (1 − p))/dhn3 < -((r(3))  (((1 − p)(2)) − (qr)))/dhn2 < -((r(2))  (((1 − p)(3))−2 qr (1 − p)))/dhn1 < -(r (((1 − p)(4))−3 qr ((1 − p)(2))qqrr))/dh0 < -1hp1 < -(q (((1 − p)(4))−3 qr ((1 − p)(2))qqrr))/dhp2 < -((q(2))  (((1 − p)(3))−2 qr (1 − p)))/dhp3 < -((q(3))  ((((1 − p)(2))−qr)))/dhp4 < -((q(4))  (1 − p))/dhp5 < -(q(5))/dhp < -c(hn5, hn4, hn3, hn2, hn1, h0, hp1, hp2, hp3, hp4, hp5)r0 < -1/sum (hp)pn < -r0  hpreturn (pn)}cp < -pcrush (r, p, q)r < -c(rep(NA, 10))p < -c(rep(NA, 10))q < -c(rep(NA, 10))sx < -matrix(data = c(rep(NA, 110)), ncol = 11, nrow = 10)for (i in 1 : 10) {r[i] < -X[i, 1]p[i] < -X[i, 2]q[i] < -X[i, 3]sx[i,] < -pcrush(r[i], p[i], q[i])}

Data Availability

The data are included in the Supplemental Files as “Stock Market Returns Data.docx.”

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Supplementary Materials

The supplementary material contains the stock returns for all the five countries (i.e., Canada, India, Mexico, South Africa, and Switzerland) used for this study from January 1976 to December 2020. (Supplementary Materials)