run_var.Rd
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).
run_var(endo_matrix, exo_matrix, lag)
endo_matrix | A numeric matrix of endogenous data. |
---|---|
exo_matrix | Either |
lag | A nonnegative integer specifying the lag length of the model. Specifying 0 for the lag results in calculating a lag 1 model with all lag-1 terms restricted. |
A varest
object with the VAR estimation result.
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.2228954 0.1306920 -0.0332642 #> #> #> Estimated coefficients for equation activity: #> ============================================= #> Call: #> activity = rumination.l1 + activity.l1 + const #> #> rumination.l1 activity.l1 const #> -0.06740661 -0.22231376 0.10066133 #> #>