Analysis of Stock Market Indices with Multidimensional Scaling and Wavelets

Stock market indices SMIs are important measures of financial and economical performance. Considerable research efforts during the last years demonstrated that these signals have a chaotic nature and require sophisticated mathematical tools for analyzing their characteristics. Classical methods, such as the Fourier transform, reveal considerable limitations in discriminating different periods of time. This paper studies the dynamics of SMI by combining the wavelet transform and the multidimensional scaling MDS . Six continuous wavelets are tested for analyzing the information content of the stock signals. In a first phase, the real Shannon wavelet is adopted for performing the evaluation of the SMI dynamics, while their comparison is visualized by means of the MDS. In a second phase, the other wavelets are also tested, and the corresponding MDS plots are analyzed.


Introduction
Economical indices measure segments of the stock market and are normally used to benchmark the performance of stock portfolios.This paper proposes a method for analyzing the correlations embedded in international stock markets.The study of the international stock markets may have different leitmotifs.Economic motivations to identify the main factors which affect the behavior of stock markets across different exchanges and countries.Statistical motivations to visualize correlations in order to suggest some potentially plausible parameter relations and restrictions.The understanding of such relations would be helpful to the design of good portfolios 1, 2 .
The financial time series are inherently noisy, nonstationary, and deterministic chaotic, that is to say the distribution of financial time series is changing over the time.The noise component is due to the unavailability of complete information from the signal behaviour to capture the dependency between past and future values.
The complexity of the problem motivated the adoption of the wavelets for the study of the stock market indices SMIs 3, 4 .A wave is usually defined as an oscillating function of time, such as sinusoid.Fourier analysis is wave analysis.It expands signals in terms of sinusoids or, equivalently, complex exponentials which has proven to be valuable in mathematics and engineering, especially for periodic, time-invariant, or stationary phenomena.A wavelet is a "small wave," which has its energy concentrated in time to give a tool for the analysis of transient, nonstationary, or time-varying phenomena.The wavelet transform allow users to establish a compromise between precision in the frequency and time domains.Several types of continuous wavelets are tested and, based on the emerging patterns, the real Shannon wavelet is considered as the best one for the analysis.The wavelet charts depict complex patterns and, due to the large number of cases, a comparison index is performed.Based on the similarity measure, the multidimensional scaling MDS visualization tool is adopted.MDS is a data analysis technique for depicting the similarity or dissimilarity of data.MDS is used to represent dis similarity data between objects by a variety of distance models.The term similarity is used to indicate the degree of likeness between two objects, while dissimilarity indicates the degree of unlikeness.MDS represents a set of objects as points in a multidimensional space in such a way that the points corresponding to similar objects are located close together, while those corresponding to dissimilar objects are located far apart.The researcher then attempts to make sense of the derived object configuration by identifying meaningful regions and/or directions in the space 5-9 .
The remainder of this paper is organized as follows.Section 2 introduces the financial indices, the fundamental concepts adopted in the study, and the methodology of analysis.Section 3 analyzes the market stocks indices using wavelets.Section 4 presents a MDS analyzes based on wavelets.Finally, Section 5 draws the main conclusions.

Financial Indices: Fourier and Wavelet Transforms
Our data consist of the n daily close values of S 33 stock markets, listed in Table 1, from January 2, 2000 up to December 31, 2009, to be denoted by x i t , where t 1, . . ., n represent time and i 1, . . ., S. These specific stock markets were chosen because they are considered to be representative of the reality.The inclusion of more indexes would lead to confusion and, therefore, become counterproductive.
The data is obtained from data provided by Yahoo Finance web site 10 and measures indices in local currencies.
For example, Figure 1 depicts the time evolution of daily closing prices of the six stock markets versus time in years .The charts exhibit the well-known noisy and chaotic characteristics.Each signal x i t is complex and difficult to analyze in the time domain.Therefore, for highlighting the characteristics of x i t is required the application of adequate signal processing tools.In the sequel is analyzed the performance of the Fourier and wavelets transforms.

Fourier Analysis
For each signal index, the corresponding Fourier transform FT is calculated, according to: x t e −jΩt dt, j where F is the Fourier operator, x t is the index value, t is time, and Ω is the angular frequency.
Figure 2 shows the |F{x k t }| versus Ω for the {bvsp, dax, dji, ndx, nikkei, sp500} indices.The charts for the other SMI are of the same type and are not represented.It is well known that this tool "dilutes" the signal time information leading only to a global representation.Therefore, since the signals may be not stationary, accessing limited periods of time is problematic.

Wavelet Analysis
The continuous wavelet transform 11-13 is defined as where the symbol * denotes the complex conjugate, the parameters a, b represent the dyadic dilation and the dyadic position, respectively, and ψ is a function called the mother wavelet.The mother wavelet is the source for generating daughter wavelets, which are simply the translated and scaled versions of the mother wavelet.Often the parameter a is interpreted qualitatively as the inverse of the frequency of the Fourier analysis.The wavelet transform is often compared with the Fourier transform, in which signals are represented as a sum of sinusoids.The main difference is that wavelets are localized in both time and frequency, whereas the standard Fourier transform is only localized in frequency.Wavelets give a better signal representation using multiresolution analysis, with balanced resolution at any time and frequency.Wavelet transforms are classified into discrete wavelet transforms DW and continuous wavelet transforms CW .Note that both DW and CW are continuous-time analog transforms.They can be used to represent continuous-time analog signals.CW operates over every possible scale and translation whereas DW uses a specific subset of scale and translation values or representation grid 14-17 .

Mathematical Problems in Engineering
In this paper are investigated three real and three complex valued CWs, namely, the Haar, Ricker also called Mexican hat , Shannon, Hermitian hat, Shannon complex, and Morlet wavelets, denoted by {HW, RW, SW, HHW, SCW, MW}, defined by the expressions: Mathematical Problems in Engineering Hermitian hat: Shannon complex:

2.3
Tackling the financial data through wavelets leads to a considerable volume of information.Therefore, for condensing the results of the wavelet charts a similarity measure r between two plots is developed in the next section.This index allows the construction of a symmetrical correlation matrix R comparing all cases.Based on the matrix it is then possible to use visualization tools for establishing a graphical locus of the thirty-three stock markets.
The multidimensional scaling MDS visualization tool assigns a point to each item in a multidimensional space and then arranges the the "cloud" of points in a low-dimensional space in order to reproduce the observed similarities.
Bearing these ideas in mind, for the stock market analysis, in the next section, is adopted i the set of thirty-three SMI listed in Table 1 ii the CWs for the signal analysis, iii the six continuous wavelets {HW, RW, SW, HHW, SCW, MW} defined in 2.3 , iv the measure of similarity between wavelet charts using an appropriate index, and v the adoption of the visualization technique for obtaining a graphical output.

Wavelet Analysis of the SMI
For each of the thirty three index signals, x i t , i 1, . . ., S, the wavelet transform W ψ x t a, b is calculated.The results of the wavelet analysis depend on the mother function ψ to be adopted.Therefore, before comparing all indices, a preliminary evaluation is developed in order to characterize of each function ψ for the analysis of the indices signal.
In this line of thought, Figure 3 depicts the absolute value of the wavelet for the dji index and the six functions listed in 2.3 , where it is adopted that σ 1 and σ 5 for the RW and the MW, respectively.Furthermore, it is established a "time step" dt 1 for the sequence base increment along the index, and the parameters a, b are considered to vary from zero up to the maximum length of signal index.In the charts, we must take care with the results at the limits of the intervals of variation of the parameters a, b due to truncation effects.
We verify that we get very different charts for each function ψ, that is, we conclude that the observation lens provided by ψ hide or reveal different signal characteristics and that some may be better adapted to this than others.The HW seems to be the "worst" probably because it is more adapted to digital signals, while in the present case we have a different type of time evolution.We observe that the RW has similarities to HHW, and, identically, the SCW to the MW.In these four cases, we observe a pattern for a in the middle of the interval and for low values of b.Particularly, the RW seems to present an slight higher level of detail with the presence of three objects.The SW seems to be a "good" wavelet, depicting a clear emergence of three objects.Other SMIs were tested leading to similar observations.Therefore, the SW is adopted for developing a first phase of exploratory analysis of the thirty three SMIs.Figure 4 depicts the absolute value of the SW of the {bvsp, dax, dji, ndx, nikkei, sp500} indices, where for the sake of completeness, dji is repeated.
We verify that the charts are distinct from each other but reveal similarities namely, the emergence of several objects for low values of b.While for most cases, we have three objects some charts present several levels according with b following a logic of different scales of resolution.

MDS Analysis Based on Wavelets
After calculating the wavelet transform, it is possible to compare visually the plots and to establish a qualitative grouping by similarities.Nevertheless, it is preferable to define a quantitative measure avoiding subjective assessments.It should be noted that wavelets results are complex-valued.Figure 3 represents only the absolute value, but this approach is frequently adopted because it is simple and produces good results.In order to emphasize the shape of the wavelet plots, it was decided to normalize the charts, by converting the a and b axes into the interval 0, 1 and by rescaling the wavelet absolute values so that the total volume becomes one.In other words, for each plot is considered for the x and y scale axes the values a/max a and b/max b , for the z axis the values || W ψ x t a, b ||/ a,b || W ψ x t a, b ||da db.Each plot can now be interpreted as a probability density function, and for comparing the normalized plots it is adopted the measure: , i,j 1, . . ., 33, 4.1 where the symbols μ and σ represent the arithmetic average and standard deviation, a, b are the wavelet parameters, and i, j are listed in the set of financial indices.Based on the r ij index, it is now possible to calculate a R 33×33 symmetric matrix of distances in the sense of 4.1 and to use a visualization tool for mapping the indices characteristics.
In order to reveal possible relationships between the SMIs the MDS technique is used.In this perspective, several MDS criteria are tested.The Sammon criterion revealed good results and is adopted in this work 18, 19 .representation.Obviously the closer to the 45-degree line, in the first case, or the lower the values, in the second case, the better is the MDS map.In this perspective, Figures 6 and 7 show the corresponding stress and Sheppard diagrams using SW, respectively, demonstrating a good fit of the two-and three-dimensional MDS maps 24 .

Using MDS and the SW
The aim of the MDS technique is to project the high-dimensional information into a low-dimensional space while preserving a good accuracy.Therefore, two-dimensional plots are sufficient, which will ease the comparison.

Using MDS and the HW, RW, HHW, SCW, and MW
We tested the SW for calculating the matrix of distances and plotting the MDS chart.The choice of the SW was merely based on a visual characteristics of the wavelet plots that revealed structured features.It is well known that the choice of a particular wavelet depends heavily on the application.In spite of the efforts that have been done in automating this choice, the fact is that often the best method is simply to experiment all wavelets.Having these ideas in mind, Figure 8 shows the two-dimensional MDS plots for all wavelets the SW MDS map is repeated for easing the comparison .
Comparing the six MDS plots, we verify that we get a distinct chart for each wavelet.This result is usual since MDS depends on the analysis index, which in our case corresponds to the type of wavelet 2.3 and the comparison measure 4.1 .Furthermore, MDS plots must be interpreted only on the basis of clustering of points since they are insensitive to translations and rotations.Therefore, we observe that the MDS chart based on the HW has the most different features.Again, this result is common since it is known that the HW is more adapted to analyse digital signals.In what concerns the other five charts, the classification of the "best" one is more complicated since the clusters are not so different.Often MDS users prefer to have simple images, that is, with some clusters that make sense for the application but without an heavy overlapping of points.In this perspective, the SW is a good choice in the authors opinion, but SMI experts working in different areas may have distinct empirical choices.In fact, the adopting possibility of distinct measures based on the same methodology is one of the key features of the MDS scheme.
Considering the SW, there are several empirical conclusions we can draw from the MDS graph Figure 8 , and we will mention just a few here.We can clearly observe that there seem to emerge clusters, which show similar behavior 19 .Hence, there does not seem to be a single behavior market, but perhaps there are several important behaviors markets according their characteristics.We can say that {ndx, dax, psi20, aex, ssec, mibtel, cac}{atx, mxx, bux, zadowd, merv, bse, ccsi, bvsp, kse} form separate clusters while {ibex, ssmi, ftse, nikkei, twii, hsi, bfx, tsx, sti, nya, klse, sp500, sji} seem to form the "center cluster."Furthermore, the indices such as {aord}, {ks11}, {oseax}, and {ta100} are separated from those groups.

Conclusion
It seems that there are many distinct analogies between the dynamics of complex physical and financial systems.This information can be analyzed with tools usually adopted in dynamical systems and signal processing.In this paper was studied the evolution of financial indices by means of continuous wavelets.The application to the thirty-three SMI by means of six different wavelets revealed the dynamical characteristics.After comparing the distinct possibilities, the Shannon real wavelet was adopted for guiding the study.For comparing the results, an index inspired in probability theory was defined, and the MDS visualization technique was applied.The charts lead to the emergence of patterns and clusters capable of being interpreted and compared.Having established the processing methodology the analysis was repeated for the other wavelets, and the results were compared.

Figure 3 :
Figure 3: Absolute value of the six wavelets {HW, RW, SW, HHW, SCW, MW} listed in 2.3 versus a, b for the dji index, with dt 1.

Figure 5 Figure 4 :Figure 5 :
Figure 5 depicts the two-a and three-b dimensional maps generated by the MDS 6, 8, 20-23 .Usually the MDS output quality is evaluated by the Sheppard and stress diagrams.The first plots the distances versus the original dissimilarities, and the second plots a measure of the mapping difficulty called stress versus the number of dimensions in the MDS

Figure 6 :
Figure 6: Stress value versus number of plotting dimensions of the MDS map using SW.

Figure 7 :
Figure 7: Shepard diagram of the 2D-MDS a and 3D-MDS b using SW.