CS-BIGS 4(2): 93-100 http://legacy.bentley.edu/csbigs/documents/camiz.pdf © 2011 CS-BIGS

Procrustes Analysis and Stock Markets

Sergio Camiz Sapienza Università di Roma, Italy

Jean Jacques Denimal Université des Sciences et Technologies de Lille, France

In this paper, Procrustes Analyses are introduced with their various facets and set in an economics framework with an application to stock markets. The time series of the daily indexes of eight major world stock markets are considered for a four-year period (1988-91) and five two-year mobile windows are built to find a common graphical representation in which the evolution of the relations among the stock markets can be appreciated. Both Procrustes and Generalized Procrustes Analyses are applied in order to illuminate this evolution.

Introduction

In ancient , the bandit Procrustes (“the adjustment is searched among several sets of points. The Stretcher”) was a son of with a stronghold on method is largely used both in pattern recognition and in Mount Korydallos, situated on the between the so-called shape analysis (Dryden and Mardia, 1998) as and . There, he had an iron bed in which a first adjustment of more complex transformations, but it he invited every passer-by to spend the night. According may be applied to all situations in which direct to the guest's size with respect to the bed, he would either comparisons among configurations of the same objects stretch him with his smith’s hammer to fit the bed, or under different representations are requested. amputate the excess length. Indeed, nobody ever fit the bed exactly because Procrustes would take advantage of The exploratory analysis of time-series through classical two beds which differed in size. Procrustes continued his methods may be performed by considering the reign of terror until , travelling to Athens along observations as units and the occasions of observation as the sacred way, “fitted” him to his own bed (). variables: its drawback is the very large number of variables in respect of the usually smaller number of units. In data analysis, the Procrustes Analysis (PA) is a method Bry (1995) proposes to transpose the data table, so that that provides the best adjustment of a set of points, called the series represent the variables and the occasions the test cloud, to a given set, called target cloud, according to units. In this way, classical scaling methods, such as transformations that do not change, up to a scale factor, Principal Component Analysis (PCA, Bry, 1995) and its the reciprocal distances among the points of the test variations, may be adopted. This allows to investigate the cloud. Originally proposed by Mosier (1939), its name is overall relations among time-series, based on their due to Hurley and Cattel (1962), and it later underwent correlation matrix, and to detect the influence of the further developments, in particular the Generalized occasions as displayed by their position on the PCA Procrustes Analysis (GPA, Gower, 1975), in which a best principal axes and planes. If some further information is - 94 - Procrustes Analysis and Stock Markets / Camiz & Denimal searched, in particular to identify specific time-periods depending on the metric M, a symmetric definite during which the pattern of correlations may be different M positive matrix. from the overall one, mobile windows on which to apply the same analyses may be adopted. Camiz et al. (2010) Search for the translation a applied this method to a set of yearly time-series of tree- ring width of Notofagus trees of Tierra del Fuego n (Argentina), resulting in a time-series of PCA, whose If we introduce both clouds centroids G  p .x and synthesis seemed difficult. The application of Procustes  i i i1 Analysis to this case arose as a possible solution. n

H   pi .zi , it is easy to see that the transformation of In this paper, we aim at describing both PA and GPA i1 principles and we show their application to time-series H, U  P(H)  s.T.H  a minimizes PA when G U , through an example: the evolution of eight international which implies: a  G  s.T.H . Indeed, from the objective stock-exchange markets, as represented by five tables of function it follows that: daily observations for two years. For this task a pre- treatment is needed, in order to get a set of points in the 2 2 2 space corresponding to the series; for our purposes, we  pi . xi  ui   pi . xi  G   pi . ui  U iI iI iI shall use first a Non-Metric Multidimensional Scaling n (NMMDS, Borg and Groenen, 2005), based on a distance 2  2. pi . xi  G,ui  U  G  U matrix derived from the correlation between series, to i1 obtain a graphical display representing the relations between time-series. This will provide us with the clouds 2 where the only member depending on a is G U , of points on which PA may be applied. hence its minimum for G U . The Procrustes Transformation Search for the rescaling s The aim of a Procrustes Analysis (PA) is to best adjust two clouds of points in a geometrical space, that is to adjust a If we replace the found translation a into the objective test cloud to a target cloud as best as possible through a function, this becomes rigid transformation. As rigid transformations we consider n n only translations, rotations, and rescaling, or a 2.  2  composition of these. s . pi . T.zi  H    2.s. pi . xi G,T.zi  H   i1  i1 p Let there be in R two clouds of points, the target cloud whose minimum is reached when its derivative is zero, N x of n points xi and the test cloud Nz of n points zi that is indexed by the same set I (with n  card(I) ), and given n the same weights pi assumed to be strictly positive and  2  2s. p . T.z  H   to sum up to 1. In addition, we assume that R p is given a  i i  i1  metric represented by a positive definite matrix M. This is n the most general framework: normally, all points have the  2 pi . xi  G,T.zi  H   0 same weight and the metric M is given by the identity i1 matrix I. hence The PA consists in finding the so-called Procrustes Transformation (PT) P(a,T,s), composed of a translation n p . x  G,T.z  H  a , a  R p , a rotation T, T R pp , and a rescaling s,  i i i s  i1 s  R , such that the images of the points of the test n cloud N under P, that is u  P(z )  s.T.z  a , i  I 2 z i i i  pi . T.zi  H  are as close as possible to the points of the target cloud i1

N x in the least-squares sense. The objective function to 2 Since any rotation is a norm-preserving isometry, T does minimize is thus: PA p . x u , with the norm  i i i M not influence the denominator and may be removed, iI giving - 95 - Procrustes Analysis and Stock Markets / Camiz & Denimal

t V.M.e p n M-orthonormal vectors f   R ,  1,..,r ,   pi . xi  G,T.zi  H   s  i1 that may be completed to an M-orthonormal basis n 2 p f1, f2,..., f p of R .Indeed,  pi . zi  H  i1 t f,.. f f M f Search for the rotation T     tt e...... M V M V M e 0 if  Once the found rescaling s is plugged into the objective  . . 1 else function, it becomes 

Bourgois (1978) showed that a possible T that gives the 22 pi.. x i u i  p i x i  G  searched optimum is defined by T. f  e ,  1, r. i I i I 2 n Remark 1  pi. x i G , T .( z i H ) i1 n 2 Let X and Z be two tables with dimensions n, p whose  pii. z H i1 rows correspond to the two clouds N x and Nz 2 n respectively. When the metric M of R p is the classical p. x G , T .( z H )  i i i Euclidean one and the weights p / i I are all equal, 2.i1 , i n then the three steps of the transformation, say the search p. z H 2  ii for the rotation T, the translation a, and the rescaling s i1 may be described as (see Borg and Groenen, 2005): simplifying to ~ ~ 1) Centering the tables X and Z , ~ ~ 22 2) Compute the tables product1 Ct X.Z , pi.. x i u i  p i x i  G i I i I 3) Compute the Singular Value Decomposition of 2 t n C  P.. Q ,  pi. x i G , T .( z i H ) i1  n . 2 with the following results:  pii. z H i1 t  the rotation T  P. Q t ~ ~ t If we center both vectors xi and zi to their respective trace( X.Z. T)  the rescaling s  ~ ~ t ~ ~ centroids, say xi  xi  G and zi  zi  H , the search trace( Z.Z ) for the rotation T is reduced to the maximization of 1 t t  the translation a  . (X  s.Y. T).1n , n n ~ ~  pi . xi ,T.zi . i1 with 1n a vector with all components equal to 1.

n Remark 2 ~ t ~ Let us now define two matrices V   pi .xi . zi  and 2 i1 The objective function PA p . x u , with t p  i i i W V.M. V.M , with M the metrics in R : clearly MW iI is symmetrical (so that W will be called M-symmetrical). ui  s.T.zi  a may be reformulated as Thus, W admits an M-orthonormal basis of eigenvectors, denoted e1, e2 ,...,e p  that we assume sorted in t Trace X  s.Z.t T 1 .t a.X  s.Z.t T 1 .t a decreasing order of their corresponding eigenvalues  n n      ....  (Golub and van Loan, 1996). If the 1 2 p first r eigenvalues are different from zero, we can define 1 In this paper, we shall denote by t X the transpose of matrix X. - 96 - Procrustes Analysis and Stock Markets / Camiz & Denimal

This formulation allows one to generalize this criterion, as pointed out that, unlike in metric scaling (such as PCA), will be discussed below. the Euclidean representation resulting from NMMDS is not unique, since any isometry does not modify the stress. Analysis of synchronous time-series evolution To choose a suitable dimension q of representation, the so-called elbow criterion may be used: it is the rule of Let us consider a set of p synchronous time-series thumb that consists in examining the scatter plot of the observed along n occasions: they may be gathered in an stresses as a function of q and choosing as suitable the n p data table S and their overall relations may be dimension in which an elbow occurs (Thorndike, 1953). described by their correlation matrix R. If we want to study the evolution of the system, we may want to Thus, if X k and X k1 are two representations associated consider their correlation in different time-intervals and to two time periods, a Procrustes Transformation will be compare them. This may be done by defining a mobile searched in order to get X k and s.X k1.T  a to be as window, a sub-table of X of fixed length w, and by shifting close as possible. Indeed, in this case we would not it along the original table. In this way, we would obtain a consider both a rescaling s that would modify the metrics w p set of indexed tables S k whose structures, of one table, and a translation a, since both X k and represented by the corresponding correlation matrices X k1 are column centered. Thus, the searched Rk , may be compared. To perform this comparison, we transformation will be the transformation T minimizing can build Euclidean representations of each table and 2 X  X .T . compare them, if possible with a simultaneous k k1 representation. Application to stock exchange markets Indeed, given any dissimilarity , that is a symmetric non We propose here an application, analogous to that of negative real function of a couple of points with  ii  0 , such a Euclidean representation may be obtained through Groenen and Franses (2000), concerning 3347 daily overall indices of 8 great stock exchanges during a period NMMDS (Non-Metric Multi-Dimensional Scaling, Borg nd th and Groenen, 2005) techniques. In the given case, we ranging from January 2 1986 to October 29 1998. The data were taken from Franses and van Dyck (2000) and can define as dissimilarity  1 r , the correlation ij ij downloaded from http: //robjhyndman.com between two series:  ij ranges from 0, in the case of r = /tsdldata/data/FVD1.dat. All computations were 1, that is total positive correlation, to 2 when r = -1, performed through the SAS statistical software. corresponding to total negative correlation. We consider here two periods of two years 1988-1989 The goal of NMMDS is, given a set of p points with any and 1990-1991. For each of these two periods, an 8 by 8 correlation matrix R  r ,i 1,8, j 1,8, k 1,2 dissimilarity (pp) matrix    ij , i, j 1,...,n between k ij them, to build a matrix X (pq) composed by the between indices is computed based on the daily values. coordinates of the p points in a q-dimensional Euclidean Our goal is to represent the stock exchanges as points in space (q < p), so that the so-called stress function is the Euclidean multidimensional space based on the minimized, namely: correlation matrix, so that the closeness of two points represents a high positive correlation between p p corresponding stock exchanges. 2 1  rij  dij X  i1 j1 In our case n = 8 and the elbow criterion suggests q=2 Stress  i j for both cases, so that the representations will be 2- p p 2 dimensional, in other words a plane. In Figures 1 and 2,  (1  rij ) i1 j1 the plane representations obtained through the NMMDS i j applied to the two chosen periods are shown. in which dij X  is the Euclidean distance between Comparing the two graphics, the isolation of Hong-Kong points, computed from the coordinates in X. is evident in 1988-89, whereas in 1990-91 both New York and London approach Hong-Kong in contrast with the The minimum stress may not be found algebraically but other stock markets. In Figure 3, the two graphics are through the use of some specific numerical algorithm, as superimposed, according to a Procrustes Transformation, for example the SMACOF (Scaling by MAjorizing a namely an isometry: with this representation even the COmplicated Function, De Leeuw, 1988). It must be intensity of the variation of each stock market may be - 97 - Procrustes Analysis and Stock Markets / Camiz & Denimal

Hong_Kong90_91 Dim2

1.50

New_York90_91 London90_91

0.75

Frankfurt2 Amsterdam88_89

Paris88_89 Frankfurt88_89

Dim1 0 Tokyo88_89 New_York88_89 Hong_Kong88_89 Amsterdam90_91

Singapore90_91 Singapore88_89 London88_89

-0.75

Paris90_91

Tokyo3 Frankfurt90_91 Tokyo90_91 Tokyo1 Tokyo2 Figure 1. Representation of the 8 stock market correlations -3 -2 -1 0 1 in 1988-1989. Figure 4. Representation of the evolution of the 8 stock markets by successive Procrustes transformations.

Now, in order to fine-tune the evolution of the correlations among the stock exchanges during these years, we build a series of mobile windows each two-years long, with a shift of 6 months between two adjacent windows: thus, three intermediate patterns result and we want to represent the resulting five NMMDS graphics simultaneously. For this task, a PT is applied between two successive representations, to adjust each representation on the preceding one.

Figure 2. Representation of the 8 stock market correlations In Figure 4 the evolution of the correlations between in 1990-1991. stock markets during the period 1988-1991 obtained in this way is shown.

Looking at the graphics, the regular evolution of Hong- Kong, London, New York, and Paris may be appreciated, whereas the pattern for the other markets is much more complicated.

Indeed, this last application involving five tables, may be alternatively dealt with directly, by searching for a transformation that simultaneously best adjusts each of K configurations to all others: this will be shown in the following section.

The Generalized Procrustes Analysis Figure 3. Procrustes simultaneous representation of the 8 stock markets. The idea of Generalized Procrustes Analysis (GPA, Gower, 1975) is to simultaneously best adjust a set of K clouds of appreciated, paying attention to the directions of the points in a geometrical space through a rigid arrows in the figure. transformation, again composed only by translations, rotations, and rescaling. Indeed, this is an alternative to Looking at Figure 3, we may now say that not only did the successive PTs applied to the last example of Section New York and London approach Hong-Kong in the second 4, with the advantage that in this case a compromise can window, but also that Hong-Kong approached these stock be built, that is a graphical representation of only one markets, whereas Tokyo moved further, as did Paris and cloud that approaches at the best all the given ones. Frankfurt. Morevoer, a convergence of Amsterdam with Singapore may be appreciated.

- 98 - Procrustes Analysis and Stock Markets / Camiz & Denimal

Given K data tables X1, X 2,...,X K , all with dimensions Second method (n, p) , the GPA aims at minimizing the following criterion, that generalizes the notation of remark 2: The second method for minimizing the GPA criterion was proposed by Gower (1975) and improved by Ten K K Berge (1977). t ~ ~ ~ ~ GPA trace X  X X  X    k l k l  a k1 l1 As a first step, the K translations k are found: it may kl be shown that the GPA criterion is minimized if all ~ t where X k  sk .X k .Tk 1n. ak , k 1, K. resulting configurations have the same centroid: t ~ k 1, K, X k .1n  0 . This is obtained by simply This criterion may be minimized only iteratively, because centering the original tables X k to their respective no analytical solution is known to date. In the sequel, centroid. three methods of minimization of GPA are described.

Both rotations T and rescalings s are then found First method k k iteratively in two phases, once we set initially: sk 1 , ~ The first method, proposed by Kristof and Wingersky k 1, K and X k  X k : (1971), results in a series of adjustments of one configuration, considering all others fixed; thus, ~ 1) In the same way as in the first method, a rotation Tk iteratively, an adjusted X 1 assuming the others fixed is ~ ~ 1 ~ is searched to adjust X k on Y  . X l searched for, then an adjusted X 2 assuming the others  (K 1) lk fixed is searched for, and so on. iteratively for every k until convergence. The ~ obtained configurations are again denoted by X , More precisely, for every configuration k  K , the GPA k criterion may be written as: k 1, K.

t ~ ~ t ~ ~ 2) The K  K matrix B is now considered, whose GPA K 1.trace( X k .X k )  2.trace( X k . X l )  C  t ~ ~ lk elements are bkl  trace X k .X l  and we denote by where C represents the terms of GPA that do not    ~  k k1,K  the eigenvector of B associated to its depend on X k . largest eigenvalue. It may be shown that the rescaling that minimizes the GPA criterion is 1 ~ K By setting Y  . X l , it follows that: t ~ ~  trace( X l .X l ) (K 1) lk  l1 sk  ~ ~ .k , see Ten Berge (1977). trace(t X .X ) GPA K 1.  trace (.)2.tt X X  trace (.) X Y  C , k k k k k ~ Again, we denote by X , k  1, K the rescaled and therefore that k   configurations. t GPA K 1. trace X  Y X  Y Phases 1) and 2) are then repeated until convergence.  kk  

C ( K  1) trace (t Y . Y ) . Third method 

This corresponds to minimizing A third way to minimize the GPA criterion (see Borg and  t ~ ~  Groenen, 2000) is based on the average configuration trace X Y .X Y  , that is to apply the K  k k  1 ~ Z  . X . Indeed, the criterion may be written as Procrustes transformation of the test configuration X  k k K k1 on the target Y , as previously described. The convergence is reached with few iterations, since the K t ~ ~ GPA criterion is positive and decreases at every step. GPA K. trace X  Z.X  Z   k k  k1

- 99 - Procrustes Analysis and Stock Markets / Camiz & Denimal

The procedure minimizes the GPA criterion according to the following steps:

~ 1) The configurations X k are found by a PA of the k test configurations on the average configuration Z assumed fixed.

1 K ~ 2) The average configuration Z  . X k is re- K k1 calculated.

Steps 1) and 2) are iterated until convergence. Albeit very simple, this method is the most time-consuming, so Figure 5. GPA of the eight stock exchange markets. that its use is not recommended. Compromise representation given by the centroid.

It is worth observing that, in all methods, the average Hong_Kong88_89 K 1 ~ 0.30 configuration Z  . X k results in a compromise  Hong_Kong90_91 K k1

New_York90_91 among all configurations, that summarizes the K clouds in 0.15 a single one. Amsterdam88_89 London90_91 Paris88_89 Amsterdam90_91 Paris90_91

0 Tokyo88_89 Application of GPA to stock exchange markets Frankfurt88_89

Singapore90_91 Frankfurt90_91

Singapore88_89 New_York88_89 The application of GPA to the eight stock exchange -0.15 markets results in two graphics: a compromise (Figure 5) London88_89 and a representation of the evolution along time (Figure

-0.30 6). All computations were performed with the Tokyo90_91 NewMDSX package. -0.75 -0.50 -0.25 0 0.25 Figure 6. Representation of the evolution of the 8 stock In Figure 5 the compromise representation of the eight markets by the Generalized Procrustes Analysis. stock markets with respect to the five different periods is given as a centroid cloud. It is clear that Hong-Kong is for the same purpose may be taken into account, based different from the other markets through all the windows, on different rationale and a comparison of the results may and that some difference concerns both Tokyo and be advisable: we can quote here 3-way methods, both Amsterdam. metric, such as Dual Statis (Lavit, 1988) and Dual Multiple Factor Analysis (Lê et al., 2008), and non-metric, In Figure 6 the evolution of the stock markets is shown, such as INDSCAL (Carroll and Chang, 1970). as resulting by the application of GPA. The pattern is somehow different from the one shown in Figure 4. This Generalizations of Procrustes Analysis are discussed in clearly is due to the different criterion used in the Borg and Groenen (2005) and implemented in both analysis, since the previous one adjusted every table to its PINDIS (Lingoes and Borg, 1978) and NewMDSX. predecessor and the latter did it to the common centroid. Further developments may also be considered, in Nevertheless, the main evolution is the same in both particular when special conditions occur. When the series representations: the convergence of Hong-Kong, New need to be considered with different weights, depending York, and London, the divergence of both Tokyo and on either the market's importance or on the different Frankfurt with respect to these, but eventually evolving in range of variation of the markets in the different the same direction. occasions or on their correlation, the least-squares approach is not adequate since it gives the same Conclusion importance to all involved markets. Thus, a more general model may be considered, such as Maximum Likelihood In this paper we introduced both PA and GPA in their (Theobald and Wuttke, 2006). When the samples are classical formulation and suggested a possible application different from an occasion to another, new adaptive to stock market time series. However, other techniques methods may be considered. With these methods, - 100 - Procrustes Analysis and Stock Markets / Camiz & Denimal stochastic links are created, as proposed by both Golub, G., & Van Loan, C. 1996. Matrix Computations, Bouveyron and Jacques (2010) and Bienacki and Lourme third edition. London, The Johns Hopkins University (2010), may be applied. The stochastic links may be seen Press. as a generalization of the geometric transformations used Gower, J.C. 1975. Generalized Procrustes Analysis. in Procrustes Analysis, with the further possibility of Psychometrika, 40:33-51. classification or prediction otherwise impossible. Groenen, P.J.F. & Franses, P.H. 2000. Visualizing time- Acknowledgements varying correlations across stock markets. Journal of Empirical Finance, 7:155-172. This paper was developed during the reciprocal visits of Horst, P. 1965. Factor Analysis of Data Matrices. New York, the authors in the framework of the Socrates/Erasmus Holt, Rinehart and Winston. agreement between Sapienza Università di Roma and the Université des Sciences et Technologies de Lille. The first Hurley, J. R. & Cattell, R. B. 1962. The Procrustes program: author was also supported by the Facoltà di Architettura Producing direct rotation to test a hypothesized factor structure. Behav. Sci., 7:258–262. Valle Giulia of belonging. All institution grants are gratefully acknowledged. Kristof, W. & Wingersky, B. 1971. Generalization of the orthogonal Procrustes rotation procedure for more than two matrices. In Proceedings of the 79th annual convention REFERENCES of the American Psychological Association: 89-90.

Lavit, C. 1988. Analyse Conjointe de Tableaux Quantitatifs. Biernacki, C. & Lourme, A. 2010. Simultaneous Mixture Paris, Masson. Model-Based Clustering of Samples from Multiple Origin. MASH-2010, Lille, Session on Adaptive Methods. Lê, S., Josse, J. & Husson, F. 2008. FactoMineR: An R Package for Multivariate Analysis. Journal of Statistical Borg, I. & Groenen, P.J.F. 2005. Modern Multidimensional Software, 25(1):1-18. Scaling. Berlin, Springer Series in Statistics. Lingoes, J.C. & Borg, I. 1978. A direct approach to Bourgois, P. 1978. Recherche du déplacement minimisant la individual differences scaling using increasingly complex distance entre deux ensembles de points homologues transformations. Psychometrika, 43:491-519. situés dans un même espace euclidien. Les cahiers de l’analyse de données, 3(4):440-448. NewMDSX. A resource base for dimensional Scaling. Sigma Essex research. Online.http://www.newmdsx.com/ Bouveyron, C. & Jacques, C. 2010. Adaptive Mixture of Regressions. MASH-2010, Lille, Session on Adaptive Mosier, C.I. 1939. Determining a simple structure when Methods. loadings for certain tests are known. Psychometrika, 4:149-162. Bry, X. 1995. Analyses factorielles simples. Paris, Economica. SAS. SAS Institute Inc. Online at http://www.sas.com. Camiz, S., Maulucci, R. & Roig, F.A. 2010. Exploratory analysis methods applied to dendrochronological series. In O.Papu (Ed.), Actas E-ICES - Malargüe (Mendoza,

Argentina) 24-27, ottobre 2009, Mendoza, Comisión Nacional de Energia Atómica, 61-67. Carroll, J.D., & Chang, J.J. 1970. Analysis of individual differences in multidimensional scaling via an N-way

generalization of ''Eckart-Young'' decomposition. Psychometrika, 35:283-319. De Leeuw, J. 1988. Convergence of the majorization Method for multidimensional scaling. Journal of

Classification, 5:163-180.

Dryden, I.L., & Mardia, K.V. 1998. Statistical Shape Analysis. New York, Wiley. Franses, P.H., & Van Dijk, D. 2000. Nonlinear Time Series Models in Empirical Finance. Cambridge, Cambridge University Press. Correspondence: [email protected]