fitLambda: Fit the parameter lambda of the Bayesian VAR

Description Usage Arguments Details References See Also Examples

View source: R/fitLambda.R

Description

Fit the parameter lambda of the Bayesian VAR. This parameter controls the importance given to the priors. If lambda=0 the model is the same as the OLS case. For bigger values of lambda more importance is given to the priors and less importance to the data.

Usage

1
2
3
fitLambda(Y, variables = 1, lambdaseq = seq(0, 1, 0.1), p = 1,
  p.reduced = p, delta = 0, xreg = NULL, scale = TRUE, ps = FALSE,
  tau = 10 * lambdaseq)

Arguments

Y

Time-series matrix or data.frame with the VAR endogenous variables.

variables

Either a numeric vector indication the position of the variables to be included in the small model or a characted vector with the variable names.

lambdaseq

Sequence of lambdas to be tested.

p

Lag order (default = 1).

p.reduced

Lag order of the small model.

delta

Numeric vector indicating the prior for the autorregressive coefficients (default = 0 for all variables). If the prior is the same for all variables the user may supply a single number. Otherwise the vector must have one element for each variable.

xreg

Exogenous controls.

scale

If TRUE the variables are centered with variance equal 1 (default is TRUE).

ps

If TRUE the priors on the sum of the coefficients will be included.

tau

Controls the shrinkage in the priors on the sum of the coefficients.

Details

The choice of lambda is arbitrary. However, Banbura et al. (2010) uses the fit of a smaller model with just a few variables as a target to the Bayesian VAR. In other words, this function chooses the lambda that matches the fit of a smaller model chosen by the user on the chosen Bayesian VAR. If lambda = 0 the model ignores the data and the posterior equal the prior. For bigger lambda the model converges to the OLS estimates.

References

Banbura, M., Giannone, D., & Reichlin, L. (2010). Large Bayesian vector autoregressions. Journal of Applied Econometrics, 25, 71–92.

Garcia, Medeiros and Vasconcelos (2017).

See Also

lbvar

Examples

1
2
3
4
5
6
7
8
## == This example uses the Brazilian inflation data from
#Garcia, Medeiros and Vasconcelos (2017) == ##
data("BRinf")
Y=BRinf[,1:59]# remove expectation variables
lambda=fitLambda(Y,variables=c(1,4,10),
                lambdaseq = seq(0,0.1,0.005),
                p=2,p.reduced = 2)
model=lbvar(Y,p=2,lambda=lambda)

tboonman/eba_lasso_bma documentation built on Nov. 5, 2019, 10:01 a.m.