A Complex Dynamical Analysis of the Indian Stock Market

This paper seeks to analyze the dynamical structure of the Indian stock market by considering two major Indian stock market indices, namely, BSE Sensex and CNXNifty.The recurrence quantification analysis (RQA) is applied on the daily closing data of the two series during the period from January 2, 2002, to October 10, 2013. A RollingWindow of 100 and step size 21 are applied in order to see how both the series behave over time.The analysis based on three RQAmeasures, namely, % determinism (DET), laminarity (LAM), and trapping time (TT), provides conclusive evidence that the Indian equity market is chaotic in nature. Evidences for phase transition in the Indian equity market around the time of financial crisis are also found.


Introduction
An equity market could be considered as complex dynamical system, with different agents as well as institutions having different time horizons in mind, carrying out transactions that result in complex patterns that are reflected in the data. A complex dynamical/chaotic system may be defined as a type of nonlinear dynamical system which could satisfactorily explain a wide range of phenomena in many natural systems, including biological and physical systems. Such systems appear apparently random in nature but indeed are part of a deterministic process. Their apparent random nature is given by their characteristic sensitivity to initial conditions that drives the system to unpredictable behavior over time. However, in a chaotic system, this nonlinear behavior is always limited by a higher deterministic structure. For this reason, there is always an underlying order in the apparent random dynamics.
Complex dynamical systems are considered to be mathematically deterministic because if the initial measurements were certain, it would be possible to derive the end point of their trajectories. Contrary to classical mechanics, chaos theory deals with nonlinear feedback forces with multiple cause and effect relationships that can produce unexpected results. In such a situation, a chaotic system cannot be understood by the simple disintegration of the whole into smaller parts.
An important characteristic of such a system is sensitive dependence on initial conditions (henceforth SDIC) implying that even a small difference in the initial conditions gives rise to widely different paths after some time interval. In a "normal" deterministic system, all nearby paths starting very close to one another remain very close in the future. Hence, a sufficiently small measurement error in the initial conditions will not affect our deterministic forecasts. On the contrary, in deterministic systems with SDIC, prediction of the future values of the variable(s) would be possible only if the initial conditions could be measured with infinite precision. This is certainly not the case.
Among the constituents of financial markets of a country, equity market plays a significant role. Due to the increased integration among financial markets in the world, they are affected by extreme events like the 2008 financial crisis. Considering the complex dynamical structure of financial markets, the usual deterministic models, even nonlinear models such as GARCH, might not be able to capture the true dynamics of the underlying process. Here, the present study seeks to analyze the dynamics of Indian capital market by applying a novel methodology. An attempt is made to analyze two major Indian equity market indices, namely, BSE Sensex and CNX Nifty, so as to study the performance of Indian capital market. Here the method used is recurrence quantification analysis proposed by Zbilut et al. [1].

Literature Review
Application of recurrence quantification analysis (RQA) in the field of financial markets is of recent origin. Hence there are only few studies available in the literature applying this methodology to financial markets, especially equity markets. Here, we present a quick review of the available studies.
Guhathakurta et al. [2] studied three equity markets, namely, Nifty, Hong Kong AOI, and DJIA, using the RQA. They mainly employed recurrence plots (RP) to capture endogenous market crashes and found evidences for phase transitions before the occurrence of a market crash. Using the same methodology, Bastos and Caiado [3] analyzed the presence of complex dynamical structure in international stock markets. Their results suggest that the dynamics of stock prices in emerging markets is characterized by higher values of RQA measures when compared to their developed counterparts. They analyzed the behavior of stock markets during extreme financial events, such as the burst of the technology bubble, the Asian currency crisis, and the recent subprime mortgage crisis, using RQA in sliding windows. It is shown that during these events stock markets exhibit a distinctive behavior that is characterized by temporary decreases in the fraction of recurrence points contained in diagonal and vertical structures. Similarly, Bigdeli et al. [4] analyzed the dynamical properties of Iranian stock prices using recurrence quantification analysis along with other methods. They found evidences of seasonality and nonstationarity in the data analyzed. The results confirmed presence of chaotic behavior in the Iranian equity market.
O. Piskun and S. Piskun [5]  crisis, and discussed the use of the measure "laminarity" to identify market bubbles. In a recent study, Moloney and Raghavendra [6] examined the DJIA using RQA and found evidences for phase transitions as the markets move from Bull to Bear state. There were also evidences for a nondeterministic regime when the market reaches its peaks. The authors used noise trader theory to support the findings.
From the available literature, it is evident that the RQA could be useful in capturing the dynamical properties of an equity market. A comprehensive study on the dynamical nature of the Indian equity market is yet to be carried out to the best of the author's knowledge. The present study positions itself in this direction. The remainder of this paper is organized as follows. Section 3 presents the data and methodology used. Section 4 provides the empirical analysis and concluding remarks are given in Section 5.

Data and Methodology
Two major indices from the Indian capital markets, that is, CNX Nifty and BSE Sensex, are selected. Daily closing data from January 2, 2002, to October 10, 2013, are collected and used for the purpose of analysis. To avoid scale difference, we apply a logarithmic transformation to both series. To analyze the dynamical structure, we apply the RQA developed by Zbilut et al. [1]. RQA is essentially quantification of the recurrence plots developed by Eckmann et al. [7]. It is employed to analyze the dynamical structure of a time series based on the property of recurrence. RQA provides various measures that could explain the dynamical nature present in the data. Here, a Rolling Window RQA is proposed so as to capture the time varying dynamics of the Indian capital market indices. Three RQA estimates, namely, percentage determinism (DET), laminarity (LAM), and trapping time (TT), are calculated using a Rolling Window.

Recurrence Quantification Analysis.
The RQA method which is used in the study consists of two parts: the recurrence plot (RP) developed by Eckmann et al. [7], a graphical tool that evaluates the temporal and phase space distance, and recurrence quantification analysis (RQA), a statistical quantification of RP. The basic idea of the RP is that, in a chaotic system, the nearby trajectories visit the same points in the phase space repeatedly. Here, the closeness is measured by a critical radius. A recurrence plot is used to show this behavior graphically. The advantage of the RP is that it could provide an adequate visual representation of a process that happens in the -dimensional phase space in a twodimensional plot.
Let { } be a time series whose trajectories are orbiting in the phase space. If the orbit is one period, the trajectory will return to the neighbourhood of { } after an interval equals 1; if the orbit is two periods, it will return after an interval equals 2, and so on. Therefore, if { } evolves near a periodic orbit for a sufficiently long time, it will return to the neighbourhood of { } after some interval ( ). The criterion of closeness requires that the difference | − + | be very small.
Computing differences | − + |, where = 1, . . . , , = 1, . . . , − 1, and is the length of sample, the close return test detects the observations for which | − + | is smaller than a threshold value . is plotted against + to observe the patterns. If the data is i.i.d., the distribution of points will be random. If the time series is deterministic, it is possible to observe horizontal line segments.
Recurrence plots are symmetrical over the main diagonal. It is based on the reconstruction of time series and an estimation of the points that are close. This closeness is measured by a critical radius so that a point is plotted as a colored pixel only if the corresponding distance is within this radius. The line segments (diagonals) parallel to main diagonal are point that move successively closer to each other in time and would not occur in random. Chaotic behavior produces very short diagonals, whereas deterministic behavior produces longer diagonals. Thus, if the analyzed time series is chaotic, then the recurrence plot shows short segments parallel to the main diagonal; on the other hand, if the series is white noise, then the recurrence plot does not show any kind of structure.
RP may be explained with the help of the examples given in Figure 1. The first RP is created from an i.i.d. noise. We can see that there are no discernable patterns. The next plot is created from a periodic time series. Here, we can see patterns in the plot corresponding to the nature of the data. The third plot is created from a logistic time series with a drift. Here we can see that it is different from the first two. Here, the drift is used to simulate systems with slowly changing parameters. Correspondingly, the upper left and lower right corners of RP are brightened. The fourth RP is estimated from simulated disrupted Brownian motion time series, in order to explore and capture abrupt changes in a system. Here, the extreme events are characterized by white bands/areas in the plot.
From the above example, we can understand that recurrence plots can be quite useful in analyzing the dynamical properties of a time series. However, visual interpretation of such a plot could be difficult at times and may not yield conclusive results always. Hence, Zbilut et al. [1] proposed a statistical quantification of RP, which is the well-known recurrence quantification analysis (RQA).
The RQA was developed in order to quantify differently RPs based on the small-scale structures therein. Recurrence plots contain single dots and lines which are parallel to the mean diagonal (line of identity, LOI) or which are vertical/horizontal. Lines parallel to the LOI are referred to as diagonal lines and the vertical structures as vertical lines.
Whereas the diagonal lines represent such segments of the phase space trajectory which run parallel for some time, the vertical lines represent segments which remain in the same phase space region for some time. The RQA quantifies the small-scale structures of recurrence plots, which present the number and duration of the recurrences of a dynamical system.
The measures introduced for the RQA were developed during the period from 1992 to 2002 [8][9][10]. They are actually measures of complexity. The main advantage of the recurrence quantification analysis is that it can provide useful information even for short and nonstationary data, where other methods fail.
(1) Determinism (DET) is the ratio of recurrence points forming diagonal structures to all recurrence points. DET measures the percentage of recurrent points forming line segments that are parallel to the main diagonal. A line segment is a point's sequence, which is equal to or longer than a predetermined threshold. Here, is the length of the diagonal lines and ( ) is the histogram of diagonal lines. These line segments reveal the existence of deterministic structures within the recurrence plot under analysis. Consider (2) Laminarity (LAM) is related to the amount of laminar phases in the system (intermittency). It is estimated from the amount of recurrence points which form vertical lines. Here V implies the length of vertical lines and (V) is the histogram of vertical lines. Consider (3) Trapping time (TT) is related with the laminarity time of the dynamical system, that is, how long the system remains in a specific state. Consider In the above equation (V) is the frequency distribution of the lengths V of the vertical lines, which have at least a length of V min . While carrying out the analysis, two major parameters that are to be determined are the embedding dimension and the time delay . There are different opinions related to the estimation of these two parameters. It is argued that and should be estimated using methods such as false nearest neighbors and method of mutual information. Another point of view is that it is possible to set = = 1 [12]. Zbilut [13] suggests that a value of = 10 can capture the complexity of a financial market while could be set to be 1 as the financial data is discreet in nature. In this study, we follow the approach suggested by Zbilut.

Discussion of Results
Here we apply a Rolling Window RQA with window length 100 and step length 21 to both series. Figure 2 shows the RQA output of BSE Sensex while Figure 3 shows that of CNX Nifty. After analyzing both outputs, some common trends are visible.
After analyzing % deterministic structure (DET), it is clear that the measure does not show many fluctuations till the point 1000 for both the indices. But after that DET takes a sudden dip around 1500 and remains in a turbulent state thereafter. This point roughly coincides with the collapse of the Lehmann Brothers in USA, an event that is supposed to have triggered the 2008 financial crisis. After this point, the value of DET keeps fluctuating, and takes a dip around the point 2000-2200, a period that coincides with the 2010 Euro zone debt crisis. This behavior indicates that Indian stock markets remained in a state of turbulence after the 2008 financial crisis. Here, it is observed that the fluctuation in DET in BSE Sensex is more than that of NSE Nifty. The changes in DET give clear indication about the possibility of a phase transition taking place in the Indian equity market. We will examine this possibility further with the help of the next measure.
The second measure that we analyzed is laminarity (LAM). It gives an indication about the extent to which a system stays in a particular state. For both the indices, there was a relative stability before the 2008 crisis. However, the value shows a drop around 2008 crisis. Here, we can see evidences for phase transitions within the market from order to chaotic behavior. After the 2008 crisis, it could be seen that the market remained more or less in the chaotic phase for a long term, during the recovery and due to the possible impact from the 2010 Eurozone debt crisis. Towards the end of the graph we could see that the markets are on their way to recovery, indicated by the relatively stable values of LAM.
Trapping time (TT) gives an indication about the time for which a system was "trapped" in a particular state. Here, the value of TT drastically decreases after the point 1500 for both the indices. It could be said that there was increased amount of turbulence in the Indian equity market after the 2008 crisis.

Conclusions
The objective of this paper was to analyze the dynamical behavior of the Indian capital market. For this purpose, two major indices, namely, BSE Sensex and CNX Nifty, were considered and daily closing data for the period from January 2, 2002, to October 10, 2013, was used in the analysis. We took the help of dynamical systems method, namely, recurrence quantification analysis (RQA), to capture the underlying dynamical structure of both markets. We applied a Rolling Window RQA to both the series in order to capture the time varying dynamics of both the indices.
From the RQA measures, it was evident that the Indian capital market was affected by the 2008 financial crisis as well as the 2010 Eurozone debit crisis. The analysis was able to capture phase transitions from order to chaos within the market prior to the crisis period. Hence, recurrence quantification analysis could be used as an early warning system to spot market turbulences.
The results from this study are in line with the previous works that employed RQA to study equity markets. The dynamical nature of the market was confirmed through various measures. Further, transition of the market from one phase to another prior to an extreme event could be successfully captured as well like in the previous studies. Contrary to the main-stream modeling paradigm that depicts the financial markets as an informational efficient system in equilibrium, it was proven here that they are a nonequilibrium type of complex dynamical system.
There are regions of stability, followed by phases of instability. While RQA could be used as an early warning system to identify the possibility of a financial crisis, further research is needed in the development of investment 6 Economics Research International models with underlying assumptions about the dynamical behavior of a market. Real time application of such models for investment purposes may help the market achieve stability.