# Cholesky Decomposition in R package “vars”

I'd like to know if, when running a VAR model in R (package "vars"), the cholesky decomposition matrix is upper triangular (so I should order my variables from more endogenous to less endogenous), or lower triangular (so I should order my variables from less endogenous to more endogenous).

$$(I_K − A_1 − \dots − A_p)Q$$
where $$Q$$ assigns the lower-triangular Cholesky decomposition.
In the theoretical literature, Cholesky factorization is traditionally defined as lower-triangular; that is, as $$A = L L^{T}$$. There is a function is base R, chol(), that returns the upper-triangular Cholesky decomposition of a matrix $$X = R^{T}R$$.