Initialization functions functions

BEAVARs.olsMethod
ols(Y,X)

Performs standard linear regression on two matrices Y and X, returning β as a vector, the vector of residuals ε and the variance σ_sq

source
BEAVARs.mlagMethod
mlag(Yfull::Matrix{Float64},p::Integer)

Creates lags of a matrix for a VAR representation with a constant on the right of X

Arguments

Yfull: a matrix of dimensions T+p x N returns a matrix Y with dimensions TxN and X with dimenions Tx(N*p+1)
p: number of lags
source
BEAVARs.trainPriorsMethod
trainPriors(Z0::Matrix{Float64},p::Int64)

Independent AR(p) regressions with constant to estimate prior values for further Bayesian estimation

For a training sample Z0 with n variables and p lags the function will do column-wise n linear regressions of order p and return a matrix

deltaP has the constant on the bottom and the lags (1) to (p) in rows [1:end-1,:]

source
percentile_mat(A, p; dims)