Create dummy observations from lambdas
bvar_conj_lambda2dummy(Y_in, Z_in = NULL, constant = TRUE, p = 4, lambda = c(0.2, 1, 1, 1, 100, 100), delta = 1, s2_lag = NULL, y_bar_type = c("initial", "all"), carriero_hack = FALSE)
Y_in | multivariate time series |
---|---|
Z_in | exogeneous variables |
constant | logical, default is TRUE, whether the constant should be included |
p | number of lags |
lambda | vector = (l_1, l_lag, l_sc, l_io, l_const, l_exo), the l_kron is set to 1 automatically for conjugate N-IW prior. Short summary valid for NO sc/io case: sd(const in eq i) = l_const * sigma_i sd(exo in eq i)= l_exo * sigma_i sd(coef for var j lag l in eq i) = l_1*sigma_i/sigma_j/l^l_lag lambdas may be Inf l_io or l_sc equal to NA means no corresponding dummy observations |
delta | vector [m x 1] or scalar or "AR1". Are used for prior Phi_1 and in sc/io dummy observations Scalar value is replicated m times. If set to "AR1" then deltas will be estimated as AR(1) coefficients (but not greater than one). Diagonal of Phi_1 is equal to delta. y_bar is multiplied by delta componentwise. All observations in Y_in are used to estimate AR(1) coefficient. By default delta is equal to 1. |
s2_lag | number of lags in AR() model used to estimate s2 (equal to p by default) Carriero uses 1 in his matlab code |
y_bar_type | (either "all" or "initial"). Determines how y_bar for sc and io dummy is calculated. "all": y_bar is mean of y for all observations, "initial": p initial observations Carriero: all, Sim-Zha: initial |
carriero_hack | logical, if TRUE sigma^2 will be estimated using biased estimator and supposed error with no square roots in dummy observations will be reproduced FALSE by default |
dummy list containing: X_cniw, Y_cniw X_sc, Y_sc X_io, Y_io X_plus, Y_plus binding all corresponging Xs and Ys
Create dummy observations from lambdas. Lambdas specification is based on Carriero "Bayesian VARs: Specification Choices and Forecast Accuracy" section 3.2.
data(Yraw) dummy <- bvar_conj_lambda2dummy(Yraw, p = 4, lambda = c(0.2, 1, 1, 1, 100, 100))