Dynamic spatiotemporal correlation coefficient based on adaptive weight

Risk management is an important aspect of financial research because correlations among financial data are essential in evaluating portfolio risk. Among various correlations, spatiotemporal correlations involve economic entity attributes and are interrelated in space and time. Such correlations have therefore drawn increasing attention in financial risk management. However, classical correlation measurements are typically based on either time series correlations or spatial dependence; they cannot be directly applied to financial data with spatiotemporal correlations. The spatiotemporal correlation coefficient model with adaptive weight proposed in this paper can (1) address the absolute quantity, dynamic quantity, and dynamic development of financial data and (2) be used for risk grading, financial risk evaluation, and portfolio management. To verify the validity and superiority of this model, cluster analysis results and portfolio performance are compared with a classical model with time series correlation or spatial correlation, respectively. Empirical findings show that the proposed coefficient is highly effective and convenient compared to others. Overall, our method provides a highly efficient financial risk management method with valuable implications for investors and financial institutions.


Introduction
With the development of global economic integration, as well as the ongoing evolution of Internet technology, the links among regions, economies, and financial markets are strengthening. The spatial effect, defined as observations at position i being related to other observations at position j, are therefore growing in importance. These circumstances have amplified the potential for financial risk contagion (Dell'Erba et al. 2013;Baumöhl et al. 2018;Inci et al. 2011;Kelejian et al. 2006;Tawn et al. 2018). Scholars continue to be concerned about the time series correlation of financial data as well. Indeed, close attention has been paid to the spatiotemporal correlations of data in financial risk management (Baumöhl et al. 2018;Asgharian et al. 2013;Ouyang et al. 2014;Tam 2014). The classical computing methods of time series or spatial correlations cannot analyze data with spatiotemporal dependencies. For example, in financial risk analysis, spatial *Correspondence: gongzuomo2006@163.com; moguozhi1986@tom.com correlations are often computed with annual cross-sectional data. It is impossible to accurately characterize spatiotemporal correlations simply with these spatial correlations. It is similarly challenging to do so by taking the mean values in the time dimension, which can be degenerated into spatial cross-sectional data. Meanwhile, some classical methods cannot capture spatiotemporal correlations' dynamic features. Trends in the development of data dependence are thus only partially reflected. Spatial and temporal correlations also shift over time; using static cross-sectional data solely for analysis generates biased results. Lately, several papers have addressed dynamic spatiotemporal correlations via machine learning (Ou et al. 2022;Liu et al. 2021;Pan et al. 2022). However, these models cannot be applied directly because they describe certain spatiotemporal characteristics of citywide traffic flow but not financial issues. In other words, the motion-based features of traffic flows and financial issues are different despite sharing some commonalities. Whether (and how) ways of describing traffic flows are suited to the finance field requires further research.
The models characterizing spatiotemporal correlation are rarely applied in finance. The reason may be the temporal, spatial, and fused spatiotemporal relationships among the variables are not available from the ground truth (Xiao et al. 2022). To date, studies on spatiotemporal correlations in the financial arena are limited. Xiao et al. (2021) proposed a convolutional LSTM network model; Xiao et al. (2022) constructed an adaptive fused spatial-temporal graph convolutional network to predict a multivariate time series. However, both models are based on a deep-learning algorithm that results in a relatively complex process of predicting multivariate time series with spatiotemporal correlation characteristics. Neither model can extract the spatiotemporal correlation coefficient alone. Therefore, risk cannot be prejudged or classified based on investment objects' degrees of correlation.
This study makes three contributions to the literature: 1. A dynamic spatiotemporal correlation coefficient based on adaptive weight was used. In the coefficient model, absolute distance, growth distance, and fluctuation distance of indices are defined. 2. Several constraints were imposed on the distances to help users compute the spatiotemporal correlations more quickly. That is, the range of [0,2] is set for various distance values, combining with the information entropy method (Zhu et al. 2018;Bekiros et al. 2017) or expert advice to determine the weights of the distances. 3. When testing the validity of the spatiotemporal correlation coefficient, it is compared with the time series correlation coefficient as well as the spatial correlation coefficient from the aspects of cluster analysis and cross validation.
The rest of this paper is organized as follows. The second section is a literature review of relevant work. In the "Design and measurement of spatiotemporal correlation" section, the distance between two variables and how to assess their spatiotemporal correlation using adaptive weights is discussed. The "Empirical analysis" section describes a cluster analysis cross-test with a portfolio for the proposed spatiotemporal correlation to test the rationality and validity of the proposed risk measurement. Finally, the "Conclusions and future research directions" section outlines our findings and subsequent avenues of interest. The "Appendix" contains the results for cluster analysis and time series correlation coefficients.

Literature review and model design
Financial data include temporal and spatial correlations, which can be explained through financial geography theory and financial regional movement theory. Financial geography is an emerging discipline that focuses on financial issues from a geographical perspective. The field adheres to three principles. The first is that money is the core of finance and has clear characteristics related to time and space. It can be judged based on the unique effects of its worldwide flow through both dimensions. Second, global capital flow varies by country; that is, the interaction between global and local forces is spatiotemporally heterogenous. Third, information in the financial industry is neither simply shared nor absorbed. Instead, it must be managed at different levels of time and space. Financial regional movement theory concerns spatiotemporal changes in financial resources in accordance with special laws concerning regional flows, allocations, and combinations: it assumes that financial instruments, financial institutions, financial markets, and other financial resources all have regional movement. Among the limited literature on this topic, temporal and spatial correlations of financial data have been included in several regression models. For instance, Zhu et al. (2013) employed a spatial panel model to study the dependencies of returns and risks in the U.S. housing market. Arnold et al. (2013) devised a spatial autoregressive model for portfolio risk in the stock market and discovered that the risk measurement became biased if data spatial correlations were ignored. Meanwhile, Wied (2013) used a spatial econometric model to measure the portfolio risk of stock markets. Gong and Weng (2016) later designed a spatial regression model to predict the portfolio risk of Chinese stock indices. However, these studies focused on complex regression analysis of spatial effects on portfolio returns; none presented a method for computing dynamic spatiotemporal correlations in data. Therefore, these approaches cannot directly capture variation in spatiotemporal correlations, nor can they judge spatiotemporal correlations quickly or directly. Thus, the methods are of limited use in helping individuals to roughly evaluate risk prior to investment. Researchers have presented multiple arguments and observed clear spatiotemporal correlations in economic data, especially financial data; however, available approaches are not well suited to direct financial portfolio risk management. Song et al. (2011) proposed a method for computing the spatiotemporal correlation coefficient that combined a spatial weight matrix with the formula for time series correlation. Yet, this strategy could only reflect linear correlations among variables and could not detect nonlinear correlations, which reduces its practical value. Across studies regarding the nonlinear correlation coefficients of data with multidimensional random vectors, most models have characterized these correlations in a highly complicated manner. For example, Szekely et al. (2007) put forth a measure of dependence between random vectors by using the Brownian distance correlation. This model is analogous to the absolute value of the classical product moment covariance, which renders it somewhat challenging to understand. Other scholars later extended this effort (e.g., Park et al. 2015;Böttcher et al. 2019). Park et al. (2015) proposed the partial martingale difference correlation, a scalar-valued measure of the conditional mean dependence of Y given X; they adjusted for the nonlinear dependence on Z, where X, Y, and Z are random vectors of arbitrary dimensions. Böttcher et al. (2019) introduced two new measures for the dependence of n ≥ 2 random variables-distance multi-variance and total distance multi-variance-based on the weighted L2-distance of quantities related to the characteristic functions of underlying random variables. Researchers have also attempted to characterize variables' nonlinear spacetime correlations. Li et al. (2013) established a space-time correlation function of doubly scattered light in an imaging system. Meanwhile, Zaburdaev et al. (2013) proposed a space-time velocity correlation function for random walks. Liu (2016) subsequently developed a space-time correlation function related to the heat release rate in turbulent premixed flames. These models are primarily intended for use in physics and chemistry applications rather than the social sciences or economics; as such, they, too, are difficult to understand. They also cannot be readily adopted to elucidate dynamic space-time correlations in economic data.
A number of scholars have recently exploited dynamic spatiotemporal correlations of urban traffic by proposing models based on machine learning. For example, Ou et al. (2022) proposed a novel deep-learning framework, STP-TrellisNets, to predict passenger flows at metro stations. Liu et al. (2021) forecast future citywide crowd flows to facilitate urban management by modeling spatiotemporal patterns of recent crowd flows. Pan et al. (2022) devised a deep meta-learning-based model to simultaneously predict traffic in multiple locations. These models can better describe the spatiotemporal characteristics of urban traffic, but they do not address financial issues and are therefore not feasible for finance. As mentioned, Xiao et al. (2021) and Xiao et al. (2022) proposed two models to predict multivariate time series with spatiotemporal correlation, but the processes are fairly complex and model results do not reflect the spatiotemporal correlation coefficient. Accordingly, these models may encounter some difficulties in practical application, especially for people lacking a machine learning theoretical background.
Accordingly, a method for measuring spatiotemporal correlation that captures the absolute quantity, dynamic quantity, and dynamic development of financial data to facilitate risk management is presented. The contributions and innovations of this paper are twofold. First, we proposed a novel risk measurement model: we established a dynamic model based on cluster analysis to compute spatiotemporal correlations that discern the absolute quantity, dynamic quantity, and dynamic development of financial data to quickly compute correlations. This model based on multidimensional information-can be applied to classify risk grading and is useful for decentralized risk management. Second, we adopted a fresh perspective by comparing the performance of time series correlations and spatiotemporal dependence of economic data. This approach can guide investors in mastering information required for correlation in investment, thereby informing risk management. The classical spatial correlation is defined as one region being spatially affected by its proximal regions or by those that are similar. Thus, the classical model of spatial dependence cannot depict one-to-one correlations but instead reveals many-to-one relationships. These characteristics impede investors when determining whether time series or spatial correlations most strongly influence financial risk. Investors therefore struggle to mitigate or balance associated risk.

Design and measurement of spatiotemporal correlation cluster analysis for spatiotemporal data
Cluster analysis, otherwise known as group analysis or point group analysis, is a quantitative method used to study the classification of multi-factor objects. Its premise is that relationships between samples are quantitatively determined and clustered by the degree of certainty between metrics. In line with this principle, the spatiotemporal correlations of financial data can be clustered in certain ways: data with high correlations can be clustered into one type and data with low correlations can be transformed into different types. Spatiotemporal correlations can be evaluated in the following way: the greater the proximity, the stronger the spatiotemporal correlation; the smaller the similarity, the weaker the correlation. Spatiotemporal data are generally represented in the clustering process as x it ( i = 1, 2, . . . , N ; t = 1, 2, . . . , T ), where N is the total number of individuals and denotes the total number of periods. In addition, spatiotemporal correlation panel data offer at least three forms of information (Mendes and Beims 2018;Brei and von Peter 2018).
1. The absolute level of correlation development; 2. The dynamic level of correlation development, namely the incremental level or growth rate of temporalspatial correlation over time; and 3. The correlation's degree of fluctuation, specifically in terms of variation or waves.
If these three aspects cannot be considered simultaneously, then the similarity measures of a correlation will not offer sufficient information. Overall, when constructing similarity measures, the absolute distance, incremental distance, and fluctuation distance of data must be considered. In other words, when designing a similarity measure for spatiotemporal panel data, the three distances must be effectively combined.

Design and measurement of spatiotemporal similarity
Euclidean distance is the most popular measure used in cluster analysis. Thus, this paper measures the spatiotemporal similarity of data in this distance. To simplify cluster analysis, the interval scale for spatiotemporal panel data. In our datasets { x it }, S i is the standard deviation of individual i, d ij denotes the distance between individuals i and j, and the distance satisfies the following three definitions.

Definition 1
The absolute distance between individuals i and j is abbreviated as d ij (AD) , which is expressed as where x it ( i = 1, 2, . . . , N ; t = 1, 2, . . . , T ) denotes the value of individual i at time t, and x jt is the value of individual j at time t. d ij (AD) is the distance between individuals i and j, consistent with Tobler's theory (1970) wherein the farther the distance, the lower individuals' similarities and the slighter their correlations. As such, the distance d ij (AD) can reflect the spatiotemporal range of different individuals. The computational result of d ij (AD) is a vector. To calculate the spatiotemporal correlations in Formula (4) and easily compare them with the time series correlation coefficient matrix in the empirical analysis section, this vector must be transformed into a lower triangular matrix. The distances d ij (ID) and d ij (VD) , must be processed this way as well.

Definition 2
The growth distance between two individuals i and j is abbreviated as d ij (ID) , which is represented as , and x i,t and x j,t represent the difference of individuals i and j at time t, respectively. d ij (ID) characterizes the variation trend in the metric increment, which corresponds to each individual over time in all regions. In essence, the more coordinated the change trend between two individuals is, the more similar they are. This distance can therefore reflect the spatiotemporal interval between two individuals. Similarly, the result of d ij (ID) is a vector and must be transformed into a triangular matrix.

Definition 3
The fluctuation distance between individuals i and j is abbreviated as d ij (VD) , written as From the above symbols x i and S i , it can be inferred that x i denotes the mean value of individual I and S i represents the standard deviation of individual i in the whole period T. Similarily, x j denotes the mean value of individual J, and S j is the standard deviation of individual j throughout period T. As such, d ij (VD) denotes the variation of individuals i and j in period T. Naturally, if the similarity between two individuals grows, then their fluctuation (characterized by the variation coefficient) will become smaller, as will the value of d ij (VD) . A greater coefficient of variation suggests that the larger the fluctuation distances between two data points, the more unstable the individual development. The distance d ij (VD) is therefore a negative metric. It reflects the spatiotemporal correlation range between two individuals. To align with the form of these two distances, the computational result of the d ij (VD) distance should also be transformed into a lower triangular matrix. Note that these three types of distance can be calculated in parallel without order.

Measurement of spatiotemporal correlation
The spatiotemporal correlation model is grounded in the idea that the similarity between two economic data points can be obtained by subtracting the three distances from 1; the result of this calculation is the spatiotemporal correlation. However, this model encounters the problem of how to aggregate the three distances. If the distances are simply summed and then subtracted from 1, the results may exceed the range of [−1, 1] , which is not consistent with the range of time series correlations or the space of spatiotemporal correlations in the existing literature (e.g., Song et al. 2011). Therefore, the three distances must be aggregated to ensure that the resulting coefficient falls within the range of [−1, 1] when constructing the spatiotemporal correlation model. Information aggregation, which fully accounts for the functional evaluation of the three distances by highlighting the role of the larger weights among them, was adopted to synthesize the three distances. Under information aggregation, the additive synthesis method is used to combine the three distances. This research model thus promotes a scientific and fair evaluation process. In addition, according to the first law of geography, the closer the distance between two things, the greater the correlation; the farther the distance, the smaller the correlation. Therefore, if any one of the three distances becomes larger, then the spatiotemporal correlation becomes smaller. Mathematically, the spatiotemporal correlation model is expressed as follows: In this formula, d ij (AD), d ij (ID) and d ij (VD), respectively, denote the absolute distance, growth distance, and fluctuation distance of individuals. The three distances must first be standardized for calculation; doing so can prevent a large gap in the distance types, which could reduce the effects of distances with smaller values. In Model (4), weights for the absolute distance, growth distance, and fluctuation distance are assumed to be β 1 , β 2 , and β 3 , respectively. Then, the three weights are needed to satisfy the constraints of Corresponding to the three forms of this coefficient, the weights of distances in the spatiotemporal correlation coefficient model must be proposed. However, Model (4) returns three unknown quantities (e.g.,β 1 , β 2 , and β 3 ) but only contains one equation. It is therefore difficult to determine the weights of the three distances. Thus, several constraints were imposed on these distances to help investors compute the spatiotemporal correlations of the data in Model (4).  Therefore, x, y, z ∈ [0, 2] .

Lemma
From this lemma that, irrespective of the absolute distance, growth distance, or fluctuation distance in economics, the distance value must be mapped to the range of [0, 2] for the spatiotemporal correlation to be valid. The distance value may be determined by the nature of spatial correlation: the closer the distance, the greater the correlation and the farther the distance, the smaller the correlation (Zhu et al. 2013). In addition, when computing the spatiotemporal correlation coefficient, with a rough idea of which distance is effective and which plays the main role, it becomes possible to confirm the distance weight and to compute the spatiotemporal correlation coefficient. The information entropy method (Zhu et al. 2018;Bekiros et al. 2017) or expert advice can be used to determine the weights of the distances otherwise. Taking the expert advice method as an example, if experts consider the growth distance to be the most important factor, then this aspect can be assigned a higher weight (e.g., β 2 = 0.5). The other two coefficients would thus be given smaller weights, such as β 1 = 0.2 and β 3 = 0.3. Therefore, spatiotemporal correlation coefficients can be estimated quickly. Whether the change in weight will drastically alter the space-time correlation coefficient (i.e., whether the spatiotemporal correlation coefficient is sensitive to weight based changes) is discussed in the section on robustness testing.

Empirical analysis
In this section, the dataset used in this paper was described and then the empirical results were analyzed to offer help to investors managing investment risk.

Dataset
To verify the proposed model accuracy and feasibility, empirical research was performed on stock indices with daily closing prices from 2007 to 2019. The sample includes 29 indices in different stock markets chosen based on several principles. First, indices in markets such as the United States, Britain, Japan, and Hong Kong represent indices in developed markets, whereas those in areas such as China, Indonesia, Malaysia, and Thailand represent developing markets; thus, our sample is representative.
Second, the 29 indices basically meet the requirements of space/time correlation tests such that the sample should not contain fewer than 30 indices (Rodriguez-Villamizar et al. 2020;Wangdi et al. 2021). Our sample only includes 29 national/regional stock indices (not more than 30) because the database did not contain complete data for the studied time intervals.
Third, our full sample spans four stages for analysis: January 4, 2007-December 31, 2008 (Stage 1); January 2, 2009 -December 31, 2014 (Stage 2); January 2, 2015 -December 30, 2016 (Stage 3); and January 3, 2017-November 29, 2019 (Stage 4). This sample segmentation is based on the Asgharian, Hess, and Liu's (2013) findings that spatial impacts change over time; hence, our decision to divide the full dataset into several subsamples. Also, Gong and Weng (2016) broke their sample into three subsamples according to the timeline of the global financial crisis (GFC), revealing that spatial impacts varied between two GFCs. The dividing method was suggested by Laniado et al. (2012) and Tamakoshi and Hamori (2014). Other studies have identified financial crises based on the authors' judgment or chronological events (Hlaing and Kakinaka 2018;Valencia and Laeven 2008). Studies on international financial flows have indicated that an episode involving a sudden stop or flight can signal deteriorating economic conditions (Waelti 2015). In the case of our sample, the timeline of the GFC is the basis for separating samples. The specific division result is: Stage 1 denotes the GFC; Stage 2 covers the European debt crisis; Stage 3 captures the Chinese stock market crash; and Stage 4 is relatively stable.
In fact, multi-stage sample division is based on the granularity theory, and this division has many advantages. Granular computing is a new concept. It is the computing mode of intelligent information processing. It simulates the strategy of observing problems from different levels when people deal with complex problems. It is a discipline that studies the thinking mode, the problem-solving method, the information processing mode, and related theories based on a multi-level granular structure.
One of the great advantages of using this theory is that the slicing sampling method not only ensures the uniform distribution of sampling segments over a long span of time, but it also reduces the computational overhead. If the particle size (stage) is small, the error is large; If the granularity is large, the model needs more parameters. On the basis of this theory, this paper divides the granularity according to the major financial events. The purpose is to reduce a complex model on the premise that the regression model is precise.
Descriptive statistics were calculated for the stock indices in each country to facilitate further analysis. Given limits on length, only the statistics for Stages 1 and 2 are presented. In Table 1, the second row contains the names of the stock indices, and Note 2 for indices at the bottom of the table is also grouped according to the development is not suitable to describe their co-relationships. The proposed nonlinear correlation coefficient thus becomes more important for both theory and practice.

Empirical research findings and discussion
We compute the spatiotemporal correlation coefficients of stock indices in 29 countries/ areas at each stage using Formula (4). Given our large amount of data, different weights for the three distances would result in distinct coefficients. Only results calculated with equal weights for the three distances are listed as lower triangular matrices (or upper triangular matrices) to simplify the calculation of the square matrix. This approach also enables us to observe the results more easily. By the same token, we only summarize our results for Stages 1 and 2. Details appear in Tables 2 and 3. Table 2 shows that, during the GFC, most spatiotemporal correlation coefficients were statistically significant. This finding corroborates prior literature -such as Zhu et al. (2013), Arnold et al. (2013), and Gong and Weng (2016) -and indicates the spatiotemporal dependence of financial assets. The dependence of different markets, the correlations between developed stock markets, or the correlations between developed and emerging stock markets are larger and more significant than those of emerging stock markets.
To more closely analyze spatiotemporal correlation coefficients, they were compared with those that only included time series correlations (see the time series correlations in Schedules 7 and 8 in the Appendix). Several patterns emerged. First, in most cases, the significance of the two types of coefficients is consistent. Second, some correlation coefficients are not significant with only time series dependence but are highly significant with space and time series dependence, which is more significant in developed countries/areas (marked in italics and bold shaded in Table 3); spatial dependence may exist and be relatively strong in these countries/areas, strengthening the correlation between indices. Third, the spatiotemporal correlation coefficients are generally lower than those solely featuring time series correlations; possibly because correlations with time series dependence are more pronounced than those with spatial dependence, causing the composite of both correlations to decline. Overall, it appears possible to overestimate portfolio risks when exclusively considering time series dependence but not when combining such dependence with spatial correlation.
Table 3 also shows that, during the European debt crisis and other local crises, most spatiotemporal correlation coefficients were statistically significant; the number of significant coefficients in this period even surpassed that of the GFC. Relatedly, the correlations between developed stock markets as well as those between developed and emerging stock markets are larger and more significant than correlations between emerging stock markets.  These results mostly align with those in Table 2. For example, the significance of the two types of coefficients is basically consistent. Some correlation coefficients are not significant when examining time series dependence alone but are highly significant with space and time series dependence. However, the two tables have a notable difference: (1) the number of significant spatiotemporal correlations in Table 3 is greater than that in Table 2, and (2) the coefficients in Table 3 are also larger than that in Table 2. These findings contradict earlier studies, demonstrating that the correlations between assets during severe crises have been stronger than those during relatively minor crisis periods. There are two explanations for this: First, spatial effects tend to be more significant in times of minor crisis, whereas the composite of spatial and temporal correlations becomes stronger versus during the GFC. Second, during a financial crisis, more factors influence stock markets, in particular, subjective and random factors, such as the effects of external random events and investor sentiment, among others (Daniel et al. 1998;Barberis et al. 1998). Thus, the spatiotemporal correlation coefficients during the European debt crisis and other local crises are larger than those during the GFC in this study.

Robustness tests
Four robustness tests were conducted to verify the rationality of the proposed models: to (1) test other stages of the research sample, (2) test non-equal weights, (3) examine the model results using cluster analysis, and (4) test the index portfolio.

Test 1: sample replacement test
As the preceding empirical analysis only pertains to Stages 1 and 2 in the research sample, this study will further test the results based on Stages 3 (January 2, 2015-December 30, 2016) and 4 (January 3, 2017-November 29, 2019). The results are generally consistent with those from Stages 1 and 2: the correlation coefficients between the developed stock markets or between the developed and emerging stock markets are larger and more significant than those between the emerging stock markets. Moreover, the spatiotemporal correlation coefficient of assets during a severe crisis is smaller than that in a comparatively minor period (due to space limitations, all results cannot be presented here).

Test 2: test with non-equal weights
The spatiotemporal correlation coefficients in Tables 2 and 3 are based on an analysis with equal weights. The results with non-equal weights were computed to achieve clearer conclusions. Several cases involve non-equal weights. The specific test strategies are as follows: (1) let β 1 = 0.8, β 2 = 0.1, β 3 = 0.1 ; (2) let β 1 = 0.1, β 2 = 0.8, β 3 = 0.1 ; and (3) let β 1 = 0.1, β 2 = 0.1, β 3 = 0.8 , where β 1 , β 2 , and β 3 are the absolute distance, growth distance, and fluctuation distance in Model (4), respectively. The changes in the spatiotemporal correlation coefficients based on equal weight coefficients in the three cases determine the distance occupied by the main position. For example, in Case (1), if the coefficient β 1 of the absolute distance was 0.8 but the computed result of Model (4) slightly changed or was nearly equal to that with equal weight, then the absolute distance would have the least impact. Constant testing showed that the non-equally and equally weighted results were basically consistent. Among the three distances, the fluctuation distance is relatively more important.
The three coefficients are assigned different values and arranged in ascending and descending order, respectively, to achieve more general test results. The result is basically the same as the one mentioned above. The full results are not provided here due to length constraints.
Based on the definition of Formula (5) for the proposed model and previous studies, as well as the result of robustness Test 2, the advantages of the proposed spatiotemporal correlation coefficient model are as follows: (1) it is simple and easy to understand and does not require mastering profound mathematical theories and methods; (2) the process of coefficient calculation is simple and fast, and the weights of the coefficient can also be determined using a fast method.

Test 3: cluster analysis
Part 1The systematic clustering Ward method was used to compare the cluster analysis results for the spatiotemporal correlation coefficients with the time series correlations. Figs. 1, 2, 3 and 4 show the findings for the spatiotemporal correlation coefficients. Fig. 1 indicates that, given the six clusters, the aggregation coefficient curves nearly become stable as the number of clusters increases across the four stages. However, the aggregation coefficient curve in Stage 1 is slightly steeper than the other curves (i.e., the stable speed is slightly slower than in the other three stages). Stage 1 covers the GFC, at which time the inter-variable correlations were diverse; thus, the corresponding cluster results would become more complex and the steady speed would slow down. Ultimately, the optimal number of clusters is six.
Figs. 2, 3, 4 and 5 show the detailed cluster results. The cluster results share the following features: First, all separately classified stock indices fall under the developing markets, whereas the others fall under the developed or developing markets. Second, the classification results are relatively stable; for instance, the 29th stock index is separated as a single category in each of the four stages, and the number of other categories remains significantly identical with the exception of Stage 1. The economic situation in Stage 1 was complex, characterized by violent stock market fluctuations; thus, fluctuation distance has a relatively significant effect on the spatiotemporal correlation coefficient and causes the number of variables in this stage to differ slightly from the other stages. The developing-developed markets or developing-developing markets are divided into subcategories, and the developed-developed markets faced a classification reduction. The cluster results of the spatiotemporal correlations are accordingly realistic.
The cluster results were compared with the findings for the time series correlations to further confirm their rationality (see Fig. 8 in the Appendix). The number of clusters is not stable (i.e., four clusters in Stages 1 and 3 vs. three clusters in Stages 2 and 4). The inconsistency and instability of the time series correlation results are inconducive to risk classification and risk management. Few classifications emerge in Figs. 9, 10, 11 and 12 (see "Appendix"), and some underdeveloped markets are rarely listed separately.
However, other underdeveloped markets demonstrate little economic relevance to other countries/areas. If the cluster result is extremely irregular, then effectively distinguishing risks in the future will be impossible. Hence, the risk management of investors will be compromised.   Tables 2 and 3 Part II The clustering results of the spatiotemporal correlations were compared with the spatial correlation results. First, a spatial correlation test on the 29 indices was conducted, and Table 4 shows the results. (In this test, the local Moran's I proposed by Anselin (1995) was used to measure the spatial correlation.) If the correlation is statistically significant, then further analysis will be conducted. Second, the spatial clustering analysis will be conducted based on the results of the first step of the spatial correlation test.
Based on the results in Table 4, the significance levels of the spatial correlations differ in the four stages. The significance levels in Stage 3 are the lowest perhaps due to the short period of time involved. The spatial correlation cannot be fully displayed  Tables 2 and 3 within a short period of time. It needs longer time to show the correlation as compared to the time series correlation. However, the significance levels in the other stages are extremely notable. Therefore, the spatial correlations exist in the stock indices.
Subsequently, the spatial clustering analysis was conducted and compared with that with the spatiotemporal correlations. The cluster results share the following features: First, separately classified stock indices fall under the developed markets, but separately classified coexistent falls under the developed and developing markets in Stage 1, whereas the others fall under the developed or developing markets. This cluster result is an inconsistent and unstable classification. Second, the number of clusters (see Fig. 13 in the Appendix) was compared with the findings for spatiotemporal correlation. The results show that the number is inconsistent (i.e., four clusters in Stages 2 and 3 vs. three clusters in Stages 1 and 4). Third, the cluster scale is extremely uneven (e.g., the clusters in Stages 1 and 4): the largest cluster contains 25 indices, but the smallest only contain 1 index (see Figs. 14,15,16,17 in the Appendix). This result will lead to high misclassification.
Thus, based on the spatiotemporal correlations, the cluster results are more advantageous that those with only spatial correlation or time series correlation.

Test 4: test of index portfolio
The index portfolio was also tested to further examine the spatiotemporal correlations. The test involves two processes: (1) comparing Sharpe portfolio values with spatiotemporal/time series correlations and (2) calculating the value at risk (VaR) based on the two correlations for portfolio cross validation. Part I: The Sharpe ratios of the portfolio in different stages were computed: First, the mean value of the logarithmic returns of each variable at each stage was computed, the highest and lowest two returns were eliminated, and their difference was calculated and divided into 50 parts. The 50 parts of returns were set as the target return of the portfolio, and the portfolio weight corresponding to the minimum VaR of the portfolio with the constraint of the target return and a certain confidence level were computed (equal to 0.95 in this study). Second, the command corr2cov in MATLAB was used to calculate the portfolio covariance based on the two correlation coefficients; the 'portstats' command in MATLAB was used to calculate the variance of the portfolio. The portfolio weight and covariance and the mean log return of each stock index are taken as command parameters. Last, the risk-free interest rate was assumed as zero, and the ratio of the excess return to variance was calculated to obtain the Sharpe ratios. Figure 6 shows the computation of the Sharpe portfolio values, and Table 5shows the final results.
To calculate the Sharpe portfolio values more quickly, the correlation type of stock index in return in this part was not included but only in the portfolio volatility risk.
The Sharpe ratios for the spatiotemporal correlations are larger than those for the time series correlations when the ratios are positive. Conversely, when the ratios are negative, the Sharpe ratios for the spatiotemporal correlations are smaller than those for the time series correlations. A positive Sharpe ratio normally leads to a higher index value, greater excess return when taking the unit system risk, and better investment performance. On the contrary, a negative Sharpe ratio indicates that the investment risk associated with  ST spatiotemporal correlation, T time series correlation the stock indices is higher than the rate of return, and the investment is not feasible. Thus, when the Sharpe ratio of investment is positive, then investors must be careful not to underestimate the return and give up an investment opportunity. However, when the Sharpe ratio is negative, then it is important for investors to consider investment risks to avoid potential losses. Therefore, the investment Return can be underestimated when the investment return is positive, while the risk tends to be underestimated when the return is negative. Thus, a model based on the spatiotemporal correlations is more practical and can offer investors more prudent guidance.
Part II: Portfolio cross-test In this part, stock index returns are considered to be time series related or spatiotemporal related, considering the correlation of fluctuation of the return as well, to predict the portfolio risk (taking VaR as the measure of the risk) and further prove the advantage of the spatiotemporal correlation. If the stock index returns are time series related, then the returns are obtained using panel data model regression; however, if the stock index returns are spatiotemporal related, then the returns are obtained using spatial panel data models.
The calculation process is as follows: First, the panel data in each stage was divided into two parts. The first part (about 1/3 of the total) was used as the training set for regression to solve the coefficients for the independent variables in the model; the second part was used as a test set employed the coefficients of the independent variables to predict the stock index return. Second, the portfolio return and variance of the stock indices were calculated. The portfolio variance was still obtained from the portstats command in MATLAB as shown in Fig. 6 by taking portfolio return, investment weight, and portfolio covariance as input parameters. To calculate the covariance, the time series/spatiotemporal correlation coefficient at each stage shown above was used as the correlation coefficient, and the standard deviation of each stock index was calculated based on the predicted return series. Third, the VaR of the stock index portfolio under a certain confidence was calculated, and then the results of VaR were compared with the actual data to prove the correlation that is more accurate in predicting the investment risk. To calculate the VaR, the returns were assumed to follow a normal distribution, and VaR α =û + φ −1 (α) × σ 2 port was applied, where û is the predicted portfolio return, φ −1 (α) is the α-quantile inverse probability distribution function under the standard normal distribution, and σ 2 port is the predicted portfolio variance. The next section explains the process more clearly.

Model setting
For the panel data model regression, the stock index return was taken as the dependent variable and some commonly used macroeconomic variables as the independent variable. The model of the formula is as follows: (5) In Model (5), r i,t is the return, GDP i,t is the change rate of gross domestic product, CPI i,t is the change rate of consumer price index, RE i,t is the change rate of international reserve, ExR i,t is the change rate of exchange rate, and Trade i,t is the change rate for the level of import and export trade. In addition, ε i,t is the residual term and β 0 is the intercept term. In most of the above variables, the subscript is the value corresponding to index i at time t. The data of the macro explanatory variables were obtained from the World Bank.
As for the spatial panel data models, the spatial lag regression model with a fixed effect was selected as the basis for calculating the stock index based on the spatial model test method proposed by LeSage and Pace (2009). The model can be represented as where, in Model (6), w ij is the spatial weight based on the distance of exchange rate level between two indices and k is the coefficient of spatial effect from j to i. Model (5) shows the other variables and symbols. The relevant spatiotemporal econometric models, such as that from Song et al. (2011) or Zhu et al. (2013), were applied to estimate the return, and the portfolio return for the VaR with the spatiotemporal correlations was calculated. However, since estimating the parameter for the spatiotemporal econometric model is somewhat challenging and article space is limited, we would have struggled to explain the computing process clearly.

Model analysis
In this part, the cross-test assumes that each stock index is invested with the same weight. Then, the VaR calculation results based on the two correlation coefficients were obtained (see Table 6 and Fig. 7). Table 6 shows that the VaR forecasting results with spatiotemporal correlation corresponds to higher p values in general. For example, in Stage 1? p values in the UC and CC tests of VaR based on the spatiotemporal correlation is a little lower than that with the time series correlation, but the p value in the IND test far exceeds that with the time series correlation. This scenario also occurs in Stage 2. In Stage 3, the p value with a spatiotemporal correlation in the IND test is also higher than that with the time series correlation when the values of the other UC and CC tests are the same. In Stage 4, p values in the UC and CC tests with the spatiotemporal correlation exceed those with the time series correlation, but the p values in the IND test is lower than that with the time series correlation. The findings imply that portfolio risk prediction is more accurate when using the spatiotemporal correlation coefficient.
The VaR prediction results in the four stages were compared with the actual portfolio returns to achieve clearer results. In Fig. 7, the blue line is the VaR based on the time series correlation, the green line is the VaR based on the spatiotemporal correlation, and the red line are the actual portfolio returns. In most cases, the green line is below the blue one. Combined with the results in Table 6, the traditional VaR forecasting method based on the time series correlation underestimates the portfolio (6) risk because the VaR based on the spatiotemporal correlation involves more factors, in particular, the portfolio return, considering the effects from the other indices. In Stage 4, the green line is a little above the blue line because, in this relative stable stage, the impact from the other indices is weaken, and then the two lines are closer in values.
In addition, (1) the forecasting line tends to be a straight line, while the fluctuation of the actual portfolio returns are significantly. This is because in the VaR forecasting process, the return of portfolio is basically only affected by macro variables, which change little in a short period of time but basically once a year. Therefore, the change of portfolio return and the fluctuation of the VaR forecasting result are minimal. (2) The VaR prediction results based on the spatiotemporal correlation may occasionally be affected by external time, and several points of the predicted values are extremely high. In future studies, these noise interference points will be removed. (3) Due to space limitations, only the VaR prediction results at the 95% confidence level are shown in this study. In fact, the prediction conclusion is still valid under the confidence level of 97.5% or 99%. Meanwhile, in the case of minimum portfolio risk and maximum return, the VaR performance based on the proposed spatiotemporal correlation coefficient is still better than that with the time series correlation. Table 6 VaR forecasting results based on the two correlations (Christoffersen test (Christoffersen, 1998)) The table presents significance p values and their corresponding statistics in the VaR backtesting examination. Where, the statistical values are outside the brackets, and the p values are inside the brackets. The lower statistics (higher p-values) in the UC, IND, and CC tests, the better results are. According to Kupiec (1995) and Candelon et al. (2011) Furthermore, although method to compute the portfolio variance (see Gong and Weng 2016) already exists, the variance of the spatiotemporal correlation regression model and other relevant parameters still needs to be examined first. The traditional method is more time-consuming, laborious, and difficult to understand compared to using the spatiotemporal correlation coefficient in this study. Meanwhile, the spatial correlation coefficient (e.g., Morans I), which is often used as a measure of spatial correlation, is only a qualitative judgment, and spatial dependence cannot depict one-to-one correlations but instead reveals many-to-one relationships. Thus, no studies have proven that it can be directly involved in the calculation process of covariance. Therefore, the proposed correlation has strong theoretical and practical significance.

Implications for risk management
Based on the proposed model of spatiotemporal correlation coefficients, correlations can be quickly estimated to determine the investment risks and performance in advance. For example, upon obtaining the values of the three distances, each distance must be normalized within the interval of [0,2]. The spatiotemporal correlation can be determined after confirming the weight of each distance. A reasonable asset allocation strategy can then be swiftly conducted. This expedited decision-making approach is particularly important under the circumstances of financial global integration; the risk of such integration will be extensive, calling for more rapid decisions.
Furthermore, because the proposed model can rapidly assess risks without requiring tedious regression analysis or other methods such as complex neural networks (Hossen et al. 2015;Cheng and Wang 2009;Huang et al. 2016;Zedda and Cannas 2020;Siller 2013), governments can classify investment risks into levels according to spatiotemporal correlation coefficients to determine risk protection. In addition, investment institutions or individual investors can devise a fast portfolio strategy by computing the VaR with spatiotemporal correlations.
Meanwhile, based on spatiotemporal correlations, investors, financial institutions, and financial management departments can perform stress tests on investment risks. When using VaR scenario construction, which considers the relevance between a pair of risk factors, the spatiotemporal correlations of risk factors can be simulated in various scenarios to evaluate the possible effects of extreme risks on portfolio value. Investors can then confirm their risk tolerance, and financial institutions can reserve sufficient risk margins to cope with extreme events. Therefore, the spatiotemporal correlation analysis allows individual investors or financial institutions to make more accurate assessments, grasp the effects of extreme periods, and enhance risk management effectiveness and reliability.
In addition, given that the fluctuation distance of economic data is relatively more important when modeling spatiotemporal correlation, investors can prioritize this distance or only examine it when investing during crises. The spatiotemporal correlation model implies that a rough evaluation of the fluctuation distance and distance weight can estimate spatiotemporal correlation values. Investors can then judge which type of correlation, such as a time series correlation or spatial correlation, plays a key role in risks. They can then assess and reduce risks more effectively.
The clustering based on the spatiotemporal correlation coefficient described above has more types, and the scale of each type is relatively balanced. Therefore, if the risk is classified based on the spatiotemporal correlation coefficient, then the result would be more reasonable, which is conducive to the scientific prediction of risks. In addition, a cluster analysis based on spatiotemporal correlation coefficient can optimize the selection of portfolio.
The proposed spatiotemporal model can also be extended by incorporating other viable factors, such as investors' preferences, into the model. Thus, the proposed approach can be adapted to realistic situations. Such flexibility renders the model especially useful for international investment under complex circumstances. Moreover, the proposed correlation coefficient can be applied not only to financial investment or risk fields but also to other fields, such as industrial and commercial enterprises, risk management enterprises, regional economic management, insurance industry premium determination, etc.

Conclusions and future research directions
This study presents an adaptive measurement model of spatiotemporal correlation coefficients based on the clustering theory. The proposed method combines information regarding absolute distance, incremental distance, and fluctuation distance. An empirical analysis of the spatiotemporal correlations for stock indices is conducted based on the proposed model. The results show that, first, the spatiotemporal correlation coefficient with adaptive distance is feasible; it depicts various sources of risks and is readily applicable. Second, with regard to financial markets, spatiotemporal correlations during developed markets are usually higher but are lower in crisis. Spatiotemporal correlations with non-equal distance weights are also often higher than those with equal weights if the weight of the fluctuation distance is lower than 0.33. However, if the spatiotemporal correlation model contains only one type of distance, then the spatiotemporal correlations are often lower than those with equal distance weights (except for the fluctuation distance, which plays a relatively more important role). Last, the clustering results are more diverse and detailed with spatiotemporal correlations, thereby facilitating accurate risk management and control. However, several model features need to be further examined: (1) when using the model, various distances must be mapped into the range of [0, 2] according to the lemma (see "Design and measurement of spatiotemporal correlation" section); (2) the model is expandable, that is, other information can be added, which makes the model amenable to actual situations; and (3) the applicability of the model in other scenarios should be tested. For example, this study uses low-frequency data; therefore, more studies must be conducted to examine if the models are applicable in high-frequency data. Mo et al. Financial Innovation (2023) Tables 2 and 3 See Schedules 7 and 8.