Determining Number of Factors in Dynamic Factor Models Contributing to GDP Nowcasting

Real-time nowcasting is a process to assess current-quarter GDP from timely released economic and financial series before the figure is disseminated in order to catch the overall macroeconomic conditions in real time. In economic data nowcasting, dynamic factor models (DFMs) are widely used due to their abilities to bridge information with different frequencies and to achieve dimension reduction. However, most of the research using DFMs assumes a fixed known number of factors contributing to GDP nowcasting. In this paper, we propose a Bayesian approach with the horseshoe shrinkage prior to determine the number of factors that have nowcasting power in GDP and to accurately estimate model parameters and latent factors simultaneously. The horseshoe prior is a powerful shrinkage prior in that it can shrink unimportant signals to 0 while keeping important ones remaining large and practically unshrunk. The validity of the method is demonstrated through simulation studies and an empirical study of nowcasting U.S. quarterly GDP growth rates using monthly data series in the U.S. market.


Introduction
Real-time nowcasting is a process to assess current-quarter GDP from timely released economic and financial series before the figure is disseminated in order to catch the overall macroeconomic conditions in real time. This is of interest because most data are released with a lag and are released subsequently. In theory, any release, no matter at what frequency, may affect current-quarter estimates and their precision potentially. Both forecasting and nowcasting are important tasks for central banks for policy decision-making; for example, monetary policies need to be made in real time and are based on assessments of current and future economic conditions. Additionally, estimated current-quarter GDP figures are often used as relevant inputs for model-based longer-term forecasting exercises in banks.
Real-time nowcasting faces some difficulties. The first one is how to bridge monthly data series with the quarterly GDP. Bafigi et al. [1], Rünstler and Sédillot [2], and Kitchen and Monaco [3] studied the idea of bridge equations which use small models to "bridge" the information contained in one or a few key monthly data with the quarterly growth rate of GDP. However, they involve judgmental nowcasts and only deal with a few monthly data series. The second difficulty is how to deal with a large number of monthly data series. For macroeconomic forecasting, factor models (FMs) are widely used at central banks and other institutions to achieve dimension reduction. Many authors, such as Boivin and Ng [4], Forni et al. [5], and D'Agostino and Giannone [6], have shown that these models are successful in this regard. However, they did not use FMs specifically for the problem of real-time nowcasting. There are other existing approaches to tackle the high dimensional issue. One example is Eraslan and Schröder [7] who dealt with this over-parameterized issue in GDP nowcasting by implementing the dynamic model averaging method (Raftery et al. [8]). However, they did not talk about how to handle the unbalanced structure of the data caused by different release dates with different lags in each month. Moreover, they assumed a fixed number of factors, while in our paper the focus is to determine the number of factors contributing to GDP nowcasting. The third challenge is that a large number of monthly data series are released with different lags, causing unbalanced data at the end of the sample. Some authors, including Croushore and Stark [9], Koenig et al. [10] and Orphanides [11], discussed about this issue, but they are not focusing on the statistical estimation.
Giannone et al. [12] provided a frequentist inference framework for the parametric dynamic factor models (DFMs). In their framework, they took advantage of different data releases throughout the month and updated the nowcast based on each new data release. The authors combined the idea of connecting monthly series with the nowcast of quarterly GDP and the idea of using data with different releases within a single statistical framework. Their model combines principal component analysis (PCA) with modified Kalman Filter (KF) to deal with the unbalanced feature of the data. Hereafter, we call the method proposed in Giannone et al. the GRS approach.
In this paper, we borrow the idea of DFMs from Giannone et al. [12] and propose a Bayesian Monte Carlo Markov Chain (MCMC) approach to deal with the real-time nowcasting problem. For DFMs, one important aspect is to determine the number of factors. In the GRS approach, the number of factors is assumed to be fixed, which is determined by looking at the cumulative proportions of variances explained by the first few principle components from PCA, and the same set of factors is assumed to have prediction power on GDP. Bai and Ng [13] showed that the number of factors could be estimated consistently in a large panel of data setting. In this paper, we impose a cap on the number of factors in the DFM structure but allow an unknown number of factors to contribute to GDP prediction. We propose to apply the horseshoe shrinkage (Carvalho et al. [14,15]) on the coefficients of factors in the prediction equation. One big advantage of the horseshoe shrinkage over other traditional shrinkages is that it can shrink unimportant signals to 0 while keeping important ones large and practically unshrunk (more details will be discussed in Section 2). After estimation, any coefficient that is shrunk to 0 indicates its corresponding factor has no prediction power. As a result, the number of coefficients that remain large after strong shrinkage is a good estimate of an unknown number of factors with prediction power on GDP. Our Bayesian MCMC approach can also provide a more natural way to deal with the unbalanced data structure due to real-time data releasing and estimate all parameters, including the number of contributing factors and latent dynamic factors in a single framework. We refer to this Bayesian approach as the BAY approach. Through simulation studies, we evaluate the abilities of our BAY approach in estimating an unknown number of contributing factors and in producing reliable nowcasts in real time. The validity of the BAY approach is also examined by applying it to nowcast U.S. quarterly GDP growth rates.
The rest of this paper is organized as follows. Section 2 sets up the model structure, introduces the horseshoe shrinkage into our model, and stylizes the data structure. In Section 3, we introduce the Bayesian MCMC estimation method with nowcasting equations. In Section 4, we conduct simulation studies. In Section 5, an empirical study of nowcasting U.S. GDP growth rates is presented. Section 6 concludes the paper. A list of abbreviations used in this paper is provided in Abbreviations.

Model Set-Ups, Horseshoe Shrinkage, and Data Structure
In Section 2.1, the model set-ups used in the BAY approach are illustrated. In Section 2.2, we introduce the horseshoe shrinkage idea and how to implement it in our BAY approach to estimate number of contributing factors. In Section 2.3, we formalize the unbalanced data structure.

Dynamic Factor Models
In this section, we introduce the Dynamic Factor Model structure and how it can reduce dimension and bridge our monthly released series with quarterly released GDP.
Since the number of monthly series is vast, modeling GDP on all available series can involve too many parameters; hence, the model would perform poorly in forecasting because of large uncertainty in the parameters' estimation. The fundamental idea of Giannone et al. [12] is to use DFMs to exploit the collinearity of the series by summarizing all the available information into a few common latent factors. Due to collinearity, a linear combination of the common factors is able to capture the dynamic interaction among the series and to provide a model that only requires a limited number of parameters and thus works well in forecasting. In this paper, our DFM is specified in the following ways.
First, assume that the monthly series are linear functions of a few unobserved common factors F t , where x t = (x 1,t , . . . , x n,t ) is the n × 1 monthly series vector at month t, for t = 1, 2, . . . , T, . . , f rt ) is the r × 1 common factor vector at month t, r is the number of latent factors (r << n) which is usually assumed to be known and fixed, Θ is the n × r factor loading, µ is the n × 1 mean vector, and the n × 1 error vector ε t ∼ N(0, Ω n×n ). Note that the difference between Equation (1) and regular multiple regression is that the factors F t are unobserved latent variables, while the predictors in multiple regression are observed. The latent factors F t serve an important role of bridging information from monthly series to quarterly GDP. Then, we further specify the dynamic of the common factors as a vector auto-regression: where A = diag(a 1 , a 2 , . . . , a r ) and u t ∼ N(0, Σ r×r ) with Σ = diag(σ 2 1 , σ 2 2 , . . . , σ 2 r ). It is known that factor dynamic models can suffer from non-identifiable issues. Following Stock and Watson [16], we construct two sets of restrictions: |a j | < 1 and These restrictions together with the prior distribution of Θ (specified later) satisfy the identification assumptions in Stock and Watson [16], and can identify factors up to a change of sign.
Finally, we assume that the nowcast of the GDP at quarter k is a linear function of the common factors at each month in the current quarter and the GDP from the previous quarter: where β 0 and β 4 are scalars, β i = (β i1 , . . . , β ir ) , i = 1, 2, 3, are r × 1 vectors and ν k ∼ N(0, η 2 ) for k = 1, . . . , K. Here, the number T (the end of monthly series) and the number K (the end of quarterly GDP series) satisfy 3K + 1 ≤ T ≤ 3K + 3. The DFMs specified this way can successfully bridge quarterly released GDP with monthly financial or economic series and achieve dimension reduction.

Horseshoe Shrinkage
In this section, the horseshoe shrinkage idea is introduced, and we discuss how it can be implemented in our model framework to estimate the number of contributing factors.
In Carvalho et al. [14], the horseshoe prior was first introduced as a shrinkage prior. Follett and Yu [17] shown that the horseshoe prior competes favorably with shrinkage schemes commonly used in Bayesian multivariate regression models. To illustrate the idea, let us first consider a simple mean model z j ind ∼ N(µ j , σ 2 ) for j = 1, . . . , R. We assume µ = (µ 1 , . . . , µ R ) is sparse and some µ j might be equal to 0. We can assign the horseshoe prior to µ j for j = 1, . . . , R by letting µ j |λ j , τ ind ∼ N(0, λ 2 j τ 2 ) with λ j iid ∼ Hal f Cauchy(0, 1). Here, τ is referred to as the global shrinkage prior and λ j is referred to as the local shrinkage prior. Figure 1 plots the densities for the horseshoe (setting τ = 1 for simplicity), Laplacian, and Student-t priors, respectively. As shown in Figure 1, compared to Laplacian or Student-t priors, the horseshoe has flat tails which allow strong signals that remain un-shrunk. It also has an "infinitely" tall spike at the center which can provide severe shrinkage for elements near zero. This feature makes the horseshoe prior a very useful shrinkage prior. Furthermore, it was showed in Carvalho et al. [14] that, for τ = σ 2 = 1, . When κ j = 0, E(µ j |z 1 , . . . , z R , λ j ) = z j , it indicates that the signal from data dominates; when κ j = 1, E(µ j |z 1 , . . . , z R , λ j ) = 0, it means that µ j is shrunk to 0. Thus, κ j is referred to as the Shrinkage Profile which measures the shrinkage level: The Half Cauchy prior on λ j implies a Beta(0.5, 0.5) prior on the Shrinkage Profile κ j . Figure 2 shows the implied prior on κ j for the horseshoe prior, the student's t prior, and the Laplacian prior. As shown in the figure, unlike the Laplacian prior and t prior, the density of κ j implied by the horseshoe prior is unbounded at both 0 and 1 with a small mass in between (a horseshoe shape). Being unbounded at 0 allows effects to grow large (little shrinkage) while being unbounded at 1 can shrink effects until they are fully removed from the equation.

The Unbalanced Structure of the Data
In this section, we provide descriptions of the unbalanced data structure and notations used to represent the unbalanced structure.
In real time, macroeconomic series are released with diverse lags. At a particular release date, some series have observations up through the current month, whereas for others, the most recent observations maybe come from previous months. Dealing with these kinds of unbalanced data is vital for nowcasting. Let x T = (x 1,T , . . . , x n,T ) be the n × 1 vector denoting n monthly data series at month T (the end of the sample), and y K be quarterly GDP at quarter K. Assume there are Q different release dates at each month. Each release date is denoted as (q, T), representing the qth release date in month T, where q = 1, . . . , Q. New series are released on each release date. Since some series for the current month may be released in the future, let T q denote the latest month in which the data are balanced. For t = T q + 1, . . . , T, the releasing set v q,t collects indexes of all x i,t s that have been released at or before the release date (q, T), and this set of available series is denoted as x i∈v q,t . Without loss of generality, for each month, we assume the release dates for all series are fixed. Table 1 gives a simple example of the data set available for nowcasting. In this example, there are n = 6 monthly series, x t = (x 1,t , . . . , x 6,t ), released at three (i.e., Q = 3) releasing dates. For month T, cells with gray color represent series that are available before T. Suppose (x 5,T−2 , x 6,T−2 ) are released at the first releasing date(1, T), (x 3,T−1 , x 4,T−1 ) are released at the second releasing date (2, T), and (x 1,T , x 2,T ) are released at the third releasing date (3, T). Thus, for the third releasing date (3, T), If we want to nowcast GDP in the current quarter y K+1 at the first release date in the second month of the quarter, so here T = 3K + 2. The series available to use at the release date (1, T) are highlighted in gray and orange color, i.e., {x 1 , . . . , x T−2 , x i∈v 1,T−1 }. The series available to use at the release date (2, T) are highlighted in gray, orange, and green, i.e., {x 1 , . . . , x T−2 , x i∈v 2,T−1 }. Table 1. An example of the overall releasing pattern. Gray colored cells represent available series before T. Orange, green, and blue represent the 1st, 2nd, and 3rd release within T, respectively.
The goal is to nowcast y K+1 with all available information including x t series and y k series at each releasing date (q, T) in month T. Here, T = 3K + 1, 3K + 2, 3K + 3, indicating the first month, second month, and third month nowcast. At every new release date (q, T), model parameters are updated with new information added from the new released series, and nowcast of y K+1 is re-produced. How to deal with this unbalanced data in our BAY approach will be discussed in details in Section 3.

Estimation Method and Nowcasting
In Section 3.1, we introduce the Bayesian MCMC algorithm to estimate model parameters and latent factors and to determine the number of contributing factors. In Section 3.2, nowcasting formulas are provided.

Estimating Dynamic Factor Models Using Bayesian MCMC
In this section, we first introduce our method of implementing the unbalanced data into our model framework naturally. Then, we finish our model specification by assigning priors in Bayesian Framework. Finally, the MCMC procedure is discussed in detail.
As discussed in Section 2, macroeconomic series are released with diverse lags in real time. Thus, a difficulty in real-time nowcasting is to deal with unbalanced data. In this section, we develop a computational Bayesian MCMC approach that can tackle this issue naturally.
To deal with the missing data in x i∈v q,t at the end of the sample, we introduce the n q × n indicator matrix 1 v q,t by deleting the ith row from the identity matrix 1 n×n if i / ∈ v q,t . For the example discussed in Section 2, at the third releasing date (3, T) in month T, v 3,T−1 = {1, 2, 3, 4}. Therefore, removing the fifth and sixth row of 1 6×6 gives us Similarly, for the index set v 3,T = {1, 2}, deleting the last four rows of 1 6×6 leads to Then, we can simply rewrite x i∈v q,t as x i∈v q,t = 1 v q,t x t . To better derive the posterior distributions, we express the dynamic of x t in Equation (1) as: where θ = vec(Θ) = (θ 1 , . . . , θ n ) , θ i is a 1 × R vector representing the ith row of Θ, i = 1, 2, . . . , n, and the symbol ⊗ denotes the Kronecker product. Thus, for the qth releasing date in month T, the conditional density for x t is the conditional density of F t is and the conditional density of y k is for k = 2, . . . , K. In this way, the unbalanced structure of the data is built into our model framework through this indicator matrix 1 v q,t . Let Φ = (µ, Θ, Ω, A, Σ, β, τ, S, η 2 ) denote all parameters to be estimated. Suppose we are at releasing date q in month T of quarter K + 1, our task is to use observations Y = {y 1 , . . . , y K } and X q,T = {x 1 , . . . , x T q , x i∈v q,Tq +1 , . . . , x i∈v q,T } to estimate parameters Φ and latent factors {F 1 , . . . , F T }, then conduct the nowcast for y K+1 .
The joint posterior distribution p(Φ, F|Y, X q,T ) can be written as a product of individual conditionals, can be derived according to Equations (7)-(9), respectively. π(Φ) is the prior distribution for the parameter set Φ.
We finish the model specification by assigning prior distributions in Bayesian framework. We set prior for µ as µ n×1 ∼ N(0, I). The prior for Θ is defined as Θ n×R ∼ Matrix Normal(0 n×R , I n×n , I R×R ). This prior on Θ, along with two restrictions we set in Section 2 (|a j | < 1 and , satisfy the identification assumptions in Stock and Watson [16]. The prior for Ω is defined as Ω ∼ Inverse Wishart( 1 n I n×n , ν θ ), where ν θ is a scalar and pre-specified to be n + 2 so that the expectation of Ω is n −1 I n×n . The prior for A is the standard normal truncated at [−1, 1], that is: where φ(·) and Φ(·) are PDF and CDF for standard normal distribution. Then, π(A) = ∏ R j=1 π(a j ). The priors for the diagonal elements of Σ are defined as σ 2 j iid ∼ Inverse Gamma(α s , β s ) for j = 1, . . . , R, where α s and β s are scalars and pre-specified to be 2 and R + 2, accordingly. Then, π(Σ) = ∏ R j=1 π(σ j ). The prior for β = (β 0 , β 1 , β 2 , β 3 , β 4 ) is β ∼ N(0 (3R+2)×1 , I (3R+2)×(3R+2) ). The prior for λ j is set to be λ j ∼ Hal f Cauchy(0, ν j λ ) for j = 1, . . . , R (τ is set to be 1). As discussed in Section 2.2, these prior specifications of β and λ j imply a horseshoe shrinkage on the coefficientsβ .j 's. The prior for η 2 is η 2 ∼ Inverse Gamma(α h , β h ), where α h and β h are scalars and pre-specified to be 4 and 0.01, accordingly, to provide a reasonable mean and variance of η 2 .
All priors are assumed to be independent. Based on the derived complete conditional posterior distributions for each parameter and latent variable, we obtain posterior samples using Metropolis-Hastings within Gibbs sampling since some conditional posterior distributions do not have closed forms. In estimation, we use the means of posterior samples as estimates for parameters and latent factors. Complete conditional posterior distributions for all model parameters and latent factors are provided in Appendix A.
• When T = 3K + 1, the nowcast of y K+1 using BAY is given by: • When T = 3K + 2, the nowcast of y K+1 using BAY is given by: • When T = 3K + 3, the nowcast of y K+1 using BAY is given by: Note that for some releasing dates, if v q,T = ∅, meaning that no monthly series are available at releasing date (q, T), then posterior samples F (g) T cannot be generated. As a solution, we useF T in nowcasting equations. All of the parameter and factor estimations are updated in every single release within a month. Then, y K+1 is re-produced for each release date.

Simulation Study
In this section, we will investigate three aspects of the Bayesian approach through numerical simulations. In Section 4.1, we evaluate whether it can successfully determine the true number of latent factors that can contribute to GDP nowcasting, i.e., the number of contributing factors. In Section 4.2, we study the accuracy of estimated latent factors F t . In Section 4.3, we examine out-of-sample nowcasting performances of the BAY approach.

Month T-3 T-2 T-1 T
Specifications of λ j (j = 1, . . . , R) for each of the simulation are shown in Table 3. For all six simulations, we assume only the first two factors majorly contribute to our nowcasting equations. Simulation 1 and Simulation 2 represent the group with high signals for the first two factors. Simulation 3 and Simulation 4 represent the group of moderate signals, while Simulation 5 and Simulation 6 are in the group of weak signals. Within each group, one of the simulations is configured with true sparsity, that is λ j = 0 for j = 3, . . . , 6, while for another simulation, we assign non-sparsity with small noise (λ j ∼ N(0, 0.1 2 ) for j = 3, . . . , 6) as a comparison. In this way, we can investigate how our method performs when changing magnitudes of the true signals from strong to weak, and when the non-true signals are contaminated with small noise or not.
For each simulation, we conduct one-step ahead nowcasts for the last 20 quarters using a moving window with a length of 10 years (40 quarters). For each quarter, nowcasting is made in each release date within each month. Thus, there are 20(quarters) × 3(months) × 3(release dates) = 180 nowcasts in each simulation. In our MCMC procedure, we discard the first 10,000 iterations as burn-in and run 1000 more for posterior summaries.

Estimating the Number of Contributing Factors
In this section, we validate our Bayesian Approach's ability in determining true number of contributing factors through six sets of simulation studies. The ability of the algorithm to determine the true number of contributing factors is investigated as follows. First, we check whether our approach can perform as expected when true signals of the first two factors are high, moderate, and low, and the non-true signals are exactly equal to 0. Secondly, we check if its performance will be undermined if we add some noise to the non-true signals.
For each simulation, every estimate of the shrinkage profilesκ j (j = 1, . . . , R) is calculated using the average of 1000 posterior draws after the burn-in period, that iŝ Figure 3 shows box-plots of estimated shrinkage profilesκ j (j = 1, . . . , R) based on 180 nowcast estimates in each simulation. In Simulation 1 and Simulation 2,κ 1 andκ 2 are near 0 whileκ 3 toκ 6 are generally close to 1, indicating that the algorithm can successfully detect high signals for the first two contributing factors and shrink the other four to zero. In Simulation 3 and Simulation 4, when we decrease signals of the first two factors from high to moderate, our algorithm can still detect signals of the first two and shrinkage signals of the last four to 0. However, if we only apply low signals for the first two factors, as shown in Simulation 5 and Simulation 6, the algorithm can only detect one contributing factor while shrinking all others to 0. When comparing results between right column (Simulation 2, 4, and 6 for true sparsity) and left column (Simulation 1, 3, and 5 for small noise), our algorithm can extremely shrink all four non-true factors (i.e., havingκ j ≈ 1) in all three scenarios with different strengths of true signals, disregarding whether the non-true factors are contaminated with noise or not. The findings in Figure 3 validate our algorithm's ability to detect the true number of contributing factors with moderate to high signals. Figure 4 shows a scatterplot of posterior meansκ ij 's (κ ij =κ j ) versusβ ij 's from 180 nowcast estimates. There are two general patterns observed across all six simulations. The first is that the estimated profileκ ij 's get closer to zero (little shrinkage) when the values ofβ ij 's increase horizontally to very large numbers, whileκ ij 's approach to one (strong shrinkage) whenβ ij 's become very small. The second pattern is that the dots are separated into two clear segmentations in each picture. The vertical distance between two groups is the largest for the strong signal cases (Simulation 1 and 2), then becomes smaller for the moderate signals (Simulation 3 and 4). However, for the last row (the weak signal cases), the distance almost diminishes. This is consistent with the findings in Figure 3.

Estimation of Latent Factors
We then investigate whether the BAY method can accurately estimate the latent factors F t . In our approach, latent variables F t are also estimated with posterior means, t , t = 1, . . . , T, and G = 1000 is the number of MCMC iterations after the burn-in period. Figure 5 plots the estimated first two latent factors from BAY approach, together with the true latent factors, in the first 100 months (in-sample period) of the data for six simulations. The absolute values are compared since the factors are identified up to a change of sign (Section 2.1). Figure 5 shows that, generally, the estimation from the BAY approach is close to the true factors, especially for the first four simulations in which the true number of contributing latent factors is successfully detected.

Out-of-Sample Nowcasting Performances
In this section, we prove that our Bayesian Apporach can provide exceptional out-ofsample nowcasting performances compared to the Random Walk.
Out-of-sample nowcasting performances are assessed based on 20 one-step-ahead nowcasting. For each simulation, whenever there are new series released in a month, the model parameters and latent factors will be updated. Therefore, there are 180 nowcasts in total. Figure 6 presents the nowcasting performances for all six simulations. In each panel (representing each simulation), the first, second, and third row represent nowcasting trends over 20 quarters in the first, second, and third month, respectively. In each subplot of each panel, the black curve represents the true GDP, while colored curves with different symbols represent nowcasts from different releases. Figure 6 shows that BAY approach can capture trends and changes in simulated GDP really well. For all six simulations, within the same month, there is no obvious difference in nowcasting performance between release 1 and release 2. However, nowcasting curves for release 3 are slightly closer to true curves than that of the other two releases. Moreover, we can see obvious improvements from nowcasts in the first month to nowcasts in the third month. In order to better understand nowcasting results, we use mean absolute nowcasting error (MANE) to measure nowcasting accuracy. Letŷ q,T K+1 be the nowcast at qth release date of month T, where q = 1, 2, 3 and T = 3K + 1, 3K + 2, 3K + 3. Then, MANE(q, T) = 1 20 ∑ 60 k+1=41 |ŷ q,T k+1 − y k+1 |. We compare the nowcasting performances of BAY with that of the random walk (RW) approach, which uses the previous quarter GDP to predict the current quarter GDP, by calculating MANE reduction relative to RW (i.e.,

MANE(q,T)−MANE rw MANE rw
). Table 4 provides MANE reductions (in percentage) for BAY approach compared with that of the RW. For instance, −30% indicates that BAY can reduce 30% of MANE of the RW. Table 4 shows that, moving from the first month to the third month, there are significant reductions in terms of MANE ratios. Within each month, there is no obvious difference in MANE ratios between release 1 and release 2, while release 3 can provide larger MANE reduction than the other two. The possible reason is that, in the releasing pattern of this simulation study, series of the current month are only released in the third release of each month.  In summary, this simulation study suggests that our BAY approach can successfully detect true number of contributing factors with moderate to high signals. It also has the ability to estimate latent dynamic factors accurately and produce reliable nowcasting results.

Empirical Study
In this section, we examine empirical performance of the BAY method using U.S. quarterly GDP growth rates. The Federal Reserve Bank of New York built a platform that has been nowcasting U.S. GDP growth rates since April 2016. The methodology behind the platform is based on the GRS method, and details can be found in Bok et al. [18]. We borrow their data from Github (https://github.com/FRBNY-TimeSeriesAnalysis/Nowcasting) in 20 April 2021. This data set contains 26 monthly series released by both government agencies and private institutions. Based on economic insights, those monthly series are assigned to nine different categories, such as labor, international trade, manufacturing, surveys, and others. All series are updated in real time; thus, the release dates for each one vary from month to month. Based on the approximate release dates for each individual series, we roughly group these series into three release dates: before 10th, from 10th to 20th, and after the 20th of a month. Table 5 provides the release pattern of the real data. The same transformations as in Bok et al. [18] are applied to monthly series to achieve stationarity. Detailed information of transformations and release patterns are available in Tables 6 and 7. Table 5. Data releasing structure in the empirical study when nowcasting quarter K + 1's GDP in month T. RL stands for release, with release 1 colored in orange, released 2 colored in green, and release 3 colored in blue. The number in parentheses represents number of series for that particular release.

Month-to-month change
We choose the data span from 1993Q1 to 2016Q4, which gives us data series with 288 months (96 quarters). In-sample data is chosen to be in the period from 1993Q1 to 2002Q4, while the nowcasting horizon covers 2003Q1 to 2016Q4. The GDP growth rate used in this empirical study is the annualized quarter over quarter percentage change, which is defined as: where GDP k is the real GDP of quarter k. Figure 7 plots the GDP growth rate with nowcasting horizon on the right side of the dashed blue line. In Figure 7, we see a severe drop at around 2009Q1 which is due to the financial crisis around 2007-2008. We apply our BAY approach to this real U.S. GDP data. In this empirical study, we assign the same prior settings as in the simulation study; the largest possible number of latent factors R is also assumed to be six as the first six principle components from PCA explain 99.9% of the variation observed in monthly series, and we still use G = 1000 iterations after 10,000 burn-in period in the MCMC sampling. Estimations of shrinkage profilesκ j are used to determine the number of contributing factors. Out of all 56(quarters) × 3(months) × 3(releases) = 504 estimates of shrinkage profiles, we find there are two main scenarios occurring. Figure 8 plots two examples for each of them, respectively. The left panel is the boxplot for posterior draws of shrinkage profileκ j 's when nowcasting 2000Q4 in the first release of the first month. This plot shows that the first factor is clearly detected to be different from the other five factors, although itsκ value is not small. The right panel is the boxplot forκ j 's when nowcasting 2000Q2 in the first release of the first month. This plot, however, shows that no factor contributes to the GDP nowcasting.  Table 8 shows proportions of all nowcasts in which one factor is detected. Generally speaking, more than 50% of cases have one factor detected to have contribution for GDP nowcasting. This is consistent with Bok et al. [18], where they assume one single common factor in their DFMs setting.  Figure 9 plots out-of-sample GDP nowcasts over last 56 quarters for each release in each month. Three rows represents three nowcasting months. In this plot, we compare our BAY approach with the autoregressive model of order 1 (AR(1)) y k = β 0 + β 4 y k−1 + ν k . The AR(1) is equivalent to the case where no factor is detected. Figure 9 shows that our BAY approach can successfully capture the economic downfall due to the financial crisis at 2009Q1 with one lag delay. However, the AR(1) failed to capture it. For the empirical study, we calculate MANE to measure nowcasting errors. Here, apart from AR(1), we also compare our BAY approach with another Bayesian model with no shrinkage priors, and we refer this model as NS. The NS model is proposed as the following: keep all other settings the same and remove S from Equation (5). More specifically, in the NS model, we impose Normal priors on theβ .j 's instead of horseshoe priors. Table 9 provides MANE reductions of BAY approach, relative to RW, AR(1), and NS. The first subtable reports the percentage of reduction in MANEs relative to RW accross three nowcasting months, while the middle sub-table reports the percentage of reduction in MANEs relative to AR(1), and the last sub-table reports the percentage of reduction in MANEs relative to NS. Table 9 shows that our BAY approach can produce smaller nowcasting errors than the RW approach. On average, the percentages of reduction relative to RW do not have an obvious difference from first month to third month. This indicates that, for real data, having more monthly series does not necessarily lead to better nowcasting performances. One potential reason is that the quality of the data might not be perfect. Adding more series means adding more noise and thus may not guarantee more accurate nowcasts of GDP. The MANE reduction relative to AR(1) are lower than those relative to RW. However, our BAY approach can still have approximately 11% reduction in nowcasting errors when being compared with the AR(1). This indicates that even if no factor is detected in nearly 50% of the cases, the ones with one factor detected indeed contribute and enhance our nowcasting performance. The MANE reduction relative to NS for the first two nowcasting months are comparable and are lower than those relative to AR(1), the MANE reduction for the third month is higher than those relative to AR(1). This result indicates that using the horseshoe shrinkage idea to shrink unimportant factors to 0 can further increase our model's nowcasting performance. In summary, this empirical analysis demonstrates the empirical relevance of the BAY approach in nowcasting U.S. GDP. It suggests that at most one factor is sufficient for our BAY approach to provide a good performance.

Conclusions
Real-time nowcasting has become important in making policy decisions and long-term forecasting. In this paper, we adopt the DFM model framework and introduce a Bayesian MCMC approach for real-time nowcasting. Unlike other nowcasting methods based on DFMs, our Bayesian approach allows an unknown number of contributing factors and utilizes the horseshoe shrinkage to determine the number of contributing factors. Through the simulation study, we have shown that our Bayesian approach can identify the number of contributing factors correctly with high to moderate signals and estimate latent factors accurately. Both simulation study and empirical study validate our Bayesian approach's ability to provide reliable real-time nowcasting results.
In this paper, we are not able to add the horseshoe shrinkage to Equation (1) due to the non-identifiable issue in DFMs. If we add S as ΘSF t in Equation (1), there will be two layers of non-identifiable issues, which is difficult to solve. Furthermore, in this paper, the horseshoe shrinkage is only used in detecting the number of contributing factors. In our DFMs framework, we assume the GDP of quarter k depends on factors with up to two lags, i.e., factors of 3k, 3k − 1, and 3k − 2 (see Equation (3)). We might argue that this lag should not be fixed and can also be determined using the horseshoe shrinkage. These are two possible research directions that we want to explore in future investigation.

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

Abbreviations
The following abbreviations are used in this manuscript:

Appendix A. Posterior Distributions
In this Appendix, complete conditional distributions for each parameter and latent factor are provided. An MCMC algorithm is applied to draw posterior samples. For most parameters, conditional posterior distributions have closed forms, which allows for Gibbs sampling method. However, Ω and λ j (j = 1, . . . , R) do not have closed-form posterior distributions, for which we use an independent Metropolis-Hastings within Gibbs sampler to generate posterior samples. (1 v q,t (1 v q,t Ω1 v q,t ) −1 1 v q,t ) + I n×n , (1 v q,t (1 v q,t Ω1 v q,t ) −1 1 v q,t )(x t − ΘF t ) .
Appendix A.2. Posterior Samples for Factor Loading Matrix Θ Let θ = vec(Θ) = (θ 1 , . . . , θ n ) . The conditional posterior for the θ is a multivariate normal distribution: θ|X, F, µ, Ω ∼ N(U θ , Σ θ ), let C t = I n×n ⊗ F t , then The posterior distribution for F t has different forms depending on t. Suppose K * is the largest integer such that 3K * ≤ T q , T q , as defined in Section 2. For 3 < t < 3K * , we have the most general form defined as follows: First, we write t as t = 3(k − 1) + i for k = 2, . . . , K * , where i = 1, 2, 3 represents that we are in the first, second, and third month of quarter k. Then, at t = 3(k − 1) + i, F t enters the joint likelihood through x t , F t+1 ,F t−1 and y k by where f y k (i) is a function of i defined as Therefore, By weighted regression, for 0 < t < 3K * , k = 2, . . . , K * and t = 3(k − 1) + i, draw For other t, the posterior distribution for F t is of the same form with some modifications onỸ,X, andΣ due to different availability. For example, if t = 1, since F 0 and y 0 are not available, corresponding entries to F t−1 and f y k (i) are deleted. For T q < t ≤ T, monthly series are unbalanced, change entries corresponding to 1 v q,t x t inỸ,X, andΣ.