跳到主要内容

Macro by Mark 的 Cookie.我们使用必要 Cookie 处理登录、语言和安全。经您同意,我们还会将可选 Cookie 用于保存偏好、分析,以及通过 Meta(Facebook)Pixel 衡量广告效果。请阅读我们的Cookie 政策。

Macro by MarkMacro by Mark
  • 首页
加载中…
加载中…
← 模型
Macro概念政策模型

Bayesian VAR (BVAR) Model

Bayesian shrinkage on a vector autoregression - Minnesota-style priors stabilize forecasts for medium-sized macro systems.

概述图表数学参考资料

Understand the mathematics

Follow the same equations and assumptions one section at a time or in a continuous reading.

Hover or focus a symbol defined in this model to find its exact matches. Select it to keep the highlight; Escape clears the selection.

Reduced-Form Specification and Prior Structure

Write the nnn-variable VAR(p)\text{VAR}(p)VAR(p) in stacked regression form. Let YYY be the T×nT \times nT×n matrix of observations, XXX the T×kT \times kT×k matrix of lagged regressors (k=np+1k = n p + 1k=np+1 including the intercept), and BBB the k×nk \times nk×n coefficient matrix. The model is Y=XB+UY = X B + UY=XB+U, where UUU is T×nT \times nT×n with rows ut′∼N(0,Σ)u_t' \sim N(0, \Sigma)ut′​∼N(0,Σ).

Vectorize: y=vec⁡(Y)y = \operatorname{vec}(Y)y=vec(Y) is Tn×1T n \times 1Tn×1, β=vec⁡(B)\beta = \operatorname{vec}(B)β=vec(B) is kn×1k n \times 1kn×1, and the likelihood is y∣β,Σ∼N((In⊗X)β,Σ⊗IT)y | \beta, \Sigma \sim N((I_n \otimes X) \beta, \Sigma \otimes I_T)y∣β,Σ∼N((In​⊗X)β,Σ⊗IT​). The prior on β\betaβ given Σ\SigmaΣ under the natural conjugate (normal-inverse-Wishart) setup is β∣Σ∼N(b0,Σ⊗Ω0)\beta | \Sigma \sim N(b_0, \Sigma \otimes \Omega_0)β∣Σ∼N(b0​,Σ⊗Ω0​), where b0b_0b0​ is the kn×1k n \times 1kn×1 prior mean and Ω0\Omega_0Ω0​ is a single k×kk \times kk×k prior covariance that the Kronecker structure forces on every equation, up to the Σ\SigmaΣ scaling. This is symmetric cross-shrinkage: the asymmetric Minnesota variance with λcross≠1\lambda_{\text{cross}} \neq 1λcross​=1 cannot be written in the Σ⊗Ω0\Sigma \otimes \Omega_0Σ⊗Ω0​ form.

The Minnesota prior sets specific entries in b0b_0b0​ and Ω0\Omega_0Ω0​. For variable jjj's equation, the prior mean on its own lll-th lag is δj⋅1{l=1}\delta_j \cdot \mathbb{1}\{l=1\}δj​⋅1{l=1} - δj\delta_jδj​ on the first lag only, zero on own lags l≥2l \geq 2l≥2 (δj=1\delta_j = 1δj​=1 for a random-walk variable, 0 for a stationary variable) - and the prior mean on variable kkk's lll-th lag (k≠j)(k \neq j)(k=j) is 0. The prior variance for the (j,k,l)(j, k, l)(j,k,l) coefficient is (λf(j,k)σj/(ldσk))2(\lambda f(j,k) \sigma_j / (l^d \sigma_k))^2(λf(j,k)σj​/(ldσk​))2, where f(j,k)=1f(j,k) = 1f(j,k)=1 if j=kj=kj=k and λcross\lambda_{\text{cross}}λcross​ if j≠kj \neq kj=k, and σj\sigma_jσj​ is the residual standard error from a univariate AR(p)\text{AR}(p)AR(p) for variable jjj.

Y=XB+U,ut∼N(0,Σ)\mathbf{Y} = \mathbf{X}\mathbf{B} + \mathbf{U}, \quad \mathbf{u}_t \sim N(\mathbf{0}, \boldsymbol{\Sigma})Y=XB+U,ut​∼N(0,Σ)
Σ\boldsymbol{\Sigma}Σ

Standard reduced-form VAR in matrix regression form.

y=(In⊗X)β+u,u∼N(0,Σ⊗IT)\mathbf{y} = (\mathbf{I}_n \otimes \mathbf{X})\boldsymbol{\beta} + \mathbf{u}, \quad \mathbf{u} \sim N(\mathbf{0}, \boldsymbol{\Sigma} \otimes \mathbf{I}_T)y=(In​⊗X)β+u,u∼N(0,Σ⊗IT​)
⊗\otimes⊗β\boldsymbol{\beta}βΣ\boldsymbol{\Sigma}Σ

Vectorized form enabling standard Bayesian normal-linear-model machinery.

β∣Σ∼N(b0,Σ⊗Ω0)\boldsymbol{\beta} | \boldsymbol{\Sigma} \sim N(\mathbf{b}_0, \boldsymbol{\Sigma} \otimes \boldsymbol{\Omega}_0)β∣Σ∼N(b0​,Σ⊗Ω0​)
β\boldsymbol{\beta}βΣ\boldsymbol{\Sigma}Σb0\mathbf{b}_0b0​⊗\otimes⊗

Natural conjugate prior. Conditioning on Σ\SigmaΣ makes the posterior tractable.

Var(βj,k,l)={(λld)2if j=k(λ⋅λcrossld⋅σjσk)2if j≠k\text{Var}(\beta_{j,k,l}) = \begin{cases} \left(\dfrac{\lambda}{l^d}\right)^2 & \text{if } j = k \\ \left(\dfrac{\lambda \cdot \lambda_{\text{cross}}}{l^d} \cdot \dfrac{\sigma_j}{\sigma_k}\right)^2 & \text{if } j \neq k \end{cases}Var(βj,k,l​)=⎩⎨⎧​(ldλ​)2(ldλ⋅λcross​​⋅σk​σj​​)2​if j=kif j=k​
λ\lambdaλdddλcross\lambda_{\text{cross}}λcross​

The Minnesota prior variance formula. Own lags get more prior variance (less shrinkage) than cross lags.

Stack the system

Convert the equation-by-equation VAR into a single matrix regression
y=(In⊗X)β+u\mathbf{y} = (\mathbf{I}_n \otimes \mathbf{X})\boldsymbol{\beta} + \mathbf{u}y=(In​⊗X)β+u
⊗\otimes⊗β\boldsymbol{\beta}β

Specify the conjugate prior

Normal-inverse-Wishart is conjugate for the multivariate linear regression model with Gaussian errors
β∣Σ∼N(b0,Σ⊗Ω0),Σ∼IW(S0,ν0)\boldsymbol{\beta}|\boldsymbol{\Sigma} \sim N(\mathbf{b}_0, \boldsymbol{\Sigma} \otimes \boldsymbol{\Omega}_0), \quad \boldsymbol{\Sigma} \sim IW(\mathbf{S}_0, \nu_0)β∣Σ∼N(b0​,Σ⊗Ω0​),Σ∼IW(S0​,ν0​)
β\boldsymbol{\beta}βΣ\boldsymbol{\Sigma}Σb0\mathbf{b}_0b0​⊗\otimes⊗

Run univariate AR(p)\text{AR}(p)AR(p) pre-regressions

The σj\sigma_jσj​ values in the Minnesota variance formula come from residual standard errors of univariate AR(p)\text{AR}(p)AR(p) models for each variable
yj,t=cj+∑l=1pϕj,lyj,t−l+ej,t,σ^j=1T−p−1∑te^j,t2y_{j,t} = c_j + \sum_{l=1}^{p} \phi_{j,l} y_{j,t-l} + e_{j,t}, \quad \hat{\sigma}_j = \sqrt{\frac{1}{T-p-1}\sum_t \hat{e}_{j,t}^2}yj,t​=cj​+l=1∑p​ϕj,l​yj,t−l​+ej,t​,σ^j​=T−p−11​t∑​e^j,t2​​

Construct the prior moments

Build b0b_0b0​ and Ω0\Omega_0Ω0​ from the Minnesota hyperparameters and the AR(p)\text{AR}(p)AR(p) residual standard errors
b0,(j,k,l)={1j=k,l=10otherwise,[Ω0](j,k,l),(j,k,l)=(λ⋅f(j,k)ld⋅σ^jσ^k)2b_{0,(j,k,l)} = \begin{cases} 1 & j=k, l=1 \\ 0 & \text{otherwise} \end{cases}, \quad [\boldsymbol{\Omega}_0]_{(j,k,l),(j,k,l)} = \left(\frac{\lambda \cdot f(j,k)}{l^d} \cdot \frac{\hat{\sigma}_j}{\hat{\sigma}_k}\right)^2b0,(j,k,l)​={10​j=k,l=1otherwise​,[Ω0​](j,k,l),(j,k,l)​=(ldλ⋅f(j,k)​⋅σ^k​σ^j​​)2
λ\lambdaλddd

Write the joint posterior kernel

Combine the likelihood and the prior to form the posterior up to a normalizing constant
p(β,Σ∣Y)∝∣Σ∣−T/2exp⁡(−12(y−Zβ)′(Σ−1⊗IT)(y−Zβ))⋅p(β∣Σ)⋅p(Σ)p(\boldsymbol{\beta}, \boldsymbol{\Sigma} | \mathbf{Y}) \propto |\boldsymbol{\Sigma}|^{-T/2} \exp\left(-\frac{1}{2}(\mathbf{y} - \mathbf{Z}\boldsymbol{\beta})'(\boldsymbol{\Sigma}^{-1} \otimes \mathbf{I}_T)(\mathbf{y} - \mathbf{Z}\boldsymbol{\beta})\right) \cdot p(\boldsymbol{\beta}|\boldsymbol{\Sigma}) \cdot p(\boldsymbol{\Sigma})p(β,Σ∣Y)∝∣Σ∣−T/2exp(−21​(y−Zβ)′(Σ−1⊗IT​)(y−Zβ))⋅p(β∣Σ)⋅p(Σ)
β\boldsymbol{\beta}βΣ\boldsymbol{\Sigma}Σ⊗\otimes⊗

Derive the conditional posterior for β\betaβ

Completing the square in β\betaβ yields a normal distribution
β∣Σ,Y∼N(bˉ,Σ⊗Ωˉ),Ωˉ=(Ω0−1+X′X)−1,bˉ=(Σ⊗Ωˉ)[(Σ⊗Ω0)−1b0+(Σ−1⊗X′)y]\boldsymbol{\beta}|\boldsymbol{\Sigma}, \mathbf{Y} \sim N(\bar{\mathbf{b}}, \boldsymbol{\Sigma} \otimes \bar{\boldsymbol{\Omega}}), \quad \bar{\boldsymbol{\Omega}} = (\boldsymbol{\Omega}_0^{-1} + \mathbf{X}'\mathbf{X})^{-1}, \quad \bar{\mathbf{b}} = (\boldsymbol{\Sigma} \otimes \bar{\boldsymbol{\Omega}})[(\boldsymbol{\Sigma} \otimes \boldsymbol{\Omega}_0)^{-1}\mathbf{b}_0 + (\boldsymbol{\Sigma}^{-1} \otimes \mathbf{X}')\mathbf{y}]β∣Σ,Y∼N(bˉ,Σ⊗Ωˉ),Ωˉ=(Ω0−1​+X′X)−1,bˉ=(Σ⊗Ωˉ)[(Σ⊗Ω0​)−1b0​+(Σ−1⊗X′)y]
β\boldsymbol{\beta}βΣ\boldsymbol{\Sigma}Σ⊗\otimes⊗Ωˉ\bar{\boldsymbol{\Omega}}Ωˉb0\mathbf{b}_0b0​

Interpret the posterior mean as a shrinkage estimator

The Bayesian posterior mean is a matrix-weighted average of the prior mean and the OLS estimate
B^Bayes=ΩˉΩ0−1B0+Ωˉ(X′X)B^OLS\hat{\mathbf{B}}_{\text{Bayes}} = \bar{\boldsymbol{\Omega}}\boldsymbol{\Omega}_0^{-1} \mathbf{B}_0 + \bar{\boldsymbol{\Omega}}(\mathbf{X}'\mathbf{X})\hat{\mathbf{B}}_{\text{OLS}}B^Bayes​=ΩˉΩ0−1​B0​+Ωˉ(X′X)B^OLS​
Ωˉ\bar{\boldsymbol{\Omega}}Ωˉ

Why conjugacy matters

The normal-inverse-Wishart prior is the only prior family for which the multivariate regression posterior is available in closed form. Any other prior - horseshoe, spike-and-slab, non-parametric - requires MCMC or variational approximation.

Notations

⊗\otimes⊗

Kronecker product

IW(S0,ν0)IW(S_0, \nu_0)IW(S0​,ν0​)

Inverse-Wishart prior

Ωˉ\bar{\boldsymbol{\Omega}}Ωˉ

Posterior coefficient covariance

About these symbols

Kronecker product: Kronecker product

Inverse-Wishart prior: Inverse-Wishart distribution with scale S0S_0S0​ and degrees of freedom ν0\nu_0ν0​

Posterior coefficient covariance: Posterior covariance for B (per equation), combining prior and data precision

    Transition checks

    Impact jump
    x0=Bε0,xh=AhBε0(h=1,2,…)x_0=B\varepsilon_0,\qquad x_h=A^hB\varepsilon_0\quad(h=1,2,\ldots)x0​=Bε0​,xh​=AhBε0​(h=1,2,…)

    In a linear state-space representation, B maps the innovation into the contemporaneous state. A delayed variable has a zero row in B and moves only after A propagates the shock. A jump is therefore a timing restriction, not a charting artifact.

    A nonzero point at h=0 means the shock changes the plotted variable on impact. It is not the end of a smooth pre-shock segment.

    Do not smooth through h=0 when the model says the shock enters contemporaneously.

    Decay or hump
    rh=aρhorrh=a he−λhρh,∣ρ∣<1r_h=a\rho^h\quad\text{or}\quad r_h=a\,h e^{-\lambda h}\rho^h,\qquad |\rho|<1rh​=aρhorrh​=ahe−λhρh,∣ρ∣<1
    λ\lambdaλ

    Stable eigenvalues shrink repeated applications of A. If a variable is reached through another state first, the response rises before the stable decay dominates, producing a hump-shaped path.

    Post-impact movement follows the model recursion. A hump means delayed propagation, not interpolation by the chart.

    Do not treat a hump as evidence of a linear ramp unless the model includes that ramp.

    Variable timing

    Innovation

    ε0≠0,εh=0 for h>0\varepsilon_0\ne 0,\qquad \varepsilon_h=0\ \text{for}\ h>0ε0​=0,εh​=0 for h>0

    The shock is dated at horizon zero. A response at h=0 is an impact effect, not the end of a hidden ramp.

    State vector

    xh=AhBε0x_h=A^hB\varepsilon_0xh​=AhBε0​

    A state can move on impact only through the relevant row of B; otherwise it moves after A propagates the shock.

    Reported response

    rh=CAhBε0+Dεhr_h=CA^hB\varepsilon_0+D\varepsilon_hrh​=CAhBε0​+Dεh​

    The plotted variable can jump directly through D or indirectly through the state vector.

    Keep going

    Read next

    Continue with a related concept, model, or example.

    Theory model

    IS-LM Model

    a well-connected theoretical model two steps from here

    New angle: theoretical model →
    Macro by Mark
    帮助
    隐私政策使用条款伦理与合规

    © 2026 Mark Jayson Nation LLC