  We present the clustering analysis of the financial markets of S&P 500 (USA)
and Nikkei 225 (JPN) markets over a period of 2006-2019 as an example of a
complex system. We investigate the statistical properties of correlation
matrices constructed from the sliding epochs. The correlation matrices can be
classified into different clusters, named as market states based on the
similarity of correlation structures. We cluster the S&P 500 market into four
and Nikkei 225 into six market states by optimizing the value of intracluster
distances. The market shows transitions between these market states and the
statistical properties of the transitions to critical market states can
indicate likely precursors to the catastrophic events. We also analyze the same
clustering technique on surrogate data constructed from average correlations of
market states and the fluctuations arise due to the white noise of short time
series. We use the correlated Wishart orthogonal ensemble for the construction
of surrogate data whose average correlation equals the average of the real
data.
