Skip to contents

This function generates parameters of BVAR with Minnesota prior.

Usage

sim_mncoef(p, bayes_spec = set_bvar(), full = TRUE)

Arguments

p

VAR lag

bayes_spec

A BVAR model specification by set_bvar().

full

Generate variance matrix from IW (default: TRUE) or not (FALSE)?

Value

List with the following component.

coefficients

BVAR coefficient (MN)

covmat

BVAR variance (IW or diagonal matrix of sigma of bayes_spec)

Details

Implementing dummy observation constructions, Bańbura et al. (2010) sets Normal-IW prior. $$A \mid \Sigma_e \sim MN(A_0, \Omega_0, \Sigma_e)$$ $$\Sigma_e \sim IW(S_0, \alpha_0)$$ If full = FALSE, the result of \(\Sigma_e\) is the same as input (diag(sigma)).

References

Bańbura, M., Giannone, D., & Reichlin, L. (2010). Large Bayesian vector auto regressions. Journal of Applied Econometrics, 25(1).

Karlsson, S. (2013). Chapter 15 Forecasting with Bayesian Vector Autoregression. Handbook of Economic Forecasting, 2, 791-897.

Litterman, R. B. (1986). Forecasting with Bayesian Vector Autoregressions: Five Years of Experience. Journal of Business & Economic Statistics, 4(1), 25.

See also

  • set_bvar() to specify the hyperparameters of Minnesota prior.

Examples

# Generate (A, Sigma)
# BVAR(p = 2)
# sigma: 1, 1, 1
# lambda: .1
# delta: .1, .1, .1
# epsilon: 1e-04
set.seed(1)
sim_mncoef(
  p = 2,
  bayes_spec = set_bvar(
    sigma = rep(1, 3),
    lambda = .1,
    delta = rep(.1, 3),
    eps = 1e-04
  ),
  full = TRUE
)
#> $coefficients
#>              [,1]         [,2]         [,3]
#> [1,]  0.081071630  0.002721103  0.092414563
#> [2,]  0.049041658  0.062491732 -0.032011373
#> [3,] -0.018590620 -0.008312152  0.066508409
#> [4,]  0.008099504 -0.017944600  0.007603526
#> [5,] -0.039740346  0.001970018 -0.017502085
#> [6,]  0.004281752  0.014382071  0.007386941
#> 
#> $covmat
#>             [,1]        [,2]       [,3]
#> [1,]  0.41248285 -0.06400052 0.24882667
#> [2,] -0.06400052  0.14995663 0.01758338
#> [3,]  0.24882667  0.01758338 0.35941383
#>