*P zqi* = *k*, *zpj* = *k* 0 0*z*−*qi*, *z*−*pj*, *wqi*, *wpj P zqi* = *k*, *zpj* = *k* 0 0*z*−*qi*, *z*−*pj*, *wqi*, *wpj* ∝ *P zqi* = *k*, *zpj* = *k*, *wqi* = *t*1, *wpj* = *t*2 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj* = *P zqi* = *k*, *zpj* = *k*, *wqi* = *t*1, *wpj* = *t*2, *θu*, *θu*, *ϕk* 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj dθudθudϕk* = *P zqi* = *k*, *θu* 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj* ·*P zpj* = *k*, *θu* 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj* ·*P wqi* = *t*1, *ϕk*,*wqi* 0 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj* ·*P wpj* = *t*2, *ϕk*,*wpj* 0 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj dθudθudϕk*,*wqidϕk*,*wpj* = *P zqi* = *k* 0 0*θu P θu* 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj* ·*P zpj* = *k* 0 0*θu P θu* 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj* ·*P wqi* = *t*1 0 0 0*ϕk*,*wqi P ϕk*,*wqi* 0 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj* ·*P wpj* = *t*2 0 0 0*ϕk*,*wpj P ϕk*,*wpj* 0 0 0*z*−*qi*, *z*−*pj*, *w*−*qi*, *w*−*pj dθudθudϕk*,*wqidϕk*,*wpj* = *P zqi* = *k* 0 0*θu Dir θu* 0 0*nq*,−*qi* + *α* ·*P zpj* = *k* 0 0*θu Dir θu* 0 0*np*,−*pj* + *α* ·*P wqi* = *t*1 0 0 0*ϕk*,*wqi Dir ϕk*,*wqi* 0 0 0*nq k*,−*qi* + *β* ·*P wpj* = *t*2 0 0 0*ϕk*,*wpj Dir ϕk*,*wpj* 0 0 0*np k*,−*pj* + *β dθudθudϕk*,*wqidϕk*,*wpj* = *θ* (*k*) *u Dir θu* 0 0 0*n*(*k*) *q*,−*qi* + *α* ·*θ* (*k*) *u Dir θu* 0 0 0*n*(*k*) *p*,−*pj* + *α* ·*ϕ*(*t*1) *k Dir ϕk*,*wqi* 0 0 0*nq*(*t*1) *k*,−*qi* + *β* ·*ϕ*(*t*2) *k Dir ϕk*,*wpj* 0 0 0*np*((*t*2) *k*,−*pj* + *β dθudθudϕk*,*wqidϕk*,*wpj* = E *θ* (*k*) *u* 2 ·*E ϕ*(*t*1) *k* ·*E ϕ*(*t*2) *k* = *n*(*k*) *q*,−*qi*+*α* ∑*K k*=1 *n*(*k*) *q*,−*qi*+*Kα* · *n*(*k*) *p*,−*pj*+*α* ∑*K k*=1 *n*(*k*) *p*,−*pj*+*Kα* · *n q*(*t* 1) *k*,−*qi*+*β* ∑*V v*=1 *nq*(v) *k*,−*qi*+*Vβ* · *np*((*t*2) *k*,−*pj* +*β* ∑*V v*=1 *np*(v) *k*,−*pj*+*Vβ* (1)

Inside, *wqi* = *t*1 denotes the *i*th word in the query *q* is *t*1. *wpj* = *t*2 denotes the *j*th word in the webpage *p* is *t*2. *z*−*qi* denotes the topic assignments to all words except the *i*th word in the query *q*. *z*−*pj* denotes the topic assignments to all words except *j*th word in the webpage *p*. *w*−*qi* denotes all words except the *i*th word in the query *q*. *w*−*pj* denotes all words except the *j*th word in the webpage *p*. *n*(*k*) *q*,−*qi* denotes the number of words generated by topic *k* in the query *q* excluding the *i*th word in the query *q*, *n*(*k*) *p*,−*pj* denotes the number of words generated by topic *k* in the webpage *p* excluding the *j*th word in the webpage *p*, *nq*,−*qi* = *n*(1) *q* , *n*(2) *q* , ··· , *n*(*k*) *q* − 1, ··· , *n*(*K*) *q* denotes the number of words generated by topic *k* in the query *q* excluding the *i*th word, *np*,−*pj* = *n*(1) *p* , *n*(2) *p* , ··· , *n*(*k*) *p* − 1, ··· , *n*(*K*) *p* denotes the number of words generated by topic *k* in the webpage *p* excluding the *j*th word. *nq*(*t*) *k*,−*qi* denotes the number of times the word *t* is assigned to the topic *k* excluding the *i*th word in the query *q*, *nq k*,−*qi* = *nq*(1) *k* , *nq*(2) *k* , ··· , *nq*(*t*) *k* − 1, ··· , *nq*(*V*) *k* . *np*(*t*) *k*,−*pj* denotes the number of times the word *t* is assigned to the topic *k* excluding the *j*th word in the webpage *p*, *np k*,−*pj* = *np*(1) *k* , *np*(2) *k* , ··· , *np*(*t*) *k* − 1, ··· , *np*(*V*) *k* .

Algorithm 1 summarizes the overall procedure of Gibbs sampling to estimate the parameters *θu*, *ϕk*. First, the assignments of topic to each word are initialized according to a uniform distribution. Then, the assignment of topics to each word will be updated by examining Equation (1). Finally, *n*(*k*) *q* , *n*(*k*) *p* , *nq*(*v*) *k* , *np*(*v*) *k* can be counted after a sufficient number of iterations. *n*(*k*) *q* denotes the number of times the topic *k* occurs in the query *q*. *n*(*k*) *p* denotes the number of times the topic *k* occurs in the webpage *p*. *nq*(*v*) *k* denotes the number of times the word *v* is assigned as a query word to topic *k*. *np*(*v*) *k* denotes the number of times the word *v* is assigned as a webpage word to topic *k*.

Here, we only give the derivation of the parameter *θu*, the derivation of other parameters is the same.

$$\begin{array}{l} P(\;\theta\_{\mathsf{u}}\;|n\_{\mathsf{u}\prime}\;\alpha) = \frac{P(n\_{\mathsf{u}}\mid\theta\_{\mathsf{u}})P(\theta\_{\mathsf{u}}\mid\alpha)}{\int P(n\_{\mathsf{u}}\mid\theta\_{\mathsf{u}})P(\theta\_{\mathsf{u}}\mid\alpha)d\theta\_{\mathsf{u}}}\\ = \frac{Mult(n\_{\mathsf{u}}\mid\theta\_{\mathsf{u}})Dir(\theta\_{\mathsf{u}}\mid\alpha)}{\int Mult(n\_{\mathsf{u}}\mid\theta\_{\mathsf{u}})Dir(\theta\_{\mathsf{u}}\mid\alpha)d\theta\_{\mathsf{u}}}\\ = Dir(\theta\_{\mathsf{u}}\mid\alpha+n\_{\mathsf{u}}) \end{array}$$

Inside, *nu* = *nq* + *np*

The estimated value of each parameter is:

$$E(\theta\_{\mathsf{u}}) = \left( \frac{n\_{\mathsf{q}}^{(1)} + n\_{\mathsf{p}}^{(1)} + a}{\sum\_{k=1}^{K} n\_{\mathsf{q}}^{(k)} + n\_{\mathsf{p}}^{(k)} + \text{Ka}}, \dots, \frac{n\_{\mathsf{q}}^{(k)} + n\_{\mathsf{p}}^{(k)} + a}{\sum\_{k=1}^{K} n\_{\mathsf{q}}^{(k)} + n\_{\mathsf{p}}^{(k)} + \text{Ka}}, \dots, \frac{n\_{\mathsf{q}}^{(K)} + n\_{\mathsf{p}}^{(K)} + a}{\sum\_{k=1}^{K} n\_{\mathsf{q}}^{(k)} + n\_{\mathsf{p}}^{(k)} + \text{Ka}} \right) \tag{2}$$

$$E(q\_k) = \left(\frac{n\_k^{q(1)} + n\_k^{p(1)} + \beta}{\sum\_{v=1}^{V} n\_k^{q(v)} + n\_k^{p(v)} + V\beta}, \dots, \frac{n\_k^{q(v)} + n\_k^{p(v)} + \beta}{\sum\_{v=1}^{V} n\_k^{q(v)} + n\_k^{p(v)} + V\beta}, \dots, \frac{n\_k^{q(V)} + n\_k^{p(V)} + \beta}{\sum\_{v=1}^{V} n\_k^{q(v)} + n\_k^{p(v)} + V\beta}\right) \tag{3}$$

Finally, the topic feature vector of each user can be expressed as *θu*.

Similarly, we can use LDA [21] to mine each product's topic feature vector from its online reviews: *θi*.

#### **Algorithm 1:** The Gibbs sampling for ALDA

Input : topic number *K*, vocabulary number *V*, document sets, *α, β*. Output : *θu*, *ϕk*.

1. Initialization

Sample *zqi*, *zpj* according to the uniform distribution

$$n\_q^{(k)} = n\_q^{(k)} + 1$$
,  $n\_q = n\_q + 1$ ,  $n\_p^{(k)} = n\_p^{(k)} + 1$ ,  $n\_p = n\_p + 1$ ,  $n\_k^{q(t)} = n\_k^{q(t)} + 1$ ,  $n\_k^q = n\_k^q + 1$ ,  $n\_k^{p(t)} = n\_k^{p(t)} + 1$ ,  $n\_k^p = n\_k^p + 1$ .

2. Gibbs sampling

For each query *q* and webpage *p* do:

For each word *wqi* in query *q* do:

(1) *zqi* = *k*→*n*(*k*) *q* = *n*(*k*) *q* − 1, *nq* = *nq* − 1, *nq*(*t*) *k* = *nq*(*t*) *k* + 1, *nq k* = *nq k* + 1. (2) Sample *zqi* = ˆ *k* ∼ P *zqi* = *k* 0 0 0*z*−*qi*, *wqi* according to Equation (1) *n*(ˆ *k*) *q* = *n*(ˆ *k*) *q* − 1, *nq* = *nq* − 1, *nq*(*t*) ˆ *k* = *nq*(*t*) ˆ *k* + 1, *nq* ˆ *k* = *nq* ˆ *k* + 1. For each word *wpj* in webpage *p* do: (1) *zpj* = *k*→*n*(*k*) *p* = *n*(*k*) *p* − 1, *np* = *np* − 1, *np*(*t*) *k* = *np*(*t*) *k* + 1, *np k* = *np k* + 1. (2) Sample *zpj* = ˆ *k* ∼ P *zpj* = *k* 0 0 0*z*−*pj*, *wpj* according to Equation (1) *n*(ˆ *k*) *p* = *n*(ˆ *k*) *p* − 1, *np* = *np* − 1, *np*(*t*) ˆ *k* = *np*(*t*) ˆ *k* + 1, *np* ˆ *k* = *np* ˆ *k* + 1. 3. Parameter estimation

Estimating *θu*, *ϕk* according to Equations (2) and (3)

#### *3.3. Convolutional Feature Learning of User and Item*

The searching-scenario oriented hypergraph obtains high-order correlations between data, while it contains heterogeneous vertices (i.e., user vertex, query vertex, item vertex, feature vertex). Thus, it is necessary to obtain not only high-order information between paths but also vertex-based semantic information within paths. Therefore, based on the searching-scenario oriented hypergraph, this paper utilizes a dual-embedding mechanism [47] and hyperedge convolution [46] to obtain high-order information between paths and vertex-based semantic information within paths, respectively.

#### 3.3.1. Path Semantic Association Learning

A path contains any number of nodes, these nodes are of the same or different types, so the generated paths have different semantic information. In this paper, dual-embedding mechanism [47] is used to obtain semantic associations among consumers' online queries, their click, purchase, and online review behavior.

The semantic associations among consumers' online queries, their click, purchase, and online review behavior is illustrated as follows. Take the query "harry potter" for example. By using the searching-scenario oriented hypergraph, "harry potter" entered by different users can reach different items such as "harry potter PVC figure", "harry potter book", "harry potter magic wand" or "harry potter LEGO". Obviously, we can obtain more recommendation candidates for the query "harry potter" by using the searching-scenario oriented hypergraph. More importantly, the structural superiority of the searching-scenario oriented hypergraph gives the recommender system a chance to identify different semantic facets of the input search phrases. Similarly, the searching-scenario oriented hypergraph can leverage user behavior to mine related queries with different query phrases. For example, the query "python" entered by user A and the query "Data Analysis" entered by user B can reach the same book "Python for Data Analysis". We can infer from this example that consumer B who bought the book had a preference for using Python even though it was not explicitly expressed in his query. Query-item collaborative filtering greatly solves the item entity recall problem under sparse data.

Therefore, to augment semantic information propagation and training efficiency, we use second-order neighbor relations instead of first-order neighbor relations. To ensure the timeliness of recommended items, we use a strategy of 20% uniform sampling and 80% popularity-based sampling to sample node neighbors.

#### 3.3.2. Convolutional Semantic Features Learning

Not only are there complex associations between paths but the vertices in paths also contain rich semantic information. This paper adopts hyperedge corruption [47] to cut the hyperedge into ordinary edges, which connect the user-query, query-item, and item-feature, respectively. Then, ordinary edges are used to generate association matrices, and the initial weights of the vertices are calculated to generate the hypergraph Laplacian matrix based on meta-path information. Then, this matrix is added to the hypergraph neural network [46] to learn the hyperedge convolution:

$$X^{(l+1)} = \sigma \left( D\_v^{-\frac{1}{2}} H W D\_\varepsilon^{-1} H^T D\_v^{-\frac{1}{2}} X^{(l)} \Theta^{(l)} \right) \tag{4}$$

where *X*, *Dv*, *De*, and Θ is the signal of the hypergraph at *l* layer, *σ* denotes the nonlinear activation function.

Therefore, the final convolutional feature can be obtained by connecting *L* layer features:

$$\mathbf{x}\_{\mathsf{H}} = \left[ \mathbf{X}^{0}, \mathbf{X}^{1}, \dots, \mathbf{X}^{L} \right] \tag{5}$$

Similarly, for the online reviews of each item *i*, the corresponding convolutional semantic feature *xi* can be obtained through the hypergraph neural network.

#### *3.4. Prediction*

For each user *u*, the obtained convolutional semantic feature *xu* and query topic feature *θu* are combined to represent the final user embedding X*u* of user *u*:

$$\mathcal{X}\_u = \mathfrak{x}\_u \oplus \theta\_u \tag{6}$$

Similarly, the final feature X*i* of each item *i* is:

$$\chi\_i = \mathfrak{x}\_i \oplus \theta\_i \tag{7}$$

Since the number of words in each query is different, the dimension of the word vector matrix is inconsistent, which cannot be processed by the convolutional neural network. Therefore, this paper fixes the number of search phrases in each query as 32, that is, when the number of words is less than 32, it is filled with 0, and when the number of words is greater than 32, the first 32 words are taken. This paper uses BERT to pre-train all the obtained text content to obtain vectors of words X*q*.

We want to integrate query embedding, user embeddings, item embedding, and highorder correlations to capture more complex connections. We utilize a deep architecture [48] to predict link relationships between users, queries, items, and features:

$$\Psi = \phi\_L\left(\phi\_{L-1}\left(\dots\phi\_1\left(\left\lfloor X\_q; X\_u; X\_i \right\rfloor\right)\right)\right) \tag{8}$$

where [;;;] concatenates the input vectors and {*φ*1, *φ*2,..., *φL*} are non-linear layers with sigmoid as the active function.

We also take the widely used binary cross-entropy as the loss function:

$$\mathcal{L} = \sum y \log(\mathcal{Y}) + (1 - y) \log(1 - \mathcal{Y}) + \lambda \omega^2 \tag{9}$$

where *ω* is the learnable parameters set, *λ* is the regularization parameter.

#### **4. Results**

In order to test the improvement of the proposed Topic-HGNN framework, we conducted experiments based on different datasets obtained from real-world applications. The experiments were designed to verify two aspects of the proposed recommender framework: (1) the quality of topics in online query sessions identified by the ALDA model, and (2) the improvement of recommendation accuracy and novelty of the Topic-HGNN framework that connects the latent topics embedded in consumers' online queries to their click, purchase, and online review behavior.

All empirical evaluations in this paper were implemented on a Dell Precision T5820 workstation with Xeon W-2102 CPU, 8.00 GB RAM, and we chose to implement the program in the Python language.

#### *4.1. Data Description*

The public AOL query log dataset (http://www.gregsadetsky.com/\_aol-data accessed on 18 September 2019) in the real word is used for experimental verification. This collection consists of 20 M web queries collected from 650 k users over three months in 2006. The data is sorted by anonymous user ID and sequentially arranged. The data set includes {AnonID, Query, QueryTime, ItemRank, ClickURL}. AnonID represents an anonymous user ID number. Query indicates the query issued by the user. QueryTime indicates the time at which the query was submitted for search. If the user clicked on a search result, the rank of the item on which they clicked is listed, and it is marked as ItemRank. If the user clicked on a search result, the domain portion of the URL in the clicked result is listed, which is marked as ClickURL.

We preprocessed the AOL query log dataset before conducting experiments. First, we successively removed query terms containing URL strings, query terms containing special characters, and query terms that did not contain click URLs. Then, we utilized "15 min interval" [50] to derive reasonable session breaks in online queries in order to better investigate the effectiveness of the ALDA model. Finally, we divided each user's search records into training sets and test sets with a ratio of 80%/20%. Part of the AOL query log dataset format is shown in Table 2.

The Retailrocket data (https://www.kaggle.com/retailrocket/ecommerce-dataset accessed on 18 September 2019) was collected from a real-world e-commerce site. The data includes 2,756,101 behavior records from 1,407,580 users, including 2,664,312 views, 69,332 cart additions, and 22,457 purchases.

**Table 2.** The example of the AOL query log dataset.

The entire dataset contains three files: behavioral data file, category relationship file, and item properties file. Each row of data describes the user's behavior on an item at a certain time.

#### *4.2. Evaluation of the ALDA Model*

In order to examine the quality of topics in online query sessions identified by the ALDA model proposed in our paper, five typical methods for inferring user preference distributions are selected as baseline methods.

We use the AOL query log dataset in this section. By comparing the parameter settings of the above models, we set the hyperparameters *α* = 50/*K*, *β* = 0.01, *γ* = 0.5.

#### 4.2.1. Topic Coherence

Topic coherence is mainly used to measure whether the words within a topic are coherent. So, how can these words be considered coherent? If the words support each other, then the group of words is coherent. In other words, if you put words from multiple topics together and cluster them with a perfect cluster, then words from the same topic should be in the same category. *PMI* uses external text datasets to measure the coherence of a topic, which is a fair metric of evaluating the quality of topics extracted by each model. The PMI can be calculated by:

$$PMI\left(w\_{i\prime}, w\_{\slash}\right) = \log \frac{p\left(w\_{i\prime}w\_{\slash}\right) + \epsilon}{p\left(w\_{i}\right) \cdot p\left(w\_{\slash}\right)}$$

where *wi* and *wj* are topic words, and is a random disturbance term. The larger the value of PMI, the better the coherence between topic words.

To further evaluate the PMI of randomly selected topics, Wikipedia articles downloaded from the official Wikipedia website were used as an auxiliary corpus. We selected the top 5, 10, and 20 words in each topic and calculated the average PMI score. Figure 3 shows the topic coherence results of selected topics learned by each topic discovery model. In the comparison of six models, it clearly shows that the PMI score of our ALDA model is significantly better than the other models. The results demonstrate that topics extracted by our ALDA are more coherent than other models. This is due to the fact that our ALDA conjointly models the topic intensities in the query sessions and the topic intensities in the webpages into the same document layer. The data sparsity of online query data is avoided by aggregating corresponding webpages to assist in learning users interested topics. Because Twitter-BTM and LDA can only model query documents and webpage documents separately, these two models perform worst. Twitter-BTM outperforms LDA because Twitter-BTM inherits BTM's excellent ability to deal with short texts. UCIT and UATM significantly outperforms Twitter-BTM and LDA. This is because UCIT and UATM not only extract topics from content generated by the user themself but also extracts topics from content generated by user clusters that are similar to them. HDLDA can generate more coherent topics than UATM, UCIT, Twitter-BTM, and LDA. This is because HDLDA

models query the document and the webpage document in two hierarchical LDA processes. HDLDA can better capture the semantic relation between query and webpage.

Unlike HDLDA, which models the topic intensities in the query sessions and the topic intensities in the webpages, our ALDA conjointly models the topic intensities in the query sessions and the topic intensities in the webpages into the same document layer. Thus, our ALDA obtained better results than HDLDA.

#### 4.2.2. User's Preference Prediction

We utilize perplexity to compare the accuracy of predicting users' content preference drift estimated by these models. As perplexity in information theory is a measure that is often used to judge probability models or probability distribution prediction samples, we utilize perplexity to evaluate the effect of user's preference inferred by each model. The ability of perplexity is to predict words in new documents, which are not observed. The smaller the value of perplexity, the better the performance of the model in mining user's intention. *Perplexity* can be calculated as follows:

$$\operatorname{Perplexity}\_{\text{partition}}(\mathcal{M}) = \left(\sum\_{d=1}^{D} \sum\_{i=P+1}^{N\_d} p\left(w\_i | \mathcal{M}\_\prime \, w\_{1:p}\right)\right)^{-\frac{1}{\sum\_{d=1}^{D} (N\_d - p)}}$$

where M is the set of model parameters learned from the training set, *d* represents the document, and *Nd* is the number of words in the document.

To make the experimental results more reliable, we sample the observed in the AOL dataset at different scales (from 10% to 90%). It can be seen from Figure 4 that the perplexity of each model gradually decreases with the expansion of the percentage of the observed data. This shows that each model gets better at predicting consumer preferences with the growth of the observed data. Compared with the other five models, the perplexity degree of our ALDA model is the smallest, from 1100 to 2500, which indicates that ALDA preforms best among the six models for identifying consumer interests. This is because ALDA models the interactive relationship between queries and webpages. In reality, a consumer's shopping process is actually a process of understanding and evaluating products. First, users may enter inaccurate keywords to express their needs. Then, users enhance their understanding of products through browsing the search results and adjusting the input keywords. Consumers will repeat this learning process until finding the right product. That is to say, the topics of query keywords and the topic of search results are semantically related to each other. Thus, modeling this interaction between queries and webpages helps us to more accurately capture changes in consumer's interests and preferences. This is the fundamental reason our model is better than other models in identifying consumers' purchase intentions.

**Figure 4.** Comparison of user's preference inferring performance.

As LDA and Twitter-BTM do not model how the topics in search queries relate to the topics in the corresponding search results, they obtain the worst performance on understanding users' preference. Both UCIT and UATM learn the topic distributions in the user's content and followees' content, which enables extensive mining and understanding of user's preference and intention, and the experimental results also confirm that UCIT and UATM significantly perform better than LDA and Twitter-BTM. HDLDA models query the document and the webpage document in two hierarchical LDA processes, and they assume that the query document is semantically related to the webpage document, which contributes to a slight lead over UCIT and UATM in understanding the user's interest. Although HDLDA produces good results, it performs worse than ALDA. This is due to HDLDA failing to capture the interactive relationship between queries and webpages. In summary, our ALDA model always outperforms the other comparison models on predicting consumers' purchase intentions.

#### *4.3. Evaluation of Recommendation Results*

The proposed Topic-HGNN framework incorporates the topic model into a hypergraph neural network for enhancing user and item embedding representation. Five typical topic model-based recommendation techniques and two state of art neural network-based recommendation methods are selected as baselines.

In order to examine whether the user and the item feature identified by the Topic-HGNN can achieve better personalized recommendations, we utilized precision and diversification to evaluate the recommendation results in detail. The experiment was conducted on the Retailrocket dataset.

#### 4.3.1. Precision of Recommendation Results

We adopt two commonly used metrics, *Precision* and *Recall*, to evaluate the accuracy of recommendation results obtained by each recommender method. Precision and Recall are defined as:

 $Precision = \frac{\sum\_{\mathbf{u} \in \mathcal{U}} |R(\mathbf{u}) \cap T(\mathbf{u})|}{|R(\mathbf{u})|}$
$$Recall = \frac{\sum\_{\mathbf{u} \in \mathcal{U}} |R(\mathbf{u}) \cap T(\mathbf{u})|}{|T(\mathbf{u})|}$$

where *R*(*u*) denotes the recommendation list based on the training dataset, and *T*(*u*) denotes the recommendation list based on the test dataset.

To evaluate the accuracy of recommendation results obtained by each recommender technique, we set the number of recommendations from top10 to top100.

Figure 5 shows the comparison of the accuracy of recommendation results generated by each recommender technique.

**Figure 5.** Comparison of recommendation result accuracy: (**a**) precision of top-k items; (**b**) recall of top-k items.

We can observe that the accuracy of recommendation results generated by topic-based methods CTR, SVD-LDA, CoAWILDA, AR-LDA, and EUU-CF are very close to each other and are significantly worse than Graph-CNN, HyperCTR, and Topic-HGNN. This is because topic-based methods focus on improving recommendations for items with textual content. They infer the user's interest based on the user's purchase behavior, which is difficult to refine user preferences for different product attributes and capture high-order correlations between users and items. Different from topic-based recommendation models, Graph-CNN, HyperCTR, and Topic-HGNN infer the user's preference from rich userproduct interaction information. Although Graph-CNN and HyperCT also produces good accurate recommendations, it performs worse than Topic-HGNN. This is due to the Graph-CNN and HyperCT only focusing on learning user interaction characteristics with products during and after purchase (e.g., purchase and online review) and ignoring the interactive features in the process of users' learning about product information through search queries before they make a purchase (e.g., product information search). However, user association with a product is a coherent process that should not be isolated into different nodes. Our Topic-HGNN integrates a topic model and a hypergraph neural network, which can deal with the interaction behavior of consumers in the whole process of shopping (i.e., searchingunderstanding-purchasing-using). Besides, the Topic-HGNN obtains the convolutional semantic features of users and items, and uses the topic model to obtain the corresponding topic features. The result shows that incorporating the topic information from users and items into a convolutional neural network can effectively represent user preferences and item features, which can significantly improve the accuracy of prediction scores. The result also demonstrates the structural superiority of the searching-scenario oriented hypergraph, which gives the recommender system a chance to identify different semantic facets of the input search phrases.

#### 4.3.2. Novelty of Recommendation Results

Only verifying the accuracy of model recommendation results is not enough to explain the personalized effect of a recommendation model. As the collaborative filtering only depends on the user's past purchase behavior, users can only get recommendations similar to items in their own profile and hardly get diversified options. So, experiments are further designed to verify the ability of the recommendation model to discover novel items to the target user. We adopt the novelty metric [59] to measure the ability of recommendation model to find novel items. The lower the Novelty is, the more novel products are recommended. *Novelty* is defined as:

$$n
neq t \\ y = \frac{1}{mk} \sum\_{u=1}^{m} \sum\_{i \in L\_u} d\_i$$

where *Lu* is the top-*k* list of a user *u*, *m* is the number of users, and *di* is the degree of item *i*, i.e., the number of users that rated the item *i*.

We set the number of recommendation items to 10, and experimented on the Retailrocket datasets 32 times each. A smaller novelty value indicated that the recommendation items were more novel.

Figure 6 shows the comparison of the novelty of recommendation results generated by each recommender technique. We can observe that the novelty of recommendation results generated by CTR, SVD-LDA, CoAWILDA, EUU-CF, and AR-LDA are very close to each other and are significantly worse than Graph-CNN, Hyper-CTR, and Topic-HGNN. This is because CTR, SVD-LDA, CoAWILDA, EUU-CF, and AR-LDA infer the user's interest based on the user's historical purchase behavior, which is difficult to discover new products for consumers. This result demonstrates that the topic-based method is significantly worse than the graph-based method. The Topic-based method regards the interaction between users and products as a matrix, and it focuses on mining linear correlation and low-rank information. However, graph-based methods focus on mining interaction information and high-order relation in the graph. Compared with the matrix, the graph can describe more information, such as the link to describe the connection between adjacent vertices, the overall connection between all vertices in the graph, and the link density to describe the community structure in the graph. The graph has a powerful representation ability and the effect of the graph-based method is significantly better than that of the traditional recommendation algorithm.

Our Topic-HGNN is significantly better than Graph-CNN, Hyper-CTR, which demonstrates that Topic-HGNN can identify different semantic facets of input search phrases. Topic-HGNN can obtain semantic associations among consumers' online queries, their click, purchase, and online review behavior that are better than Graph-CNN, Hyper-CTR. Topic-HGNN simultaneously considers heterogeneous interactions and homogeneous interactions in the user purchasing paths, which can better utilize the deep connection information contained in the interactive graph domain, and it is not limited to the observed links.

**Figure 6.** Comparison of recommendation result novelty.

In summary, our Topic-HGNN could improve the novelty of recommendation items without sacrificing accuracy.

#### 4.3.3. Efficiency of Topic-HGNN

The running time and the memory consumption of each method under different query search volumes on Retailrock dataset is shown in Tables 3 and 4. We set the number of recommendation results as 10. From Table 3, it can be seen that the recommendation framework based on a topic model is significantly better than the recommendation framework based on graph learning in terms of running time. Although the recommendation framework based on a topic model is approximately 15% more efficient than the recommendation framework based on graph learning, the quality of the results identified by the recommendation framework based on graph learning on the accuracy, recall, and novelty indicators improved by 53%, 51%, and 46%. This also demonstrates that the method based on graph learning can significantly improve the quality of recommendation results at the expense of a small amount of operating efficiency. Among the three graph-learning-based methods, the running time of our model is slightly higher since our method models the quaternary higher-order relationship among consumers, queries, items, and features. Thus, Topic-HGNN is significantly superior to that of Hyper-CTR and Graph-CNN, when sacrificing a relatively low efficiency.

**Table 3.** The running time of each method under different query search volumes on Retailrock dataset (the number of recommendation results is 10).

**Table 4.** The memory consumption of each method under different query search volumes on Retailrock dataset (the number of recommendation results is 10).

As can be seen from Table 4, the Topic-HGNN framework does not consume additional memory compared to other graph-based learning methods. This is because the Topic-HGNN is decomposed by hyperedge corruption, importing batches of vertices and hyperedges each time to relieve memory pressure. Therefore, in summary, the Topic-HGNN proposed in this work can produce better recommendation results, while being almost as effective as other graph-based methods.

#### **5. Conclusions**

Personalized product recommendation systems are a useful tool adopted by e-retailers to help consumers find items in line with their preferences. Existing research focuses on learning user interaction characteristics with products during and after purchase (e.g., purchase and online review), while ignoring the interactive features in the process of users' learning about product information through search queries before they make a purchase (e.g., product information search). However, users' association with a product is a coherent process that should not be isolated into different nodes. Only sorting the user's process of searching-understanding-purchasing-using products and finding opportunity points from each stage can help the recommender system to better discover the potential needs of users. To this end, we develop a topic augmented hypergraph neural network framework to predict users' purchase intentions by connecting the latent topics embedded in consumers' online queries to their click, purchase, and online review behavior. First, we adopt a hypergraph to model the multivariate relationship among users, query topics, items, and item features, which aims at mining the connection information existing in

the interaction graph domain. Then, we utilize the hyperedge corruption to generate a user-query hypergraph and an item-feature hypergraph and utilize the hyperedge convolution layer to obtain user embedding and item embedding. Meanwhile, in order to reduce the influence of text noise words by fusing topic information, we specially design an Aggregated Latent Dirichlet Allocation (ALDA) model to jointly extract users' content preference topics from queries and webpages and apply Latent Dirichlet Allocation model to extract product feature topics from online reviews. Then, we integrate the topic distribution and convolutional embedding to represent each user and item, which can make up for the lack of topic information in traditional convolutional neural networks. Finally, we use multilayer perceptron to calculate the soft match score between query entities and item entities. Extensive empirical evaluations on real-world datasets demonstrate that the proposed framework could improve the novelty of recommendation items without sacrificing accuracy. From the managerial perspective, recommending diversified and novel items to consumers may increase the user's satisfaction, which is conducive to the sustainable development of e-commerce enterprises.

With the rapid development of mobile commerce, more and more recommendation services occur in dynamically changing contexts, such as user location, access time, current traffic, and other surrounding environments. Traditional personalized recommendation technology is no longer enough to deal with the new impact caused by contextual factors. Therefore, our future work will focus on integrating and applying contextual information into the hypergraph framework, which aims at combining context development diagram and user behavior prediction to form a unified and concise context-based recommendation model. In this work, we assumed that search query documents and webpage documents follow the same topic distributions. In reality, search query documents and webpage documents sometimes didn't follow the same topic distributions. Thus, examining the impact in the results when search query documents and webpage documents did not follow the same topic distribution is also a future research topic.

**Author Contributions:** Conceptualization, X.H. and X.L.; methodology, X.H.; software, X.H.; validation, X.L.; formal analysis, X.L.; investigation, X.H. and X.L.; resources, X.H.; data curation, X.H.; writing—original draft preparation, X.H.; writing—review and editing, X.L.; visualization, X.H.; supervision, X.L.; project administration, X.L.; funding acquisition, X.H. and X.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work is supported by the Fundamental Research Funds for the Central Universities under Grant No. 310422121.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** The data used in this work can be found at http://www.gregsadetsky. com/\_aol-data and https://www.kaggle.com/retailrocket/ecommerce-dataset accessed on 18 September 2019.

**Acknowledgments:** We would like to thank the editors and the anonymous reviewers for their insightful suggestions.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

**Sha Sun 1, Haiyue Xu 2, Minsong He 3, Yao Xiao 1 and Huayong Niu 1,\***

**Abstract:** Analyzing, evaluating, and predicting the trend of globalization are highly valuable endeavors. However, existing literature lacks a quantifiable metric for objective evaluation. To fill the gap, we first compiled a Globalization Index based on existing globalization indices and using the CRITIC weighting method. Second, we constructed the Globalization Barometer and a trend term for trend analysis using the HP filtering method. Third, we conducted time-series predictions for globalization trajectory by applying the Random Forest model. Our results indicate that: (1) The *de facto* and *de jure* globalization both displayed a gradually upward trend over time; (2) the 2008 financial crisis and the 2020 COVID-19 pandemic negatively impacted globalization and served as turning points; (3) on a positive note, COVID-19 has narrowed the gap in both *de facto* and *de jure* globalization. This is due to the fact that the shocks were uneven, with economies that participated more in globalization weathering the brunt of the impact, while economies that participated less experiencing little changes; (4) the *de facto* and *de jure* globalization are predicted to remain on an upward trend for the subsequent 5 years. This research provides essential references for assessing and predicting globalization trends.

**Keywords:** globalization; COVID-19 pandemic; globalization barometer; trend analysis; trend forecasting

#### **1. Introduction**

Globalization is an impactful force for countries and regions all over the world. The trend of globalization influences multiple stakeholders, not least of which include actors in the economic, social, and even political fields. Most stakeholders need to base and readjust their strategies on how globalization will proceed.

Despite its importance, there is no consensus on assessing the trend of globalization in the existing literature. Some scholars believe that globalization is irreversible and it will continue to move forward. They argue that the globalization variables are more resilient than most people expected [1]. The increasing mobility of people, information, and technology worldwide has reduced the possibility of deglobalization [2]. Among them, positive globalization trends are especially reflected in increasing global exchanges of services and data [3]. Moreover, based on the fact that the world remains highly collaborative during the coronavirus outbreak, globalization will not end as a result of the pandemic [4]. Some foresee a slowdown in globalization in the near and long-term future, characterized by the concept of "slowbalization" [5]. These ideas predate the COVID-19 outbreak, such as the likely deceleration of globalization suggested by Bordo [6]. However, slowbalization is not a uniform trend. It includes a recession in economic globalization and a boom in information globalization [7]. Others hold the view that globalization is suffering a downturn. The current deglobalization is partially triggered by the pandemic exposing the underlying fragility in globalization [8,9]. This crisis has spurred the pre-pandemic

**Citation:** Sun, S.; Xu, H.; He, M.; Xiao, Y.; Niu, H. An Alternative Globalization Barometer for Investigating the Trend of Globalization. *Appl. Sci.* **2022**, *12*, 7896. https://doi.org/10.3390/ app12157896

Academic Editor: Jianbo Gao

Received: 6 July 2022 Accepted: 4 August 2022 Published: 6 August 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

globalization skeptics [10], with economic and social factors further accelerating this skepticism worldwide [11]. Scholars conclude that, due to various anti-globalization factors, including inter-country inequalities, populism, protectionism, and unilateralism, a greater globalization process is difficult to achieve in the current world economy [12]. Populism, in particular, is heavily impactful. It threatens not only economic but also social and political globalization [13,14]. This rise of populism is fueled by the backlash against neoliberal constitutionalism [15]. Some scholars have refrained from defining a fixed standpoint, as it remains uncertain whether the crisis triggered by the COVID-19 pandemic marks the end of globalization [16]. However, they have pointed out crucial factors that may influence future trends. Digitalization, for instance, projects both centrifugal and centripetal forces on globalization [17], while the pandemic has transformative effects that paint a new image of a post-Covid era global market [18]. While recent studies have made important progress in evaluating and projecting how connections in the world will develop moving forward, they are mainly qualitative studies and therefore by nature, are prone to subjective judgements.

Another related strand of literature is the study of globalization indices. Traditionally, sociologists, economists, and others worked on different dimensions of globalization [19]. However, globalization by definition is a multifaceted concept that includes economic, social, and political aspects [20]. Therefore, to measure globalization in a more comprehensive way, most of the existing globalization indices have adopted an interdisciplinary approach, i.e., a composite index of globalization. The A.T. Kearney/Foreign Policy Globalization Index [21] was the first systematic measure of globalization, which measured and ranked 62 countries worldwide on four dimensions: Economic integration, personal contact, technological connectivity, and political engagement. Noteworthy indices include: The KOF Globalization Index [22] uses 43 indicators in the economic, social, and political dimensions and covers data pooled from 203 economies between 1970 and 2018. The CSGR Globalization Index [23] applies 16 indicators along the economic, social, and political dimensions, covering data from 119 countries and regions from 1982 to 2004. The Maastricht Globalization Index [24] measures the level of globalization in 117 countries in 2002, 2008, and 2012 presenting five dimensions: Political, economic, social and cultural, technological, and environmental. The DHL Global Connectedness Index [1] measures the depth and breadth of global connectivity of 140 economies between 2005 and 2020, using 12 indicators along four dimensions: Trade, capital, information, and people. The prior research showed its merits in providing the basic quantitative framework and methodology for constructing a globalization index. However, their scope is rather limited to presenting globalization in the past and present rather than trend analysis and forecasting.

In this case, an approach which quantifies the trend of globalization will be useful to provide forward-looking analyses, especially given that it is the changes of globalization than globalization per se that fulfills the greatest need. Current literature in economics and other fields used barometers to assess the trend of specific variables [25,26]. A barometer is a composite indicator designed for assessing the trend of growth and discovering turning points [25,26]. This implies that the construction of a barometer would serve as a suitable way to quantify globalization trends, which is rarely covered in the existing literature. The barometer can deliver fact-based, future-oriented solutions for industrial activities, provide theoretical instruments for academic purposes, and serve as a window for the public to monitor the current state of global interconnectedness.

In this paper, we constructed the Globalization Barometer and provided a trend analysis of globalization. Our research pooled data from 142 economies from 2000 to 2020, spanning economic, social, and political dimensions. The CRITIC method was used to assign indicator weights. The HP filter was used to implement the trend analysis. Finally, the Random Forest model was used to conduct time-series predictions for globalization trajectory.

The rest of the article is organized as follows. Section 2 illustrates the data and methods. Section 3 presents the results. Sections 4 and 5 are intended for discussion and conclusion.

#### **2. Materials and Methods**

#### *2.1. Methodology Procedures*

As presented in Figure 1, the assessment and prediction of globalization trend involve three steps:

#### **Figure 1.** Methodology procedures.

#### *2.2. Compilation Framework of the Globalization Index*

A clear and universally recognized definition of globalization is necessary for compiling a globalization index. Based on emblematic articles in the field of globalization, including Sklair [27,28], Stoudmann and Al-Rodhan [29], and Scholte [30], globalization is defined as the global increase in connection, interdependence, and convergence of all economies in the economic, social, and political fields. In this work, we define globalization in three sub-dimensions: Economic globalization is reflected in the cross-border flows of products and services and the allocation of production factors on a global scale. Social globalization covers the migration of people and the transmission of information, accompanied by the convergence of cultures and exchanges in science and technology. Political globalization denotes intergovernmental cooperation and collaboration within the framework of international organizations.

Existing globalization indices have provided an adequate structure to quantify the level of globalization. Following Gygli et al. [22], we introduce two dimensions, namely, *de facto* and *de jure* globalization. *De facto* globalization refers to the extent to which a country's participation in globalization has been achieved, while *de jure* globalization is defined as the decisions, policies, institutions, and other proactive factors that the country has put in place to make its participation in globalization more possible.

Based on prior indices, our index also made several adjustments and improvements as described below.

(1) We measured political globalization more broadly. As an expansion of existing indices [22–24], the political dimension is determined by two sub-dimensions: International cooperation and global governance. International cooperation measures the degree of intergovernmental coordination and communication, while global gov-

ernance evaluates the participation level of each government in the framework of international organizations. Of note, this paper differs from existing indices in the identification of international organizations. Existing indices mostly use all intergovernmental organizations (IGOs) and non-governmental organizations (NGOs). This approach assumes that all IGOs and NGOs contribute equally to the process of globalization, neglecting the individual difference in capacity. In our context, the international organization mainly refers to the UN and its affiliated institutions, since we propose that UN plays a crucial role in the formation of modern globalization and thus should lay emphasis on its work.

(2) We measured social globalization more impartially. Indicators, such as McDonald's restaurants and IKEA stores, have long been criticized for measuring Americanization or Westernization rather than cultural globalization, as pointed out in the founding paper of the KOF index [22]. Accordingly, we removed these indicators and used trade in printed goods and international trademarks instead to evaluate *de facto* cultural globalization.

Another adjustment reflects in the inclusion of decentralized indicators. Some new indicators, such as the language popularity index, are added to our index system. Rather than measuring the average proficiency of English in a given country, the language popularity index measures the number of foreign nationals speaking the majority language of that country (the most spoken language among all official languages of that country) as a percentage of those speaking that language worldwide. Language functions as the medium of culture [31], opens more possibilities for cultural transmission and exchange, and thus could be included in cultural globalization. Additionally, the social tolerance index, which refers to the extent of recognition and acceptance of differences, and willingness to grant equal rights [32], was included to address the importance of mutual respect and appreciation of different cultures.

(3) In addition to the adjustments in the indicators, there are some amendments to the measurements. Previous studies have shown that absolute indicators are prone to the impact of scale [22]. Therefore, the indicators chosen in this paper are mostly relative indicators. This method ensures all components are statistically comparable.

In conclusion, this paper constructed a *de facto* and *de jure* globalization index system consisting of three primary, eight secondary, and twenty-eight tertiary indicators as demonstrated in Table 1. See Table A1 in Appendix A for measurement of all indicators.

**Table 1.** The globalization index: Variables description.

**Table 1.** *Cont.*

\* Indicators manually collected and calibrated from accessible databases.

#### *2.3. Data*

#### 2.3.1. Data Collection and Sample Selection

In this work, we covered diverse data from the economic, social, and political fields. Our primary sources of data are obtained from databases of the UN, the World Bank, and the IMF. In addition, our work collected data from trustworthy sources, such as the CIA, the World Value Survey, and Ethnologue. In total, all 19 different databases were consulted (Table 1).

The raw dataset covers 217 economies with 28 variables (indicators) over the timespan (year 2000 to 2020). However, it suffers from a severe missing observation problem, which calls for sample selection. We decide whether to retain a sample following two principles: (1) Data coverage ratio should be improved; (2) the structure of the sample should be in proportion to the raw dataset from a geographic and economic perspective. With careful consideration, we narrowed our sample to 142 economies. See Table A2 in Appendix A for the structure of the sample compared with the raw dataset.

#### 2.3.2. Data Processing

Data processing involves imputation of missing data and data normalization. Following the practice of existing globalization indices [22–24], we imputed the missing data within a series using linear interpolation and extrapolation. In addition, the values of the indicators themselves are not comparable due to differences in the scale and units of the indicators. Therefore, we normalized the data using the max-min method.

#### *2.4. Methods*

#### 2.4.1. The CRITIC Method

Two major weighting systems are used in related studies: The objective and subjective weighting methods [33]. The former is dataset-driven, while the latter is expert-driven. In order to eliminate subjective biases, our work employs the CRITIC method to aggregate our indicators. This method is based on evaluating the comparative strength between indicators and the deviation of indicators to determine the weights of indicators.

Consider a normalized dataset represented by matrix *M*:

$$\mathcal{M} = \begin{bmatrix} \mathbb{x}\_{11} & \mathbb{x}\_{12} & \cdots & \mathbb{x}\_{1n} \\ \mathbb{x}\_{21} & \mathbb{x}\_{22} & \cdots & \mathbb{x}\_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ \mathbb{x}\_{m1} & \mathbb{x}\_{m2} & \cdots & \mathbb{x}\_{mn} \end{bmatrix} \tag{1}$$

where *m* denotes the number of observations, and *n* denotes the number of indicators under the same category.

While determining the weights of a specific indicator, both standard deviation and its correlation between indicators are considered. In this regard, the weights are obtained as follows:

$$w\_{\dot{j}} = \frac{\mathbb{C}\_{\dot{j}}}{\sum\_{j=1}^{n} \mathbb{C}\_{\dot{j}}} \tag{2}$$

where *Cj* denotes the quantity of information *j*-th indicator contains, which is determined as:

$$\mathcal{C}\_{\vec{j}} = \sigma\_{\vec{j}} \cdot \sum\_{k=1}^{n} \left( 1 - r\_{k\vec{j}} \right) \tag{3}$$

where *σj* represents the standard deviation, and *rkj* represents the correlation coefficient between indicator *k* and *j*.

#### 2.4.2. HP Filter

Inspired by the Global Trade Barometer issued by World Trade Organization (WTO) [28], our work uses the Hodrick-Prescott (HP) filter method to formulate the Globalization Barometer. The HP filter, first proposed by Hodrick and Prescott [34], is a commonly used data-smoothing tool in macroeconomics. We use the HP filter method to decompose a series into trend and cyclical components. The original series can be represented as the following function:

$$y\_t = \pi\_t + c\_t \tag{4}$$

where *yt* is the original series, *τt* is the trend component for the long-term path, and *ct* is the cyclical component which denotes short-run dynamics. The deviation is the actual level of output from the long-term trend. Therefore, the HP filter is defined as the following optimization function:

$$\min\_{\{\pi\_t\}} \left\{ \sum\_{T=1}^{T} \left( y\_t - \pi\_t \right)^2 + \lambda \sum\_{t=2}^{T-1} \left[ \left( \pi\_{t+1} - \pi\_t \right) - \left( \pi\_t - \pi\_{t-1} \right) \right]^2 \right\} \tag{5}$$

where the first term is interpreted as the sum of the squared differences between actual globalization and trend, and the second term is a second-order difference equation that exists for the trend multiplied by the smoothing parameter *λ*. This parameter will determine the amount of volatility associated with a trend, namely, the higher *λ* that is used, the smaller the volatility will be. Following Backus and Kehoe [35], the value of the smoothing parameter *λ* is assigned to a value of 100 for annual data in this paper.

#### 2.4.3. Random Forest Model

Machine learning is the learning process of analyzing data automatically to obtain a model from the data and using the model to make predictions about unknown data. Random Forest is an integrated algorithm that reduces the variance of a model by combining multiple decision trees, correcting the habit of a single decision tree to over-fit its training set. Among various machine learning algorithms, Random Forest generally has

better generalization performance [36]. It is resilient to outliers in the dataset and does not require considerable parameter-tuning. In 2001, Breiman [37,38] improved the Random Forest model, which not only simplified the computational effort and improved accuracy, but also better predicted small sample sizes and unbalanced datasets.

In this work, 5-fold cross-validation and "out-of-bag" (OOB) method are used to evaluate the model performance. K-fold cross-validation is a resampling procedure for evaluating machine learning models on the limited sample [39]. We validate our results by randomly partitioning data into k mutually exclusive subsets. One set is used for validation, the other k-1 sets are used for training. The validation process is repeated for k times. K is usually chosen to be 5 or 10, but there is no formal rule. We choose k = 5 in this paper. The OOB method is another evaluation method, in which OOB observations are used to create training samples [40].

#### **3. Results**

#### *3.1. Globalization Barometers and Trend Terms on World Average*

Drawing on the idea of the Global Trade Barometer of WTO [28], this paper compiles the Globalization Barometer with *de facto* and *de jure* dimensions. The steps are as follows: First, the HP filter is applied to the Globalization Index measured in Section 2, and the trend term is extracted; next, the index value is subtracted from the trend term to obtain the deviation term; finally, the deviation term is normalized and added by 100, and compared against the barometer standard interval. The standard barometer interval is set by taking 100 as the baseline, and the intervals (99, 101), (101, +∞), and (−∞, 99) are defined as "in trend" (yellow), "above trend" (green), and "below trend" (red), respectively.

Figure 2 shows the *de facto* and *de jure* Globalization Barometer, as well as the trend components. In terms of *de facto* globalization, the trend term is generally upward. During the past two decades, two global events, i.e., the 2008 financial crisis and the COVID-19 outbreak in 2020, influenced its progress, as shown by the grey areas. The financial crisis in 2008 caused a significant dip in *de facto* globalization. The *de facto* Globalization Barometer soared to 101.58 on the eve of the 2008 crisis, and then fell to the bottom of 98.84 when the crisis started to spread, turning from "above trend" to "below trend". Since then, *de facto* globalization resumed its positive development until the pandemic hit the world in 2020, when *de facto* globalization suffered an even greater fluctuation. As shown in Figure 2b, a significant "above trend" could be observed in 2019, before a sharp drop to "below trend" in 2020, when the pandemic began to exert its negative influence on the world economy as well as other aspects of human lives. Moreover, the pandemic even caused the trend component to decrease. This is partly a reflection of the fragility and relative instability of globalization, where global events at the economic, social or political level could destabilize the level of *de facto* globalization. Overall, however, a positive trend is evident in *de facto* globalization.

The *de jure* globalization shows a relatively flat upward trend in general, which is also impacted by the 2008 crisis and the 2020 pandemic. The 2008 crisis had a lagging effect on the *de jure* globalization. Since 2010, there has been a general slowdown in the growth of *de jure* globalization, even if it remained positive until 2020. The *de jure* Globalization Barometer fell from 101.86 (above trend) in 2008 to 98.71 (below trend) in 2011. From 2018 onwards, *de jure* globalization remained at the previous level until 2020 when *de jure* globalization dipped following the outbreak of the COVID-19 pandemic. The trend component eventually fell, and the barometer dropped to 98.41 (below trend). The above results further illustrate the continuing negative impact of the crisis on *de jure* globalization.

**Figure 2.** Barometers and trend terms of *de facto* and *de jure* globalization. (**a**) *De facto* globalization trend term. (**b**) *De facto* globalization barometer. (**c**) *De jure* globalization trend term. (**d**) *De jure* globalization barometer.

Figure 3 shows the *de facto* and *de jure* Globalization Barometer for 2020. In 2020, the *de facto* Globalization Barometer of 97.86 was "below trend". The *de jure* Globalization Barometer was 98.41, also "below trend". The results show that the pandemic in 2020 has challenged the development of globalization in the world and has dealt a huge blow to the globalization process.

**Figure 3.** Globalization barometer. (**a**) *De facto* globalization barometer. (**b**) *De jure* globalization barometer.

#### *3.2. Spatial Variations*

For further analysis, we have systematically analyzed the level of *de facto* and *de jure* globalization and barometers for all sample economies. The spatial variations of *de facto* and *de jure* globalization and their barometers in 2020 are illustrated in Figure 4. We observe that the variations of *de facto* and *de jure* globalization are characterized by regional spatial agglomeration.

**Figure 4.** *Cont.*

**Figure 4.** Spatial variation of the globalization index and globalization barometer in 2020. (**a**) Spatial variations of *de facto* globalization. (**b**) Spatial variations of *de facto* globalization barometer. (**c**) Spatial variations of *de jure* globalization. (**d**) Spatial variations of *de jure* globalization barometer.

For *de facto* globalization and its barometer in 2020, we can observe the following, as illustrated in Figure 4a,b:

Second, let us focus on the *de jure* globalization and its barometer in 2020. From Figure 4c,d, we can observe:

United States, scoring 97.86, 97.77, and 97.55 in 2020, respectively. Compared with *de facto* globalization, *de jure* globalization was more stable.

#### *3.3. Driving Forces*

Figure 5 presents the three-dimensional forces, i.e., economic, social, and political factors, of the *de facto* and *de jure* Globalization Barometer for 2020.

**Figure 5.** Three-dimensional forces of globalization barometer. (**a**) Three-dimensional forces of *de facto* globalization barometer. (**b**) Three-dimensional forces of *de jure* globalization barometer.

#### 3.3.1. Driving Forces of de Facto Globalization Barometer

In 2020, the *de facto* economic Globalization Barometer was in trend (99.26). The *de facto* social Globalization Barometer was also in trend (100.86), while the *de facto* political Globalization Barometer was below trend (97.44).

First, the *de facto* economic globalization displayed remarkable buoyancy in the face of the significant shocks caused by the COVID-19 outbreak. In response to the virus, economies around the world implemented lockdowns and restrictions, generally disrupting international trade. However, after a brief negative depression, global trade quickly turned positive in the second half of 2020, as suggested by the DHL connectedness index. Mirroring this trend was the global financial markets, which responded negatively with increased

uncertainty and systematic risks during the pandemic, likely exacerbated by the loss of confidence from investors and other actors responding to more pessimistic forecasts. Yet, a general recovery in the global trade was thought to have contained the panic in the global financial markets, contributing to more stability and positive prospects regarding international capital flows.

Second, *de facto* social globalization is characterized by structural differences. Restrictions on international travel greatly disrupted cross-border human exchange, leading to a fall in interpersonal globalization. The main means of international transportation, air transport services, including the airline industry, suffered a great blow. However, it is also worth mentioning that informational globalization boomed during the pandemic, to some extent mitigating social impacts. Limitations on public gatherings and activities led to a significant increase in online activities and far more frequent internet use compared with pre-pandemic times, which fostered thriving online communities. The exchanges of information became considerably more efficient thanks to the internet, and informational globalization acted as a major counter-weight against the negative impact of interpersonal globalization. Therefore, *de facto* social globalization maintained a mildly steady trend in 2020.

Third, as for political globalization, both international cooperation and governance displayed a downward trend in the post-pandemic period. A relatively lower speech contribution in UN conferences, which brings more uncertainty to political globalization, may provide one of the reasonable explanations for the trend.

Overall, there are well-grounded reasons to expect the optimistic development of economic and social globalization in the short-term, whereas more attention needs to be paid to the dynamics of *de facto* political globalization.

#### 3.3.2. Driving Forces of de Jure Globalization

In 2020, the *de jure* economic Globalization Barometer is falling at 97.85, far below trend; the *de jure* social Globalization Barometer is 98.1, also "below trend"; the *de jure* political Globalization Barometer is 99.93, in trend.

First, before the pandemic, populism and protectionism actions by several economies have stirred up hostile emotions in international trade. These emotions were exacerbated by the 2020 global health crisis and its concomitant economic fallout, as economies trying to establish new trade agreements diverted strategies to cope with the ongoing pandemic. Consequently, fewer trade agreements have been signed since the onset of the pandemic. According to the United Nations Treaty Collection, 356 trade agreements were signed in 2020, six less than in 2019; 437 trade agreements entered into force in 2020, 51 less than in 2019.

Second, when considering *de jure* social globalization, the clear inconvenience caused by restrictive measures discouraged international human exchange, especially cross-border travel. The construction of new airports also slowed down due to a decrease in international traffic demand, following a decrease in visas issued due to stricter border controls and other relevant COVID-19 countermeasures. An inactive trend in interpersonal infrastructure was one of the major factors that explained the falling trend of *de jure* social globalization.

Third, from the perspective of *de jure* political globalization, international organizations, especially World Health Organization, have been working around the clock to mitigate the global impact of the pandemic with programs, such as the COVAX initiative for worldwide vaccine distribution. Furthermore, relaxed restrictions related to the pandemic lead to a recovery of some UN peacekeeping missions around the world, leading to higher participation in peacekeeping missions and indicating that political globalization is regaining its strengths.

#### *3.4. Forecasting Globalization Trends*

Following Petukhova et al. [41], we use the Random Forest model to predict the time-series data. The *de facto* and *de jure* globalization, as well as the economic, social, and political dimensions, for the subsequent 5 years after 2020 are predicted and analyzed in this section.

In this paper, eight Random Forest models were built based on eight dimensions, i.e., the *de facto* and *de jure* globalization and the three subdimensions of each. For example, the dependent variable is the *de facto* globalization for each economy in period t, and the independent variables would be set to be the *de facto* globalization for each economy in period t-*n* to t-1. To expand the sample size, we chose *n* = 10. Since our sample spans from year 2000 to 2020, period t would be from year 2010 to 2020. In this way, we use data of each dimension as dependent variables, and the independent variables are set as the previous 10-year data for the corresponding dimension.

We used 5-fold cross-validation to find the set of parameters with the best prediction results and chose parameters with the number of subtrees of 100, a minimum number of samples required for internal node subdivision of 2, a minimum number of samples for leaf nodes of 1, and the maximum number of features used for a single decision tree is √N (N is the total number of features). The performance of the model was evaluated by the coefficient of determination (R2), root mean squared error (RMSE), and mean absolute error (MAE) via 5-fold cross-validation (CV) and the "out-of-bag" (OOB) method. The R2 are all above 84%, the RMSE and MAE are small for all eight models. The model is generalized well, with no overfitting occurring. The detailed model evaluation results are shown in Table 2.

**Table 2.** Model evaluation results.

After training the model, we used the 10-year data from 2011 to 2020 to forecast the result of 2021. Then, with the predicted data of 2021 as one of the features, we used the data from 2012 to 2021 to forecast the result in 2022, followed by four more periods of prediction from 2022 to 2025 using the same method.

#### Model Results

Figure 6 shows prediction results for globalization trajectory using the Random Forest model. Both *de facto* and *de jure* globalization are projected to exhibit a steady upward trend in the next five periods after 2020.

The projected *de facto* globalization for 2021 to 2025 is as follows: A significant rebound is expected for 2021, describing a "V" curve. After the rebound, *de facto* globalization is highly likely to follow a steady upward trajectory for the remainder of the 5 years; *de facto* economic globalization in the same 5-year period would experience a large-scale rebound; *de facto* social globalization would decrease in 2021, followed by a steady, gradual recovery; while *de facto* political globalization has the potential to experience a large-scale rebound in 2021, followed by a steadily increasing trend.

The *de jure* globalization trend in general may remain relatively stable. For the next 5 years, *de jure* globalization is projected to maintain steady yet slow levels of upward momentum. *De jure* economic globalization keeps pace with overall globalization, i.e., a rebound to form a "V" curve, tapering into a slow increase; *de jure* social globalization

maintains a slowly upward pace for this period; while *de jure* political globalization is expected to maintain its previous level for 2021, and increases after 2022.

**Figure 6.** Forecasting of the globalization trends.

#### **4. Discussion**

The globalization trend impacts the economic, social, and political development of all countries around the world, making it a highly relevant topic of discussion. Current literature is limited to qualitative judgements or point-quantifications, leaving the broader stroke issue of trend largely untouched. In order to fill the gap, we developed the Globalization Barometer to evaluate the trend of globalization in more depth.

We constructed a Globalization Index based on existing indices and used the HP filter method to decompose the trend and deviation terms, of which the latter is used to construct the Globalization Barometer. Our results indicate that since 2000, *de facto* and *de jure* globalization generally maintained an upward trajectory. The 2008 financial crisis and the 2020 COVID-19 pandemic have negatively impacted globalization trends, serving as turning points on the curve. From a world average perspective, *de facto* globalization saw a significant setback post the 2008 financial crisis, followed by a rapid rebound until the pandemic in 2020. *De jure* globalization generally maintained steady growth but also experienced the shocks of the two crises, including the 2008 slowdown in growth and the dip in trend in 2020. Our results are intuitive and support previous observations [5,7].

Although the 2020 pandemic has exerted a negative impact on globalization, it is well-worth noting the unexpected positive effect of reducing the gap in *de facto* and *de jure* globalization. Further analysis revealed an uneven distribution of globalization across the world. We find that economies in North America, Northeast Asia, and Europe feature high *de facto* globalization; on the other hand, economies with high *de jure* globalization are generally concentrated in Western Europe, Northern Europe, and North America. However, the spatial variation of globalization barometer shows that the impact of the pandemic is not evenly felt around the world. Economies with higher scores in *de facto* and *de jure* globalization experience greater shocks, while economies with lower scores remain relatively untouched. Our results complement current literature on globalization trends and the pandemic's impacts and threats [8,9] while also adding to the current debate the argument that the impact of globalization mainly was felt in a few economies and regions and may help form a more balanced post-COVID global paradigm.

By deconstructing the driving forces of globalization, our research shows uneven levels of globalization across the economic, social, and political dimensions. *De facto* globalization grew below trend with economic and social globalization on trend, and political globalization below trend. *De jure* globalization turned out to be below trend as well for this year, due mainly to economic and social globalization's downturn compared with political globalization. Our results indicate that albeit the fact that the current development of globalization in general failed to meet our expectations, there are still positive dimensions in globalization, and may serve as the future driving forces of stable and positive development.

Finally, we have also used the Random Forest model to conduct time-series predictions for the years between 2021 and 2025. For the subsequent 5 years, *de facto* and *de jure* globalization will likely maintain an upward trajectory, thereby providing quantitative, machine learning-backed response to current qualitative research on future globalization trends.

#### **5. Conclusions**

In summary, our research has confirmed and complemented existing studies on globalization trends in the following two aspects. Approach-wise, our research adopted appropriate methods to quantify globalization trends. Although these methods, including the HP filter and Random Forest, are not novel in the scientific community, we are one of the early adopters of these methods in the research of globalization. Conclusion-wise, our research can adequately respond to the theoretical debates on the direction of postpandemic globalization trend within the greater sphere of sociology and international relations. For instance, Contractor [2] believes the pandemic has a short-term impact from which the world will recover soon, while Ciravegna and Michailova [12] believe that the pandemic "will have significant long-lasting effects on globalization." Additionally, even fewer researchers conduct detailed and in-depth discussions on the globalization trend due to the lack of quantifiable metrics. Our paper fills in the theoretical gap and comes to an unexpectedly interesting conclusion that the pandemic has decreased the uneven distribution of globalization.

Other than academic research, globalization quantification can be used by business analysis, mass and specialized media, and public policy. Stakeholders can make informed predictions and decisions on globalization trends using the Globalization Barometer. Companies can adjust how they deploy their regional investment strategy and transnational operations. Media can use the barometer to provide their audience with a more neutral

and accurate image of globalization. In addition, policymakers can reference this research to set foreign policy and international relations decisions.

Considering the complicated nature of globalization development, quantifiable trend analysis will continue to pose a challenge for academia. Our paper is an exploratory attempt at quantifying globalization and is far from perfect. For the future, we will focus on: (1) The barometer's application and validation using more variables and time-series; (2) more detailed study on national or regional globalization trends that were excluded in this paper due to space constraints; and (3) a more in-depth study on the driving factors of globalization to better aid globalization development trend analysis.

**Author Contributions:** Conceptualization, S.S. and H.N.; methodology, S.S., H.X. and H.N.; software, H.X. and Y.X.; validation, S.S., H.X. and Y.X.; formal analysis, S.S.; investigation, S.S. and H.X.; resources, S.S. and H.X.; data curation, S.S. and H.X.; writing—original draft preparation, S.S., M.H., H.X. and Y.X.; writing—review and editing, S.S., M.H., H.X., Y.X. and H.N.; visualization, H.X. and Y.X.; supervision, S.S. and H.N.; project administration, S.S. and H.N.; funding acquisition, S.S. and H.N. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by Beijing Foreign Studies University First-class Discipline Development Research Project under Grant No. YY19ZZB012, by Beijing Foreign Studies University's "COVID-19 Epidemic" First-class Special Research Project under Grant No. SYL2020ZX015, by Incoming Junior Faculty Research Program under Grant No. 2018QD013 and by Beijing Foreign Studies University First-Class Major Signature Research Project under Grant No. 2022SYLZD001.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Data available in a publicly accessible repository.

**Acknowledgments:** The authors thank the editors and anonymous reviewers for their insightful suggestions.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A**

**Table A1.** Measurements of all indicators in the globalization index.

**Table A1.** *Cont.*

**Table A2.** The structure of the original and selected dataset.

\* Venezuela, RB was not assigned to any income group when data were collected.

#### **References**

## *Article* **Normality in the Distribution of Revealed Comparative Advantage Index for International Trade and Economic Complexity**

**Bin Liu 1 and Jianbo Gao 2,3,\***

**Abstract:** The Revealed Comparative Advantage (RCA) index is an important metric for evaluating competitiveness of a country in exporting certain commodity. While it is desirable to have a normally distributed RCA index, the opposite is often found in empirical studies, and efforts for developing alternative indices of the RCA index have not been very successful. This motivates us to ask a more fundamental question: what is the significance of a normally distributed RCA index? To answer this question, we have defined a quantity called the Deviation from Gaussianity (DfG) based on the KS test, which quantifies the deviation of the distribution of a country's RCA index from normality. By systematically analyzing the distribution characteristics of RCA index for each country from 1991 to 2019, we find that DfG is strongly negatively correlated with the logarithm of GDP and the Economic Complexity Index (ECI). In particular, correlation between DfG and GDP is stronger than that between ECI and GDP since 2008. These results suggest that DfG may serve as a new excellent index to quantify the economic complexity and economic performance of a country.

**Keywords:** RCA index; economic complexity; Gaussian distribution; economic development

#### **1. Introduction**

The revealed comparative advantage (RCA) index, also called Balassa index as it was first proposed by Balassa in 1965 [1], is an important metric for quantifying the relative strength of a country in producing a product vis-à-vis its trading partners. While it has been widely used in empirical studies, the RCA index has also been further studied theoretically. Those works mainly focus on the statistical features of the RCA index, and can be roughly classified into two groups. One group is somewhat traditional, with emphasis on clarifying the statistical characteristics of the RCA index across sectors or countries. In many applications, it is desirable to have a normally distributed RCA index, so that it can reliably measure a country's revealed comparative advantage [2]. However, in the majority of empirical studies, a non-Gaussian distribution of the RCA index has been observed. The non-Gaussianity has made the RCA index to suffer from many disturbing properties such as unstable distribution and poor ordinal ranking property [3], the unstable mean [4,5], asymmetric distributional shape [2], and skewness and variable upper bound [6,7]. These features of the RCA index have made its interpretation difficult [3,4,8–10], and thus have motivated a lot of researchers to develop alternative indices of the RCA index so that the new indices can be more normally distributed [3–5,11–15]. These efforts are not very successful, however. To understand why the RCA index and its alternatives may not follow Gaussian distributions, Liu and Gao systematically analyzed the distribution characteristics of the RCA index cross sectors and countries [16]. They find that the RCA index in the majority of the situations cannot be normally distributed, since it is the ratio of two distributions, one following an exponentially truncated Zipf–Mandelbrot's law, the

**Citation:** Liu, B.; Gao, J. Normality in the Distribution of Revealed Comparative Advantage Index for International Trade and Economic Complexity. *Appl. Sci.* **2022**, *12*, 1125. https://doi.org/10.3390/ app12031125

Academic Editor: Elisa Quintarelli

Received: 7 December 2021 Accepted: 20 January 2022 Published: 21 January 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

other being a permutation of the truncated Zipf–Mandelbrot's law [16]. Only occasionally can a normally distributed RCA index be observed—it may emerge with about 1% chance. The significance of a normally distributed RCA index has not yet been explained, however.

The other group of the work on the theoretical aspects of the RCA index mainly employs matrix and complex network theory by constructing the country–product bipartite network, where countries are connected to the products they export. The bipartite network is an 0–1 adjacency matrix constructed according to the value of the RCA index (the element is 1 if the corresponding RCA ≥ 1 and 0 otherwise). By developing the Method of Reflections to interpret an export bipartite network, Hidalgo and Hausmann proposed the Economic Complexity Index (ECI) and Product Complexity Index (PCI) [17,18]. Hidalgo and Hausmann's approach has been proven to be equivalent to a spectral clustering algorithm that partitions a similarity graph into two parts [19]. Although, the ECI may offer a good description of global macroeconomic relations, technological trends, and growth dynamics [20], and could be used to measure the gap in the economic development between countries [21], the approach suffers from a number of conceptual and practical problems [22–26]. To overcome these problems, the Fitness Index (FI) and some other variants of the ECI have been developed [22–24,27,28]. The ECI and its variants have been widely used to study the impact of economic structures on economic development [18,20,29–42]. Fundamentally speaking, however, the FI and the other new variants of the ECI are not very different from the ECI, since the ECI and FI (or log FI) are strongly positively correlated [37–41], and both metrics have almost the same skill in predicting economic growth [42]. This raises an important question as to which of the neglected aspects of the RCA index by the network based approach should be reinstated so that characterization of economic complexity can be fundamentally improved.

In this article, we attempt to answer both the above questions: why a normally distributed RCA index is important and how to better quantify economic complexity. In doing so, we will find a bridge connecting the two groups, one more traditional, the other based on the network approach. Concretely, we will define a quantify called the Deviation from Gaussianity (DfG) based on the KS test, which measures the deviation of the distribution of a country's RCA index from normality. Then, we will systematically analyze the distribution characteristics of RCA index for each country from 1991 to 2019, and examine the relationship between the DfG and economic development and economic complexity.

The remainder of the paper is organized as follows: Section 2 describes Materials and methods, Section 3 presents the main results, and Section 4 contains conclusion and discussion.

#### **2. Materials and Methods**

#### *2.1. Materials*

In this work, we analyze international commodity trade data with products disaggregated according to the COMTRADE Harmonized System at the four-digital level (abbreviated as HS4). The data covered 29 years from 1991 to 2019, and were downloaded from UNComtrade database (International Trade Statistics Database: https://comtrade.un.org/ accessed on 5 August 2021 ).

#### *2.2. Methods*

2.2.1. RCA Index

The RCA index is defined as

$$\text{RCA}^{k}\_{(ix)} = \frac{X^{k}\_{(i)} / X\_{(i)}}{X^{k}\_{(w)} / X\_{(w)}} = \frac{p^{k}\_{(ix)}}{p^{k}\_{(wx)}},\tag{1}$$

where *X* (or *x*) denotes export, *i* denotes country, while *w* denotes world, *k* denotes product. For example, *Xk* (*i*) represents country *i*'s export of product *k*, *X*(*i*) denotes country *i*'s total export, and *Xk* (*i*) /*X*(*i*) is the export share of country *i* in product *k*. Being a probability, it can

also be expressed as *pk* (*ix*) , and ∑*Nc k*=1 *pk* (*ix*) = 1, where *Nc* represents the number of products in a country.

#### 2.2.2. Economic Complexity Index

The Economic Complexity Index (ECI) was developed by Hidalgo and Hausmann in 2009 [18]. The algorithm for computing it is as follows. Consider a country-product bipartite network represented by a matrix with elements *Mcp* defined as 1 or 0, depending on whether the corresponding RCA ≥ 1 or RCA < 1. Summing up rows and columns of the matrix, one obtains *kc*,0 = ∑*p Mcp*, *kp*,0 = ∑*c Mcp*, which represent, respectively, the observed the number of products exported by some country, and the number of countries exporting some product. The ECI is obtained by an iteration algorithm,

$$k\_{c,N} = \frac{1}{k\_{c,0}} \sum\_{p} M\_{cp} k\_{p,N-1} \tag{2}$$

$$k\_{p,N} = \frac{1}{k\_{p,0}} \sum\_{p} M\_{\subset p} k\_{c,N-1} \tag{3}$$

where *N* ≥ 2 is the number of iterations. Collecting *kc*,*N*, *c* = 1, ··· , *Cn*, where *Cn* is the total number of countries with data, we then obtain ECI as

$$\text{ECI}\_{\text{c}^\*} = \frac{k\_{\text{c}^\*,N} - \text{mean}\{k\_{\text{c},N}\}}{\text{stddev}\{k\_{\text{c},N}\}},\tag{4}$$

where *c*∗ denotes a country of interest, and mean and stdev are performed over all the countries with data. It is thought that the larger the ECI, the higher the economic complexity.

#### 2.2.3. Deviation from Gaussianity Based on KS Test

The KS test (Kolmogorov–Smirnov test or K-S test) is one of the most useful and general nonparametric methods. The one-sample KS test can be used to compare a sample with a reference probability distribution. In this paper, we define the Deviation from Gaussianity (DfG) based on one-sample KS test. The algorithm is as follows:

$$F\_n(\mathbf{x}) = \frac{1}{n} \sum\_{n=1}^{N} I\_{[ - \infty, \mathbf{x}]}(X\_i),\tag{5}$$

where *I*[−∞,*x*](*Xi*) is the indicator function, which is equal to 1 if *Xi* < *x* and 0 otherwise. The Kolmogorov–Smirnov statistic for a given cumulative distribution function *F*(*x*) is

$$D\_n = \sup\_{\mathbf{x}} |F\_n(\mathbf{x}) - F(\mathbf{x})|,\tag{6}$$

where *supx* is the supremum of the set of distances. We define the divergence of DfG in the distribution of RCA index as follows:

$$\text{DfG} = D\_{\text{n}} - \text{C}V,\tag{7}$$

where *CV* is the critical value of KS test. A negative DfG indicates Gaussian distribution of RCA index, while a positive DfG indicates rejection of the Gaussian distribution—the more positive DfG, the larger the deviation from Gaussianity [16].

#### 2.2.4. Pooled OLS and Panel VAR

In this article, we will also employ regression analysis to further explore the connections among DfG, ECI, and economic development. Considering that our data may be considered panel data, we will employ two regression models—pooled Ordinary Least

Square (OLS) and panel Vector Autoregression (VAR) models. The general econometric model for panel data is as follows [43,44]:

$$Y\_{it} = \alpha\_i + \vec{\beta}\_i \cdot \vec{X}\_{it} + \mu\_{it\prime} \tag{8}$$

where, *i* = 1, 2, ... , *N*, *t* = 1, 2, ... , *T*, and *N* and *T* are the number of individual countries and total time (in year), respectively. *Yit* is the dependent variable, - *Xit* is the independent variables (column vector), *αi* and - *βi* are parameters (the latter a row vector with dimension matched to the column vector - *Xit* so that the inner product is defined), and *μit* is the error term. As our purpose in this research is to find (and design) effective measures for quantifying economic complexity, we first assume that *αi* and - *βi* are constant for all countries and time. This scenario is called the pooled OLS model, which is equivalent to the simple OLS model performed on panel data. The concrete equation used here is as follows:

$$
\ln \text{GDP}\_{it} = \alpha + \beta\_1 \text{DfG}\_{it} + \beta\_2 \text{ECI}\_{it} + \mu\_{it\prime} \tag{9}
$$

We also use a panel-data VAR methodology. This technique combines the traditional VAR approach, which treats all the variables in the system as endogenous, with the panel-data approach, which allows for unobserved individual heterogeneity [45,46]. We employ a first-order panel VAR model as follows:

$$z\_{i,t} = \Gamma\_0 + \Gamma\_1 z\_{i,t-1} + \mu\_{t\prime} \tag{10}$$

where *i* represents the country in the panel-data, *zi*,*t* is a three-variable vector (ln GDP, DfG, ECI), Γ1 is a 3 × 3 matrix of coefficients, Γ0 is a vector of individual effects. The stationarity of the three variables will be examined by using the LLC test [47] before we employ the PVAR model. Moreover, we can explore the statistical causality between the three variables based on the PVAR model.

#### **3. Results**

#### *3.1. DfG and Economic Growth*

There are two types of distributions for the RCA index. One is the distribution of the RCA index for all the sectors/products of an economy or a country. The other is the distribution of the RCA for all countries in the world given a sector/product. In this article, we focus on the former. Since the RCA index is the ratio of two probabilities, it is useful to first understand the distributions of the two probabilities. It turns out that both the numerator and the denominator defining the RCA index (*pk* (*ix*) and *pk* (*wx*) ) basically follow exponentially truncated Zipf–Mandelbrot's law, given by:

$$p(k) \sim (k+p)^{-\kappa} e^{-\beta k^{\gamma}}, k > k^\*,\tag{11}$$

where *p*, *α*, *β*, and *γ* are parameters. The exponential truncation can be naturally expected due to finiteness of the data.

To better understand deviations from normality in the distribution of RCA index for different countries, we use Japan and Germany as two examples. Figure 1 shows the distribution features of the two parts of RCA index and the probability distribution function (PDF) of the RCA index for Japan and Germany under the HS4 scheme in 2018. Obviously, the *p*(*wx*) in Figure 1a,b follows exponentially truncated Zipf–Mandelbrot's law. If the *p*(*ix*) in Figure 1a,b are also arranged in descending order, they will also follow exponentially truncated Zipf–Mandelbrot's law (but possibly with different parameters). Interestingly, by comparing the layout of *p*(*ix*) (red diamonds) around *p*(*wx*) (blue circles) in Figure 1a,b, we can observe that the *p*(*ix*) of Germany is more concentrated around *p*(*wx*) than Japan's. This highlights that Germany's export share of most products relative to its total exports is closer to the world average level than Japan's.

Next, we discuss how the differences between Figure 1a,b results in the differences in the distribution of the RCA index shown Figure 1c,d. Clearly, the PDFs for the RCA index of Germany and Japan are very different. Concretely, the PDF of Japan's RCA index has more asymmetry, stronger skewness, and longer tail than that of Germany's. This suggests that the PDF of Germany's RCA index should be closer to a Gaussian distribution than Japan's. To better quantify how the PDF of a country's RCA index deviates from normality, we employ DfG we have defined earlier. The DfG for Germany and Japan is 0.088 and 0.266 in 2018, respectively. According to the nature of DfG—the more positive DfG, the larger the deviation from Gaussianity, one can conclude that the PDF of Germany's RCA index is indeed closer to a normal distribution than that of Japan's, just as one has anticipated from Figure 1.

**Figure 1.** The distribution features of the two parts of RCA index (**a**,**b**) and the Probability Distribution Function (PDF) of RCA index (**c**,**d**) for Germany and Japan under the HS4 scheme in 2018.

It is interesting to examine the spatiotemporal evolution of the DfG of all the economies in the world. For this purpose, we have systematically computed DfG for all the economies in the world from 1991 to 2019. The spatial variations of the DfG in 1998, 2008 and 2018 are illustrated in Figure 2. We observe that the variations of DfG are characterized by spatiotemporal heterogeneity and regional spatial agglomeration.

First, let us focus on the spatiotemporal heterogeneity. From Figure 2a, we can observe: (1) only the DfG of USA and Germany was less than 0.1, followed by France and Italy, (2) only a few countries (such as China, South Korea, Japan, etc.) had DfG between 0.2 and 0.3, and (3) the DfG of most countries was greater than 0.3, especially in Africa, South America, Southern and Western Asia, and Eastern Europe. By 2008, which is shown in Figure 2b, the spatial variation of DfG had undergone some changes. Now Germany is the only economy with DfG < 0.1, indicating that Germany is the only country with the PDF of its RCA index to be very close to a normal distribution. The decrease in China's DfG was significant. In contrast, the DfG in some countries has become larger, such as USA, France, Australia, Egypt, etc. The DfG in most other countries and regions did not change much though, especially in Africa and South America. The major changes in DfG can at least be partially be attributed to the global financial crisis in 2008. Interestingly, by 2018, as shown in Figure 2c, the DfG in India and Vietnam had decreased significantly. This clearly reflected transfer of many production activities to India and Vietnam in recent years. Overall, compared with 2008, the pattern of the spatial variation of DfG for most countries in the world in 2018 did not change significantly. This suggests that the negative impact of the 2008 global financial crisis has been quite long-lasting.

**Figure 2.** Spatial variations of the DfG in 1998, 2008 and 2018 under the HS4 scheme.

Second, let us focus on the regional spatial aggregation phenomena in Figure 2. That is, countries with smaller DfG are mainly concentrated in North America, Western Europe and Eastern Asia, while countries with larger DfG are mainly concentrated in Africa, South America, Western and Southern Asia. It is worth paying attention to the Eastern Asia represented by China, Japan and South Korea. In 1998, the DfG in this region was larger than USA and Germany. By 2008, this gap had shrunk substantially, and by 2018, the level of DfG in this region was already comparable to that in North America and Western Europe. By now, we can conclude that this aggregated region with smaller DfG represented by China, Japan and South Korea has been well formed. It is worth noting that these three

areas with fairly small DfG are very consistent with the description of "The world seems to have three interconnected production hubs for the extensive trade in parts and components" in the "Global Value Chain Development Report 2017—Measuring and Analyzing the Impact of GVCs on Economic Development".

The pattern of DfG's spatial variation suggests that DfG may be indicative of a country's economic performance. To check this idea, we have examined the relationship between DfG and GDP (current dollars) from 1991 to 2019. The result is shown in Figure 3. We observe that DfG and the logarithm of GDP is strongly negatively correlated. This means that the larger the economic scale of a country, the smaller its DfG. In other words, the larger GDP a country has, the easier for the country to have the distribution of its RCA index to converge to a Gaussian distribution. This observation suggests that the level of specialization and division of labor is connected to the deviations from normality in the distribution of a country's RCA index. Generally, the bigger a market (as characterized by GDP) is, the more its participants can specialize and the deeper the division of labor in the market can be achieved.

**Figure 3.** Regression analysis showing correlation between DfG and the logarithm of GDP in 1998, 2008 and 2019.

Finally, let us turn to discuss the dynamic evolution of the DfG for a few more or less arbitrarily chosen countries, including China, India, Australia and Zambia. The results are shown in Figure 4. We observe that China's DfG bascially monotonically decreases in most of the time. India has similar behavior, especially after 1999. In contrast, Australia's DfG has largely been increasing most of the time, while the DfG for Zambia has been fluctuating. Considering that DfG is highly negatively correlated with the logarithm of GDP, we have good reason to conclude that DfG characterizes the trade as well as economic structure of a country to some degree. Therefore, we can associate the temporal variation of DfG for a country with the temporal evolution of its trade and economic structure, as a result of its effort in maintaining competitiveness in the world economy. In short, in general, DfG of a country must be expected to vary with time with trends, instead of being stationary.

#### *3.2. DfG and Economic Complexity*

Considering that the level of DfG is closely related to specialization and division of labor, it is necessary to examine the connection between DfG and economic complexity. Figure 5a–c show correlations between DfG and ECI in 1998, 2008 and 2019, respectively. Clearly, we observe that the DfG is very strongly negatively correlated with the ECI. This suggests that the higher level of economic complexity, the smaller the DfG. In other words, the higher level of economic complexity, the closer a country's RCA index to a normal distribution. Therefore, relationships between the DfG and economic development and economic complexity reflect that a closer a country's RCA index to a normal distribution, the higher degree of economic complexity and better economic performance of a country.

**Figure 4.** Dynamic evolution of the DfG for China, India, Australia and Zambia from 1991 to 2019 under the HS4 scheme.

**Figure 5.** Regression analysis showing correlation between DfG and ECI in 1998, 2008 and 2019.

It is interesting to compare the Pearson correlation coefficient between DfG and the logarithm of GDP and that between ECI and the logarithm of GDP. Since the correlation coefficient for the former is negative but positive for the latter, it is more convenient to use the Pearson correlation coefficient between DfG and the logarithm of GDP in absolute value. The result for the comparison is shown in Figure 6, where the red curve denotes the absolute value of the correlation coefficient between DfG and the logarithm of GDP, and the blue curve is for the correlation coefficient between ECI and the logarithm of GDP. We observe that before the global financial crisis of 2008, the correlation coefficients between DfG and the logarithm of GDP, and between ECI and the logarithm of GDP, are comparable. However, after the global financial crisis, the correlation coefficients between DfG and the logarithm of GDP are persistently larger than those between ECI and the logarithm of GDP. The significance of this feature for designing better indicators of economic complexity will be further discussed in the last section.

Out of curiocity, we have examined whether DfG using import data is still strongly negatively correlated with the logarithm of GDP. The answer is positive. In fact, the correlation coefficient using import data is basically identical to that using export data. This interesting property however, is not shared by ECI—when using import data, whether we focus on adjacency matrices based on RCA ≥ 1 or RCA < 1, the computed "ECI" essentially has no correlation with the logarithm of GDP. This signifies that RCA ≥ 1 or RCA < 1 based on import data cannot be interpretated as that based on export data to have comparative advantage or disadvantage.

**Figure 6.** Variation of the Pearson correlation with time, where the red and the blue curves are for the absolute value of the correlation coefficient between DfG and the logarithm of GDP, and the correlation coefficient between ECI and the logarithm of GDP.

#### *3.3. Regression and Causality Analysis*

To understand more deeply the connection between DfG and economic development, we have employed the Pooled OLS model. The results are summarized in Table 1. Here, we select 60 countries which have continuous data from 1996 to 2019. We thus have a total of 1440 observations. We have first run a pooled OLS regression for the whole period. The results are shown in columns 1 to 3 of Table 1, where the 1st column is for the model with only DfG considered, the 2nd column for the results with only ECI considered, and the 3rd column for both DfG and ECI considered. We call these models 1–3. We observe that the regression coefficients for models 1–3 are significant at the 1% level. By comparing the columns 1 and 2, we find that DfG can explain 57.3 percent of the variance in GDP, while ECI accounts for 45.7 percent, as shown by the *R*2 of the regression. This suggests that the explanatory power of DfG on GDP is stronger than that of ECI. After both DfG and ECI are considered, the model explains 58.7 percent of the variance in GDP, which is slightly better than model 1.

**Table 1.** Regression results for GDP, DfG and ECI.

1 **Note:** \*\*\* *p* < 0.01, \*\* *p* < 0.05.

Considering that DfG has a higher correlation with GDP than ECI since the global financial crisis of 2008, we have also divided the whole time period into two, one from the year 1996 to 2007, the other from 2008 to 2019. The results are shown in the columns 4–6 and 7–9 of Table 1, for the models 1–3 explained earlier. By comparing the results of regression models for these two groups, we find: (1) in both time periods DfG has a stronger explanatory power on the variance of GDP than ECI, (2) the explanatory power of DfG and ECI coombined on the variance of GDP in first group is stronger that that of the second group. It is worth noting that ECI does not significantly improve the explanatory power of the model on the variance of GDP in these three scenarios of regression models, especially in the period after the global financial crisis of 2008. Therefore, DfG better explains the variance in GDP than ECI.

We have also performed a panel VAR analysis. LLC test indicates that the three variables with one period lag and trend are stationary. This allows us to estimate the coefficients of the system described by Equation (9) after the individual effects removed. Robustness test shows that the PVAR model is reasonable, as shown in Figure 7. Table 2 shows the results of the model with three variables, from the columns of which we find that the impact of ln GDP with one period lag on ln GDP, DfG and ECI are significant for all three different panel VARs, the impact of DfG with one period lag on DfG and ECI are significant, and the impact of ECI with one period lag on DfG and ECI are significant. However, impacts of DfG and ECI with one period lag on ln GDP are not significant. On the other hand, impact of DfG with one period lag on DfG is positive but negative on ECI, while the impacts of ECI with one period lag on both DfG and ECI are positive.

**Table 2.** Main results of a three-variables panel VAR.

1 **Note:** \*\*\* *p* < 0.01.

**Figure 7.** Robustness test of Panel VAR.

Finally, we have examined the statistical causality among the three variables based on PVAR by using panel Granger causality Wald test. The results are shown in Table 3. We observe that the ln GDP is not the Granger cause of DfG and ECI at the 5% level, while the DfG and ECI are the Granger cause of ln GDP at the 1% level. This result is as anticipated.

**Table 3.** Granger causality Wald tests for Panel VAR.

1 **Note:** \*\*\* *p* < 0.01.

#### **4. Discussion**

Understanding the difference in economic development among countries or regions is a long-standing issue in economics. A crucial perspective to shed light on the issue is to evaluate competitiveness of a country in international trade as characterized by the RCA index. Although it is desirable to have a normally distributed RCA, empirical studies have often found the opposite. This discrepancy has stimulated a lot of researchers to develop alternative indices of the RCA index so that their distributions would be closer to Gaussian distributions. Yet, those efforts are not very successful. This calls for a deeper understanding of the significance of a normally distributed RCA index.

To gain insights into this issue, we have defined a quantity, DfG, based on the KS test, which quantifies the deviation of the distribution of a country's RCA index from normality. We have found that the variations of DfG are characterized by spatiotemporal heterogeneity and regional spatial agglomeration. The spatiotemporal heterogeneity of the DfG refers to the significant differences in many countries' DfG and their dynamic evolution. Regional spatial agglomeration of the DfG refers to that countries with smaller DfG are mainly concentrated in North America (represented by USA), Western Europe (represented by Germany), and Eastern Asia (represented by China, Japan and South Korea). Interestingly, these three areas are very consistent with the description of "The world seems to have three interconnected production hubs for the extensive trade in parts and components" in the "Global Value Chain Development Report 2017—Measuring and Analyzing the Impact of GVCs on Economic Development". It suggests that the DfG has some connections with the development of GVCs. On the other hand, countries with larger DfG are mainly concentrated in Africa, South America, Western and Southern Asia.

The pattern of DfG's spatial variation suggests that the DfG can act as a good indicator of a country's economic performance. This is indeed so, as DfG is found to be strongly negatively related with both the logarithm of GDP and the ECI. Therefore, the closer the distribution of a country's RCA index to a normal distribution, the higher degree of economic complexity and better economic performance of the country. This highlights the optimality of a country's export when its RCA index follows a normal distribution, and provides a new perspective to understand the difference in economic development among countries or regions. Furthermore, we have found that the correlation coefficients between DfG and the logarithm of GDP are persistently larger than those between ECI and the logarithm of GDP after the 2008 global financial crisis. This is further corroborated by regression analysis which shows that DfG better explains the variance in GDP than ECI. Further Granger causality analysis shows that DfG and ECI are the Granger cause of ln GDP, but not the vice versa. It is worth emphasizing that Gaussianity is not a cause, it is more a consequence indicating economic development.

The last feature, that DfG is more strongly correlated with GDP than ECI, suggests an interesting way to improve characterization of economic complexity of a country. For this purpose, we need to first understand the meaning of the correlation between ECI and the logarithm of GDP. This is due to the strong correlation between export and GDP—ECI amounts to retaining only products with RCA equal to or greater than 1 and approximating the amount of export by counting the number of products with RCA ≥ 1. Our observation that after the 2008 global financial crisis, the correlation between DfG and GDP is stronger than that between ECI and GDP, can at least be partially attributed to the enhancement of the global participation in production chains, or simply, greater participation in global value chains (GVCs). Therefore, simply focusing on RCA ≥ 1, which has been used in designing ECI and its variants, is no longer sufficient. In other words, information contained in products with RCA < 1 can no longer be simply discarded. Therefore, in future, it would be extremely interesting to develop a new economic complexity index by using DfG alone, or by combining DfG and ECI (or its variants).

**Author Contributions:** Conceptualization, J.G. and B.L.; methodology, J.G. and B.L.; software, B.L.; validation, J.G. and B.L.; formal analysis, J.G. and B.L.; investigation, J.G. and B.L.; resources, B.L.; data curation, B.L.; writing—original draft preparation, J.G. and B.L.; writing—review and editing, J.G. and B.L.; visualization, B.L.; supervision, J.G.; project administration, J.G.; funding acquisition, J.G. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was supported by the National Key Research and Development Program of China under Grant No. 2019AAA0103402, by the Fundamental Research Funds for the Central Universities, and by Innovation Project of Guangxi Graduate Education under Grant No. YCBZ2017017. It is also supported by the National Natural Science Foundation of China under Grant No. 41671532. One of the authors (JG) also benefited tremendously from participating the long program on culture analytics organized by the Institute for Pure and Applied 746 Mathematics (IPAM) at UCLA, which was supported by the National Science Foundation.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Data available in a publicly accessible repository.

**Acknowledgments:** The authors thank Xin He and Qiyue Hu for help plotting some of the figures presented in the paper.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

## *Essay* **Formal Matters on the Topic of Risk Mitigation: A Mathematical Perspective**

**Giuseppe Bilotta \*, Annalisa Cappello and Gaetana Ganci**

Osservatorio Etneo, Istituto Nazionale di Geofisica e Vulcanologia, Piazza Roma, 2, 95125 Catania, Italy **\*** Correspondence<EMAIL_ADDRESS>
**Abstract:** How (in)formal should the classic expression describing risk as the product of hazard, exposure, and vulnerability be considered? What would be the most complete way to describe the process of risk mitigation? These are the questions we try to answer here, using a formal, mathematically sound yet abstract description of hazard, exposure, vulnerability, and risk. We highlight the elements that can be affected for the purpose of mitigation and show how this can improve the quantitative assessment of the procedural aspects of risk mitigation, both long- and short-term, down to the timescale of emergency response.

**Keywords:** risk; vulnerability; exposure; hazard; mitigation

#### **1. Introduction**

The groundwork for a clarifying definition of the concepts of risk and hazard, and their relation, was first carried out in an international setting in [1], wherein *risk* is defined as the possibility of loss (whose type and cause are further specified by attributes, such as seismic risk for the chance of loss caused by earthquakes), and (natural) *hazard* is defined as «*the state of risk due to the possibility of occurrence of a*» (natural) «*disaster*». The document also includes a brief section concerning protection and insurance, arguably the first mention of the need of a systematic approach to risk mitigation.

#### *Risk Management in Formulas*

The current commonly (at least in the field of natural hazards) accepted informal expression of risk as the product of hazard, exposure (or value), and vulnerability is due to [2]:

$$\text{Risk} = \text{Hazzard} \times \text{Exposure} \times \text{Vulnerability} \tag{1}$$

where Hazard indicates the probability of occurrence of the event (e.g., lava flow inundation, earthquake, etc.), Exposure is a quantification of (the value of) the people, systems, and property potentially subject to the hazardous phenomenon (in fact, Ref. [2] explicitly uses the term Value rather than Exposure), and Vulnerability is a quantification of the effective relative impact of the event, expressed as a percentage, with *V* = 1 indicating total loss (100%) and *V* = 0 indicating total resilience. Contextually, the author also presents some key elements for risk management (in the context of volcanic hazard, but of general applicability), such as land-use planning ("zoning") to reduce exposure, and preparedness (including monitoring, early warning systems and response planning) to reduce vulnerability.

We note that Equation (1) is essentially *qualitative* in nature, rather than quantitative, as pointed out e.g., by [3]. Other functional relationships are available in the literature, especially in engineering contexts. For example, Ref. [4], and more recently [5], prefer an even more informal

$$\text{Risk} = \text{Uncertainty} + \text{Damage.}\tag{2}$$

**Citation:** Bilotta, G.; Cappello, A.; Ganci, G. Formal Matters on the Topic of Risk Mitigation: A Mathematical Perspective. *Appl. Sci.* **2023**, *13*, 265. https://doi.org/ 10.3390/app13010265

Academic Editors: Andrea L. Rizzo, Na Zhao and Hua Zhong

Received: 29 November 2022 Revised: 19 December 2022 Accepted: 20 December 2022 Published: 26 December 2022

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

When relating risk to hazard, Ref. [4] provides a different, but still informal relationship:

$$\text{Risk} = \frac{\text{Hazard}}{\text{Safetyards}} \tag{3}$$

that provides an explicit indication of the possibility of intervention to reduce risk. This is in contrast to [2] whose formula (1) provides no explicit mention of the possible quantification of mitigation efforts, even though the paper presents several approaches to risk management.

In the field of natural hazards, an extension of (1) that includes an explicit dependency on mitigation is given by [3]:

$$\text{Risk} = \text{Hazzard} \times \text{Exposure} \times (\text{Vulnerability} - \text{Risk mitigration efforts}), \tag{4}$$

and more recently in [6] that provides a different formulation for mitigated risk as:

$$\text{Risk} = \frac{\text{Hazzard} \times \text{Exposure} \times \text{Vulnerability}}{\text{Mitigation measures}}.\tag{5}$$

Equations (4) and (5) are also intended to be informal and qualitative rather than quantitative, although, like (1), they *can* be used in a more quantitative sense (see also Section 2.4). For example, (5) could be used to compute an a posteriori value for the *efficiency* of the given mitigation measures as *M* = *RU*/*RM*, where *M* represents the efficiency of the mitigation measures, *RU* the unmitigated risk, and *RM* the mitigated risk.

Arguably, (4) and (5) illustrate a philosophical difference in the approach to risk mitigation: while [3] focuses exclusively on reducing vulnerability, [6] applies mitigation to risk *as a whole*, and it is thus closer to the arguments brought forth in [2], which include the exposure-related land-use planning as a risk management feature. In relation to the other formulas seen so far, it may also be considered a more detailed version of (3), and a more general version of (4), even though the latter is not clear, due to the different choice of mathematical operators used to indicate the influence of mitigation measures.

Considering their qualitative, informal nature, the functional difference between (4) and (5) is actually largely inessential. It is only when aiming at a more rigorous and quantitative assessment of risk and its mitigation that the specifics of the mathematical formulation become relevant—an aspect that so far has received more attention in engineering [4,5,7,8] than in natural hazards [9–11].

In engineering, this quantifying effort is required to manage the multi-objective problem of minimizing both the risk and the costs associated with the mitigation [8]. In this sense, risk takes the form of an expected loss of value in a strictly probabilistic sense, and may be more in general treated not as a single value, but as a formal collection of all the elements that contribute to its assessment. For example, Ref. [4] defines risk as a set of triplets that describe all of the known possible, mutually exclusive scenarios, their probability, and their outcomes; no single value is associated with risk.

In an effort to try and bridge the gap between the more qualitative formulation of risk (1) presented by [2] and common in natural hazards, and the more formal approaches to the quantification of risk and its mitigation common in engineering, we present here a detailed mathematical approach to the quantification of risk assessment and mitigation.

While the description will be kept as abstract and generic as possible, much of it can be seen simply as a formalization of common practices [11,12]. In addition, our formalism will make an effort to bring out the explicit dependency of risk (and its components) on several variables, highlighting the distinction between decision variables (i.e., quantities that can be influenced by decision-makers and other stakeholders) and other input variables [8], which will be crucial to our discussion about the quantitative approach to risk mitigation. The focus will be specifically on (1) and will not directly touch on the mathematical aspects of hazard and risk assessment (including details about modeling and quantification) that have been extensively discussed in the literature [3,9–11].

#### **2. Formalizing Risk**

To formalize the risk assessment Equation (1), we must first define hazard, exposure, vulnerability, and risk in a mathematically rigorous sense, while preserving the spirit and, as far as possible, the actual functional relationship of (1).

To this end, consider a two-dimensional set Ω ⊂ R2 that represents our *area of study* in some appropriate reference system, e.g., a two-dimensional section of the Earth surface with a specific choice of coordinate system. such as, for example, EPSG:32633 (WGS-84 spheroid with UTM projection, zone 33 north) to study Mt Etna [13] and references within, or EPSG:32740 (WGS-84 spheroid with UTM projection, zone 40 south) for Piton de la Fournaise [14].

(Our formalization is actually independent from the dimensionality of the problem: we could just as well consider Ω ⊂ R3 and reason in three dimensions, e.g., for the risk associated with hazards in industrial complexes, taking into account the three-dimensionality of the distribution of people and other exposed elements. Time as a parameter could be included in a similar fashion.)

#### *2.1. Hazard*

Assume for simplicity that we are looking at the case of a single hazard expressed as the probability of occurrence of a dangerous event hitting a specific area, with no intensity information. Formally, this translates to a *pointwise hazard* probability density function *h* : Ω → [0, 1] such that, for any *area of interest A* ⊆ Ω, the probability of the hazard affecting the area *A* is

$$H(A) = \int\_A h(x, y) \,\mathrm{d}x \mathrm{d}y.$$

Hazard may depend on the location (coordinates) directly, or implicitly through some other spatial property that can be affected by human action (e.g., many geophysical flows may be affected by building ditches and barriers).

We can make this dependency explicitly by writing *h* : T × Ω → [0, 1], where T is a family of functions *T* defined in Ω and with values in some appropriate codomain DT . As a practical example, *T* might be a mathematical description of the topography of Ω, and *h*(*T*, *x*, *y*) is the pointwise hazard associated with a geophysical flow whose behavior depends on the given topography. In this case, we would have DT = R, i.e., the set of real numbers describing the pointwise altitude a.s.l. of the area of study.

Note that *T* may have "long range" effects, in the sense that a change in the value of *T* at some point (*x*0, *y*0) may affect the hazard in points (*x*, *y*) = (*x*0, *y*0): for example, building an embankment is a local alteration of the topography that can reduce hazard in all points downstream of the structure. For this reason, *h* must depend explicitly on *T* as a function, rather than simply as *h*(*x*, *y*) = *h*(*T*(*x*, *y*), *x*, *y*).

In general, man-made structures have an influence on hazard even if that is not their intent. For example, buildings and roads can influence geophysical flows, and coastal/river structures can influence flooding hazard. While the influence of such structures could be incorporated in *T*, to simplify notation, we will separate this into an additional dependency of hazard on some *B* ∈ B that will in turn depend on exposure-related elements that will be presented momentarily.

#### *2.2. Exposure*

In a similar fashion to hazard, we can define a *pointwise exposure e* : Ω → [0, +∞] such that, for any area of interest *A* ⊆ Ω, its exposure value is defined as

$$E(A) = \int\_A e(x, y) \mathrm{d}x \mathrm{d}y.$$

In general, however, exposure does not depend directly on the coordinates themselves, but rather on the distribution of elements at risk, such as population, land use, presence of buildings or infrastructure, etc. As carried out with hazard, it is thus better to write

*e* : P × Ω → [0, +∞[, where P is the family of functions *P* (defined in Ω with an appropriate codomain DP) that describe mathematically the distribution of the key exposed elements. It should be assumed that the elements of P have some kind of constraints (e.g., if *P* represents population distribution, we can assume that the total population **P** = Ω *P*(*x*, *y*)d*x*d*y* is independent of the choice of *P* ∈ P).

Moreover, as noted before, the choice of *P* can have an influence on hazard too, inasmuch as the associated infrastructure impacts the evolution of the hazardous phenomenon. For a given *P* ∈ P, we can thus define a set B(*P*) of functions *B* in Ω that represents the man-made structures supporting the exposed element distribution *P* and affecting the hazard.

Obviously, exposure itself depends on these elements too. The full function signature for *e* and *h* is thus *h* : T ×H(P) × Ω → [0, 1], *e* : P×H(P) × Ω → [0, +∞[. Then, the hazard *H* and the exposed value *E* can be computed respectively as

$$H(A, T, P, B) = \int\_A h(T, P, B, \mathbf{x}, y) \mathrm{d}x \mathrm{d}y,\qquad E(A, P, B) = \int\_A e(P, B, \mathbf{x}, y) \mathrm{d}x \mathrm{d}y\tag{6}$$

with *A* ⊆ Ω the area, *T* ∈ T any natural or man-made elements that influences hazard, but not exposure, *P* ∈ P the distribution of exposed elements with no impact on hazard, and *B* ∈ B(*P*) the distribution of *P*-dependent exposed elements that influence hazard.

#### *2.3. Vulnerability*

As implemented for hazard and exposure, the *pointwise vulnerability* can also be defined as a function *v* : Ω → [0, 1]. Vulnerability, though, does not depend only on the coordinates, but also on the resilience of the individual exposed elements, as well as on their interactions with the other exposed elements.

Consider the example of seismic hazard: the vulnerability of a building depends on the ground properties (sand vs. rock) of the location where it was built, on the resilience of the building to the shaking, but also on the presence of other surrounding buildings that could affect it by pounding due to their oscillation during an earthquake [15]. Finally, the vulnerability may also depend on the same environmental factors that also affect hazard (e.g., a rampart may reduce the vulnerability of a building, and also divert a geophysical flow, affecting the hazard).