{'fraction_non_alphanumeric': 0.038461538461538464, 'fraction_numerical': 0.010905125408942203, 'mean_word_length': 4.715004793863854, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Interpreting and predicting the economy flows: A time-varying parameter global vector autoregressive integrated the machine learning model

The paper proposes a time-varying parameter global vector autoregressive (TVP-GVAR) framework for predicting and analysing developed region economic variables. We want to provide an easily accessible approach for the economy application settings, where a variety of machine learning models can be incorporated for out-of-sample prediction. The LASSO-type technique for numerically efficient model selection of mean squared errors (MSEs) is selected. We show the convincing in-sample performance of our proposed model in all economic variables and relatively high precision out-of-sample predictions with different-frequency economic inputs. Furthermore, the time-varying orthogonal impulse responses provide novel insights into the connectedness of economic variables at critical time points across developed regions. We also derive the corresponding asymptotic bands (the confidence intervals) for orthogonal impulse responses function under standard assumptions.


INTRODUCTION
Global economic integration is inherently essential for country-wise interdependent and country-specific autonomy. Economic activity is once internationally started, and its transmission provides insights into the economic advancements across and among countries. The activity reaction does affect a government and global authorities, which leads to evaluating the identification of the activity effect across countries. Methods for implementing the reaction function for economic activity become vital due to the curse of global-wide aggregation.
Global vector autoregressive (GVAR) is a means of simultaneously explicating numerous economies' dynamics (Pesaran et al., 2004). In the sense of transmission mechanism for the economic activity, the impulse response function (IRF) is typically employed to depict activity (shock) within cross-sections. Mixed cross-section GVAR (MCS-GVAR) evaluates the interaction between different cross-sectional types (Gross and Kok, 2013). However, it is under the endogenous assumption for the model set. Georgiadis (2015) introduced exogenous variables in an MCS-GVAR to retain a common economic shock as a cross-section.
The author effectively solved the issue of inconsistent timing and frequency of distinct variables and considered the interaction between variables in different locations and the overall regulation approach of the common economic shock. However, regardless of the endogenous and exogenous variables in those models, their weights are time-invariant. Therefore, the impacts of fitting and forecast accuracy are not desirable.
Alternatively, Hauzenberger and Pfarrhofer (2021) considered a time-varying panel vector autoregressive. This model had a relatively high prediction accuracy but did not take into account the mutual impact between different variables in different regions and the overall regulatory of common economic shock. The parameter structure obtained by training in this model cannot be extended to future predictions, therefore, it is impossible to forecast future sequences, and the interpretability is insufficient. We consider modelling time-varying weights for cross-sectional variables. Given the time-varying weights, the bounds of the impulse response could be obtained. In particular, the shock change is more general, with much greater applicability. We apply for the orthogonal IRF (OIRF) (Sims, 1980;Kilian and Lütkepohl, 2017). Given the OIRF based on our time-varying parameter GVAR (TVP-GVAR) model, we will calculate their bounds using asymptotic distribution (Lütkepohl et al., 2020;Lütkepohl, 2005) and examine the significance of the shock. In the framework of TVP-GVAR, we introduce methods for country-specific and global-wide responses that vary over time, consider the economic variables (such as gross domestic product, GDP; and unemployment rate) spreads at multiple time intervals, and integrate machine learning models of the proposed TVP-GVAR model, referred to as TVP-GVAR-ML.
The general form of GVAR model (Pesaran et al., 2004) is defined as: Originally, G 0 is a non-singular matrix and not varied over time, and u t is residuals. Thus, parameters b and F 1 are assumed here as time-invariant parameters of Equation (1).
The setting above allows G 0 to vary, which enables a more general assessment of macroeconomic regulation. We also establish different machine learning models for our estimators of time-varying weights. As Farrell et al. (2021) stated, these based on our proposed models are offered as training samples in the various machine learning models to forecast coming trajectories and then put back into our models to obtain economic variables. When the weights are correctly estimated, data-driven learning may be applied to exhibit superior performance in the trajectories of economic variables. Thus, our models will have a two-stage analysis for out-of-sample prediction. We attempt to identify the economic activity response, technical capabilities needed to be user-friendly and interpret the estimates to maximize their values for authorities.
In Section 2 we introduce our models, propose GRF and compute their boundaries. The corresponding analysis of economic data in the United States, Euro area, and Japan are illustrated in Section 3. In the end, section 4 discusses the remarks and inference of the proposed model.

Basic model
As was previously mentioned, our economic inputs come at different frequencies. In light of this, the imputation of economic variables at the same time intervals in advance is carried out in accordance with Ankargren et al. (2020). The presented approaches concentrate on p economic variables, which are supposed to be endogenous variables for each country. Consider exogenous variables from the common economic activity (behaviour) and the remaining countries, and there are K countries at moment t. We also make the simplifying assumption that all exogenous variables have first-order lag. For each country k = 1, ..., K, there is a time-varying parameter GVAR (TVP-GVAR) model given by where the superscripts E and B denote an economy sovereign/country and a common economic activity, respectively. * represents an exogenous form of the variables. a k,t is uncorrelated each other, and cross-sectional weak independent with expectation 0 and Σ u = V ar(u k,t ).
For each country k, there are Also, as country-wise interdependent, there are p + l exogenous variables for country k out of all K countries: For p variables from one of the other countries, there are ii,t = 0, ik,t is defined as transform weight for a country k at k-th column in a matrix.
Additionally, supposed to all K country economies are affected by l economic behaviours, i.e., there are l common external shocks for all countries. We then have represent l common economic activities.
For each x (B) l,t , it has a similar form to x (E) k,t , which holds where {u t } is again uncorrelated each other and weak stationary with expectation 0.
The l exogenous variables for common economic activities from countries are defined as is a weight matrix for all K countries to common economic activities. A k country may be involved l common economic activities, the weights could be satisfied by K k=1 w km,t = 1, m = 1, 2, · · · , l.
In practice, based on two weight matrices W Thus, for each country k, the basic model (Equation (2)) can be transformed as: Then, Equation (2) has the form as: and Equation (4) is equivalent to the following forms: We have K countries, and thus Equation (4) has a stacked form as: Next, we consider l common economic activities. Equation (3) can have a similar form to the above process, denoting: where z Combined Equations (3) and (5), we have where m = 1, 2, · · · , l and A form as: We consider Equations (2) and (3) together, and the coefficient matrices can be obtained as: . Now, we combine Equation (2) and Equation (3) to obtain Then, we again employ the moving average process for Equation (6), where d t denotes the determinant part of x t , and B s is constructed

Time-varying parameters (TVPs) estimations
For each variable in every country k, there is a compact version of Equation (6), For convenience, we define N = Kp + l. Allowing for TVPs is straightforward by drawing from the vast literature on state-space models. The regression coefficients are stacked in a 2 × 1 -vector θ t = (b it , f 1it ) . We assume independent random walk state equations Here, η it is a zero-mean Gaussian error term and diagonal covariance matrix Ω = diag(ω i1 , ω i2 ) of size 2 × 2. The state innovation variances in Ω govern the degree of time variation in the regression coefficients, where we develop the following algorithm based on Hauzenberger and Pfarrhofer (2021).

Algorithm 1 The estimations of parameters in TVP
2.θ t , to define the prior distribution on the time-varying regression coefficients, we consider the state-space model in its non-centred parametrization. Let √ and then we split the coefficients into a constant and time-varying part: Using this transformation,θ t follows a random walk with standard normal shocks and is generated by the Kalman filter, And the iteration formulas are as follows: After we have expectations and variances, we can sampleθ t from N(m it , P i0 ).
3. θ i0 , √ Ω i , change the Formula (8): Therefore, θ i can be sampled according to the practices in the paper of Frühwirth-Schnatter and Wagner (2010), in which θ i join from the normal posterior N(a i , A i ) it is mentioned in Frühwirth-Schnatter and Wagner (2010)'s article that σ i is subject to gamma distribution: Thus σ i can be sampled from the above distribution.
5. Repeat the above process from 1 to 3, and take the sampling result of the last iteration as the estimation of the parameters to be estimated.
6. Finally, an estimate for θ it can be calculated by substituting the θ i0 andθ it obtained from each estimate into the Formula θ it = θ i0 + √ Ω iθit .

IRF
To identify the response of a (common) shock, the existing IRF has been developed to provide estimates. We aim to offer reasonable estimates inferred from the observed data and interpret targeting responses to an emerging event. Empirically, IRF may have the general form, called general IRF (GIRF), in which multiple variables at future moment t + n are affected by a shock at current time t, where I t−1 is the information set at the moment t − 1, σ kk, are diagonal elements in a covariance matrix Σ u , Σ u = E(u t u t ), corresponding to -th equations for a country k, and n is the length of the observational period. Here, we take a further look at the orthogonal IRF (OIRF) for the numerous economic variables' impacts on an economic variable.
TVP-OIRF : Consider Cholesky decomposition for a covariance matrix Σ u , we have where P is a (Kp + l) × (Kp + l) lower triangular matrix, then Equation (6) may have the form as where ξ t = P −1 u t is orthogonal, i.e., E ξ t ξ t = I (Kp+l) . Thus, for j-th variable (a variable for a country k in a GVAR model) given a unit impulse δ j at the moment t, it could have orthogonal IRF at the moment t + n.
where e j is a (Kp + l) × 1 column vector, with j-th element as 1 and others are 0. Note that we will abbreviate it as OIRF below.
Asymptotic distributions: In order to calculate the error bands of the orthogonal impulse response, we introduce the asymptotic distribution of it proposed by Lütkepohl et al. (2020) and Lütkepohl (2005).
α := vec(F 1 ), σ := vech(Σ ε ) where P ε is the Cholesky decomposition of Σ ε and G n := ∂vec(B n )/∂α = n−1 m=0 (F 1 ) n−1−m ⊗ B m . The communication matrix K mn is defined such that, for any (m × n) matrix Q, K mn vec(Q) = vec(Q ). Furthermore, L m is the (m(m + 1)/2 × m 2 ) elimination matrix defined such that, for any (m × m) matrix S, vech(S) = L m vec(S). And vec(·) is the column stacking operator, and vech(·) is the column stacking operator for symmetric matrices (stacks the elements on and below the main diagonal only). A ⊗ B represents the Kronecker product of matrices A and B.
Then the error bands can be formed as the result of (9): where z 1−α/2 denotes the 1 − α/2-quantile of the standard normal distribution and OImp ij is the i-th element of OImp j (n) andσ( OImp ij ) is the square root of element ((Kp + l)(j − 1) + i, (Kp + l)(j − 1) + i) of the estimated (C n Σ α C n +C n Σ σC n ).

Forecasting
There has been increasing use of various machine learning models in forecasting. To address the interpretability of estimates, we obtain empirical measures of estimates from the TVP process as training sets and explore their time-varying values until the end time using machine learning models. Once the time-varying estimates have been produced, we allow those values back to the TVP process for the final forecasting economic variables. We consider the time-varying weights of the training data on the last day and fix them to estimate the time-varying values of the testing data, called constant prediction. The estimation also considers the Vector autoregressive regression (VAR) (Sims, 1980;Johansen et al., 1995) process. The other existing models including TREE, Random Forest (RF) (Breiman, 2001), Least Absolute Shrinkage and Selection Operator (LASSO) (Tibshirani, 1996(Tibshirani, , 2011, Long Short Term Memory (LSTM) (Hochreiter and Schmidhuber, 1997), Gated Recurrent Unit (GRU) (Chung et al., 2014), and LSTM combined with GRU (LSTM GRU) are used to implement time-varying estimates. Then, we use these estimates to project the following trajectories of economic variables. The projection spans from January to June of 2021.
Finally, the prediction performance is calculated using Mean Squared Error (MSE): where Actual i are the actual economic variables at the i-th month, and P redicted i are the predicted ones simultaneously.
The deep neural network models are trained for up to 100 epochs. The training process is terminated if MSE does not improve over 40 consecutive epochs. The final deep learning models (LSTM, GRU, and LSTM GRU together) were maintained at the lowest MSE.

APPLICATIONS
We choose the United States, the Euro area, and Japan as the representative countries, with the change in oil prices serving as the common shock. The desirable economic variables are CPI, HUR, and GDP with varied frequencies. Data is gathered on the first day of every month from the first of 2000 until the last of 2020. The comprehensive workflow is depicted in Figure 1.

United States Euro Area Japan
Data Preprocessing     Secondly, the OIRF and its asymptotic confidence intervals can be estimated using the acquired GVAR parameters and the asymptotic distribution of OIRF. Figure 4 describes the partial findings of the time-invariant OIRF and time-varying OIRF of three different time points for desirable economic variables in the United States, Euro area, and Japan and their asymptotic bounds. Specifically, we investigate three-time issues, July 1st, 2020, April 1st, 2011, and December 1st, 2007 to the global COVID-19 confirmed cases of over 10 million, the Fukushima nuclear meltdown in Japan, and the sub-prime mortgage crisis in the United States, respectively. After a predetermined amount of time, as shown in Figure 4, practically all OIRF will converge to the value 0. Here, we focus on the upcoming period of six months, except for the time-varying OIRF of the GDP of the United States to the unit shock from the HUR of it on July 1st, 2020. It reveals that these economic variables are a reasonable degree of consistency in this GVAR system, regardless of whether its parameters are time-varying. Additionally, a positive sign on the OIRF indicates a positive association between the shock and response and vice versa. For instance, we can see from the first subgraph of the second row of Figure   4(a) that following a unit shock from the Euro area's GDP, the HUR of the United States decreases, and the impact lessens dramatically to around 0 a month later. In general, the graphic demonstrates that the effects represented by OIRF vary between the time-invariant and time-varying GVAR models and within different time points of the time-varying GVAR model. As an illustration, consider the OIRF of the GDP of the United States to the unit shock from the Euro area's GDP, which is the central subgraph of each panel in Figure 4.

GDP (EU27), Crude Oil Prices --HUR (EU27)
Time Figure 5: The time-invariant and time-varying OIRF to multivariate shocks with asymptotic bounds. The figure displays the mean impulse responses (solid blue lines) of the United States GDP and the Euro area's HUR shocks from several other economic variables. Each subgraph shows how these two variables fluctuate over the subsequent six periods after the shocks in a region. The shaded areas surrounding the impulse responses represent 95% asymptotic bounds. The solid red lines correspond to 0.
Since many of the shapes of the OIRF to multivariate shocks are similar to one of the OIRF to univariate shock, it can be inferred from Figure 5 that the OIRF to shocks from more than one output is frequently dominated by one particular variable. For example, on April 1st, 2011, andDecember 1st, 2007, the OIRF of the Euro area's HUR to the shocks from its GDP and oil prices ( Figure 5(a2)(c2)(d2)) is quite similar to the OIRF to the shock from oil prices alone (the second subgraph of the last row of Figure 4(a)(c)(d)). This is the case for both the time-varying GVAR and time-invariant models. Thus, during these two corresponding economic crises and shared situations, the shock from oil prices had a much more significant impact on the Euro area's HUR than the effect on its GDP. Nevertheless, on July 1st, 2020, of the time-varying system, the same OIRF ( Figure 5(b2)) now looks like the OIRF to the shock only from the Euro area's GDP (the third subgraph of the second row of Figure 4(b)).  Table 1, we use LASSO as our projection method for the economic variables and oil price because it has the lowest value of MSE. Figure 6 presents the predicted and the

CONCLUSIONS
In our paper, we develop the TVP-GVAR merged with a machine learning approach for predicting the economic variables in developed regions. The results of model selection are reported based on the values of MSE. Both the in-sample and the out-of-sample analyses benefit from the relatively high precision brought about by the association of the TVP-GVAR estimate and prediction with the LASSO-type technique. Furthermore, we make predictions on the structure of the parameters, which enables high accuracy in time-varying out-of-sample projections and may reflect the potential influencing factors and temporal mechanisms. In this context, the chosen LASSO-type technique helps to lessen the likelihood of over-fitting, broadens the proposed model's applicability, and, as a result of its orthogonality, improves the accuracy of test samples. In addition, it is adaptable enough to integrate a wide variety of machine learning and network structures, resulting in significantly lower values of MSE. This data-driven procedure is easily accessible for practitioners in pertinent application scenarios.
We also consider time-varying and time-invariant orthogonal impulse response functions and derive the asymptotic distribution of estimates on bounds of OIRF, demonstrating the influence on each variable after a unit shock from every other variable. In practice, the estimated OIRF shows that most of these economic variables are generally stable in the GVAR system, with only a few notable exceptions. However, the effects represented by OIRF may differ between the time-invariant and time-varying models and at various time points in the time-varying GVAR models. Additionally, we form the OIRF to shocks from multiple variables by adding several responses of the same variable to the shocks from a variety of other economic variables. As a result, we can determine the change in a particular variable following shocks from more than one variable. The output suggests that a single variable often dominates the OIRF to multivariate shocks because of the stark disparity in magnitude between the OIRF to shocks from different variables.
More importantly, the findings of the impulse response can explain a wide range of realworld economic phenomena. In particular, these findings can shed light on the shifts in the relationship between various economies, internally and the global economy, in response to financial crises. For example, in the time-invariant GVAR model, we already know that in Europe, a rise in GDP brings a fall in HUR (the third subgraph of the second row of Figure 4(a)).With the assistance of Okun's Law, it is conceivable to see the connection between GDP and HUR theoretically. The principles established by this law state that for every established one percent gain in GDP, there is a matching two percent increase in employment. The basis for this law is relatively straightforward, which states that the principles of demand and supply determine GDP levels. Hence an increase in demand will increase GDP. Such an increase in demand necessitates an equal rise in productivity and employment to meet the demand. Regarding the time-variant model, we have revealed that when the global COVID-19 epidemic exceeds 10 million confirmed cases, HUR in Europe falls when international oil prices rise (the second subgraph of the last row of Figure 4(b)).
At the same time, it tends to increase on general occasions (the second subgraph of the last row of Figure 4(a)). Oil price increases typically result in higher pricing for services like production expenses, energy costs, and petroleum commodities. Therefore, the decrease in productivity will consequently impact interest rates, inflation rates, investments, product selling prices, consumption levels, HUR, and actual wage rates (Kisswani, 2017). That is, when oil prices rise, the increase will cause a reduction in employment. However, this relationship flipped at the time of the epidemic, and such change, in fact, also occurred in the two remaining economic crises (the second subgraph of the last row of Figure 4(c)(d)). Most crucially, traditional impulse response analysis is incapable of capturing this phenomenon because such significant economic upheavals should only be viewed momentarily and have a transient impact. Finally, in terms of the OIRF to shocks from more than one variable, the effect of crude oil prices on the European economy is considerably more significant than the impact itself during specific economic crises (Figure 5(c2)(d2)). It may be caused by the fact that Europe is highly reliant on oil for its economic development and that a global financial crisis can cause shortages of oil supplies and fluctuating oil prices. Thus, international crude oil prices have significantly impacted the European economy amid economic turmoil.
Our approach primarily provides an idea and a meant for out-of-sample prediction of time-varying GVAR, and designs a time-varying impulse response strategy. However, one caveat of our proposed model is that there is no strict theoretical guarantee, and the relatively strong assumptions about the stationary of the data need to be satisfied. Therefore, there is no guarantee that all pulses will converge (some pulses may diverge). Also, the LASSOtype technique does not provide optimal predictions for all economic variables. However, we provide a collection of verification screening strategies on the test set and the corresponding codes (https://github.com/kannyjyk/TVP-GVAR-ML). Finally, specific machine learning approaches make it possible to make more accurate predictions regarding the possible temporal structures.