run_var(endo_matrix, exo_matrix, lag)
NULL
or a numeric matrix of exogenous data.varest
object with the VAR estimation result.
This function calls the vars::var
function to calculate the VAR model and applies restrictions if needed. We set the intercept to 1 for restricted equations because calculations go wrong otherwise (this is a bug in the vars library).
endo_matrix <- matrix(rnorm(120), ncol = 2, nrow = 60, dimnames = list(NULL, c("rumination", "activity"))) autovarCore:::run_var(endo_matrix, NULL, 1)VAR Estimation Results: ======================= Estimated coefficients for equation rumination: =============================================== Call: rumination = rumination.l1 + activity.l1 + const rumination.l1 activity.l1 const -0.32830441 -0.08774206 -0.07979602 Estimated coefficients for equation activity: ============================================= Call: activity = rumination.l1 + activity.l1 + const rumination.l1 activity.l1 const -0.01003013 0.07441381 0.14629520