This function prepares the priors. The Minnesota prior is used for the autoregressive parameters, and is determined by the overall tightness, cross-equation tightness, and the lag decay rate. For the steady-state parameters, a normal prior is used. Regarding the covariance matrix of the reduced-form innovations, for the homoscedastic model, the user can choose between Jeffreys prior or an uninformative inverse-Wishart prior. The user may also choose a stochastic volatility specification for the innovations, where the covariance matrix varies over time.
Usage
priors(
x,
lambda_1 = 0.2,
lambda_2 = 0.5,
lambda_3 = 1,
first_own_lag_prior_mean = NULL,
theta_Psi = NULL,
Omega_Psi = NULL,
Jeffreys = TRUE,
SV = FALSE,
SV_type = NULL,
SV_priors = NULL
)Arguments
- x
A steady-state
bvarobject that has been passed throughsetup.- lambda_1
Numeric. Overall tightness of the Minnesota prior. Default
0.2.- lambda_2
Numeric. Cross-equation tightness of the Minnesota prior. Default
0.5.- lambda_3
Numeric. Lag decay rate of the Minnesota prior. Default
1.- first_own_lag_prior_mean
Numeric vector of length
k. Prior means for the first own lags of the variables. IfNULL(default), a zero vector is used.- theta_Psi
Numeric vector. Prior mean vector for \(\text{vec}(\Psi)\), i.e. the steady-state parameters. If
NULL(default), the OLS estimates are used.- Omega_Psi
Numeric matrix. Prior covariance matrix for \(\text{vec}(\Psi)\), i.e. the steady-state parameters. Assumed to be diagonal. If
NULL(default), the identity matrix is used.- Jeffreys
Logical. If
TRUE(default), uses Jeffreys prior for the innovation covariance matrix. IfFALSE, uses an uninformative inverse-Wishart prior. Only considered ifSV=FALSE.- SV
Logical. If
TRUE, enables stochastic volatility specification. DefaultFALSE.- SV_type
Character. Type of stochastic volatility model. Must be either
"RW"or"AR1". Required ifSV = TRUE.- SV_priors
List. User-supplied stochastic volatility priors. Required when
SV = TRUE. The list must contain the following named elements depending onSV_type:For
"RW":theta_A,Omega_A,theta_log_lambda_1,Omega_log_lambda_1,alpha_phi,beta_phi.For
"AR1":theta_A,Omega_A,theta_gamma_0,Omega_gamma_0,theta_gamma_1,Omega_gamma_1,theta_log_lambda_1,Omega_log_lambda_1,V_Phi,m_Phi.
Value
The steady-state bvar object with an appended priors list containing:
- theta_beta
Prior mean vector for \(\text{vec}(\beta)\), i.e. the autoregressive parameters, constructed with the Minnesota prior
- Omega_beta
Prior covariance matrix for \(\text{vec}(\beta)\), i.e. the autoregressive parameters, constructed with the Minnesota prior
- theta_Psi
Prior mean vector for \(\text{vec}(\Psi)\), i.e. the steady-state parameters
- Omega_Psi
Prior covariance matrix for \(\text{vec}(\Psi)\), i.e. the steady-state parameters
- Jeffreys
Indicator for Jeffreys prior usage
- Sigma_AR
Residual variance estimates from univariate AR fits, which are used by the Minnesota prior
- m
Inverse-Wishart prior degrees of freedom (if
Jeffreys = FALSEandSV = FALSE)- V
Inverse-Wishart prior scale matrix (if
Jeffreys = FALSEandSV = FALSE)- SV
Logical indicator for stochastic volatility specification
- SV_type
Stochastic volatility specification type
- SV_priors
User-supplied SV prior list (if
SV = TRUE)
Details
The goal is to estimate the parameters \(\Theta = \begin{bmatrix} \beta & \Psi & \Sigma_u \end{bmatrix}\), and as such priors are needed. Following Villani (2009), prior independence between \(\beta, \Psi\) and \(\Sigma_u\) is assumed. For \(\beta\), which contains the autoregressive parameters, the Minnesota prior is used
$$\mathrm{vec}(\beta) \sim \mathrm{N}_{kpk} (\theta_\beta,\Omega_\beta)$$
The prior means (the elements of \(\theta_\beta\)) are specified according to
$$ \begin{aligned} \mathrm{E}\left(\Pi_{\ell}^{(i,j)}\right)&= \begin{cases}\kappa & \text{if } \ell = 1 \ \text{and} \ i = j \\0 & \text{otherwise}\end{cases}\\ \kappa&=\begin{cases}\kappa^{levels} & \text{if } \text{variable} \ i \ \text{is in levels} \\ \kappa^{\Delta} & \text{if } \text{variable} \ i \ \text{is differenced} \end{cases}\\ \end{aligned} $$
Here, the autoregressive coefficient \(\Pi_{\ell}^{(i,j)}\) is element \(\left(i,j\right)\) of \(\Pi_{\ell}\) for \(\ell=1,\dots,p\). As such, the Minnesota prior sets all prior means for the elements in \(\beta\) to \(0\), except for the elements that relate to the first own lags of the variables, which are set to \(\kappa\). If variable \(i\) is in levels (e.g. nominal interest rate), then \(\kappa=\kappa^{levels}\), and typical choices for \(\kappa^{levels}\) are \(1\) or \(0.9\). Evaluating the equations at their prior means, equation \(i\) becomes a random walk if \(\kappa^{levels}=1\) and a persistent stationary AR(1) process if \(\kappa^{levels}=0.9\). Since the steady state only exists if the process is stationary, \(0.9\) is recommended for the steady-state BVAR. If variable \(i\) is differenced (e.g. GDP growth), then \(\kappa=\kappa^{\Delta}\), and the most common choice for \(\kappa^{\Delta}\) is \(0\), i.e. equation \(i\) becomes (when evaluating it at its prior means) a random walk expressed in first differences (a white noise process). If a differenced variable still shows some degree of persistence (can be examined with an ACF plot), a suitable value for \(\kappa^{\Delta}\) can be (for example) \(0.6\) instead of \(0\). Moving on to the prior variances, \(\Omega_\beta\) is a diagonal matrix containing the prior variances for the elements in \(\beta\). They are specified as
$$\mathrm{Var}\left(\Pi_{\ell}^{(i,j)}\right)= \begin{cases}\left(\frac{\lambda_1}{\ell^{\lambda_3}}\right)^2 & \text{if } i = j \\ \left(\frac{\lambda_1 \lambda_2\sigma_i}{\ell^{\lambda_3}\sigma_j}\right)^2& \text{if } i \neq j \end{cases}$$
Here \(\lambda_1\), \(\lambda_2\), and \(\lambda_3\) are scalar hyperparameters known as the overall tightness, the cross-equation tightness and the lag decay rate. Furthermore, \(\sigma_i^2\) is the \((i,i)\):th element of \(\Sigma_u\), which is unknown and therefore needs to be replaced with an estimate. In this package, it is replaced by the least squares residual variance from a univariate autoregression for variable \(i\) with \(p\) lags (including the constant and dummy/trend variable if applicable). Moving on to \(\Psi\), the steady-state parameter matrix, the (steady-state) prior is
$$\mathrm{vec}(\Psi) \sim \mathrm{N}_{kq}(\theta_\Psi,\Omega_\Psi)$$
This is the core of the steady-state BVAR model. In \(\theta_\Psi\), one specifies the prior beliefs about the location of the steady state, and in \(\Omega_\Psi\), which is assumed to be a diagonal matrix, one specifies the degree of certainty in those prior beliefs. Too see how to specify steady-state priors in practice, please see the package vignettes. The prior for \(\Sigma_u\) is either the usual non-informative Jeffreys prior
$$p(\Sigma_u) \propto\left|\Sigma_u \right|^{-(k+1)/2}$$
or a proper uninformative inverse-Wishart prior
$$\Sigma_u \sim \mathrm{IW}(V,m)$$
where \(V\) is the scale matrix and \(m\) is the number of degrees of freedom.
An uninformative prior is specified by setting
\(V=(m-k-1)\hat{\Sigma}_u\) where \(\hat{\Sigma}_u\) is the least squares estimate
from the VAR(\(p\)) (including the constant and dummy/trend variable if applicable), and \(m=k+2\).
However, if we opt to use stochastic volatility, the innovation covariance matrix is time-varying \(\Sigma_{u,t}\),
instead of constant \(\Sigma_{u}\). Therefore, stochastic volatility priors are needed.
See bvar for more details on the stochastic volatility specifications. Please note that
\(\lambda\) below (volatilities) has nothing to do with the \(\lambda\) from the Minnesota prior (hyperparameters).
Now, for the Random Walk ("RW") stochastic volatility specification, the following priors are available
$$\begin{aligned}a &\sim \mathrm{N}(\theta_A, \Omega_A) \\ \ln \lambda_{1} &\sim \mathrm{N}(\theta_{\ln \lambda_{1}}, \Omega_{\ln \lambda_{1}}) \\ \phi_i &\sim \mathrm{IG}(\alpha_{\phi_i},\beta_{\phi_i})\end{aligned}$$
Here \(a\) is a \(k(k-1)/2\)-dimensional vector that collects the free parameters in \(A\) in row-major order,
and \(\ln \lambda_1\) is a \(k\)-dimensional vector containing the time \(t=1\) values (initial conditions) of \(\ln \lambda_{t}\).
We assume that \(\Omega_A\) and \(\Omega_{\ln \lambda_{1}}\) are diagonal matrices.
Furthermore, \(\phi_i\) for \(i=1,\dots,k\) are the log volatility innovation variances. For the AR(1) ("AR1") stochastic volatility specification, the following priors are available
$$\begin{aligned}a &\sim \mathrm{N}(\theta_A, \Omega_A) \\ \gamma_{0} &\sim \mathrm{N}(\theta_{\gamma_0}, \Omega_{\gamma_0}) \\ \gamma_{1} &\sim \mathrm{N}(\theta_{\gamma_1}, \Omega_{\gamma_1}) \ I(|\gamma_{1,i}| < 1)\\ \ln \lambda_{1} &\sim \mathrm{N}(\theta_{\ln \lambda_{1}}, \Omega_{\ln \lambda_{1}}) \\ \Phi &\sim \mathrm{IW}(V_{\Phi},m_{\Phi})\end{aligned}$$
Here \(a\) is again the \(k(k-1)/2\)-dimensional vector that collects the free parameters in \(A\) in row-major order, and \(\ln \lambda_1\) is a \(k\)-dimensional vector containing the time \(t=1\) values (initial conditions) of \(\ln \lambda_{t}\). Furthermore, \(\gamma_{0}\) is a \(k\)-dimensional vector of log volatility intercepts, \(\gamma_{1}\) is a \(k\)-dimensional vector of log volatility slopes, and \(\Phi\) is the \(k \times k\) log volatility innovation covariance matrix. We assume that \(\Omega_A\), \(\Omega_{\gamma_0}\), \(\Omega_{\gamma_1}\), and \(\Omega_{\ln \lambda_{1}}\) are diagonal matrices. Note that the prior for \(\gamma_1\) is truncated normal.
For details on the homoscedastic steady-state BVAR model, see Villani (2009). For details on the Random Walk stochastic volatility steady-state BVAR model, see Clark (2011). See Carriero, Clark, and Marcellino (2024) for the AR(1) stochastic volatility specification applied to a conventional BVAR.
To see examples of how to specify the priors, simply view the relevant vignette
References
Carriero, A., Clark, T. E., and Marcellino, M. (2024). Capturing macro-economic tail risks with Bayesian vector autoregressions. Journal of Money, Credit and Banking, 56(5), pp. 1099–1127.
Clark, T. E. (2011). Real-time density forecasts from Bayesian vector autoregressions with stochastic volatility. Journal of Business & Economic Statistics, 29(3), pp. 327–341.
Villani, M. (2009). Steady-state priors for vector autoregressions. Journal of Applied Econometrics, 24(4), pp. 630–650.
Examples
#homoscedastic with Jeffreys prior
yt <- matrix(rnorm(50), 25, 2)
bvar_obj <- bvar(data = yt)
bvar_obj <- setup(bvar_obj, p=1)
bvar_obj <- priors(bvar_obj,
lambda_1 = 0.2,
lambda_2 = 0.5,
lambda_3 = 1,
first_own_lag_prior_mean = rep(1,2),
theta_Psi = rep(0, 2),
Omega_Psi = diag(0.1, 2, 2),
Jeffreys = TRUE,
SV = FALSE,
SV_type = NULL,
SV_priors = NULL)
#RW stochastic volatility
yt <- matrix(rnorm(50), 25, 2)
bvar_obj <- bvar(data = yt)
bvar_obj <- setup(bvar_obj, p=1)
k <- bvar_obj$setup$k
n_free_params_A <- bvar_obj$setup$n_free_params_A
SV_priors_RW <- list(
theta_A = rep(0, n_free_params_A),
Omega_A = diag(1000, n_free_params_A),
theta_log_lambda_1 = rep(0, k),
Omega_log_lambda_1 = diag(1000, k),
alpha_phi = rep(5, k),
beta_phi = (rep(5, k) - 1) * rep(0.1, k)
)
bvar_obj <- priors(bvar_obj,
lambda_1 = 0.2,
lambda_2 = 0.5,
lambda_3 = 1,
first_own_lag_prior_mean = rep(1,2),
theta_Psi = rep(0, 2),
Omega_Psi = diag(0.1, 2, 2),
SV = TRUE,
SV_type = "RW",
SV_priors = SV_priors_RW)
#AR1 stochastic volatility
yt <- matrix(rnorm(50), 25, 2)
bvar_obj <- bvar(data = yt)
bvar_obj <- setup(bvar_obj, p=1)
k <- bvar_obj$setup$k
n_free_params_A <- bvar_obj$setup$n_free_params_A
SV_priors_AR1 <- list(
theta_A = rep(0, n_free_params_A),
Omega_A = diag(1000, n_free_params_A),
theta_gamma_0 = rep(0.1, k),
Omega_gamma_0 = diag(1000, k),
theta_gamma_1 = rep(0.9, k),
Omega_gamma_1 = diag(10, k),
theta_log_lambda_1 = rep(0.1, k)/(1-rep(0.9, k)),
Omega_log_lambda_1 = diag(1000, k),
V_Phi = (10 - k - 1) * diag(k),
m_Phi = 10
)
bvar_obj <- priors(bvar_obj,
lambda_1 = 0.2,
lambda_2 = 0.5,
lambda_3 = 1,
first_own_lag_prior_mean = rep(1,2),
theta_Psi = rep(0, 2),
Omega_Psi = diag(0.1, 2, 2),
SV = TRUE,
SV_type = "AR1",
SV_priors = SV_priors_AR1)