St: Calculate conditional posterior variance

Description Usage Arguments Details Value

View source: R/RcppExports.R

Description

This function computes the scale matrix for the Wishart conditional posterior in the Independent Normal-Wishart Bayesian VAR Model.

Usage

1
St(beta, prior_var, Y, Z)

Arguments

beta

the sampled mean for the N( β, V_{β}) distribution. It is updated for each run of the Gibbs sampler.

prior_var

the prior (k \times k) scale matrix for the model.

Y

a structure of class Ymat containing the dependent variable vector for each year.

Z

a structure of class Zmat containing the SUR representation of the lagged and exogenous regressors in a VAR.

Details

This function uses the following formula for updating the previous value:

\hat{Σ} = (V_{0} + ∑_{t=1}^{τ}(Y - Zβ)(Y - Zβ)^{T} )^{-1}

Where V_{0} is the prior Scale Matrix, Y is a column vector of dependent variables, and Z are the Seemingly Unrelated Regression (SUR) representation of the lagged dependent variables and external regressors.

This function is not meant to be used directly by the user. Instead, it is used by function Gibbs in its recursive estimation.

Value

An updated Bayesian estimate of the precision matrix of the Normal- Wishart prior used in the model.


gamalamboy/stresstest documentation built on May 17, 2019, 1:33 p.m.