Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

residuals

Extract Residuals of Bayesian GVAR


Description

Calculate residuals of the global model and the country models.

Usage

## S3 method for class 'bgvar'
residuals(object, ...)

## S3 method for class 'bgvar'
resid(object, ...)

Arguments

object

a fitted bgvar object.

...

other arguments.

Details

This function calculates residuals of the global and the country models based on a bgvar object. Country models' residuals are equivalent to output generated by the print.bgvar function in case no trimming has been used. If trimming was invoked to discard unstable draws output of both functions might differ since print.bgvar calculates residuals as a running mean to save storage which is based on the whole set of posterior draws (including discarded draws). In this case it is recommended to recalculate the residuals with residuals.bgvar and re-do the serial autocorrelation or average pairwise cross-correlation analysis using functions resid.corr.test and avg.pair.cc.

Value

returns a list with the following arguments

  • global is a (T-p) times K times draws/thin array containing the residuals of the global model.

  • country is a (T-p) times K times draws/thin array containing the residuals of the country models.

  • Data is a (T-p) times K matrix containing the data of the model.

Author(s)

Maximilian Boeck, Martin Feldkircher

See Also

bgvar for estimation of a bgvar object.

Examples

library(BGVAR)
data(eerDatasmall)
model.ng <- bgvar(Data=eerDatasmall,W=W.trade0012.small,plag=1,draws=100,burnin=100)
resid(model.ng)


resid(model.ng)

BGVAR

Bayesian Global Vector Autoregressions

v2.2.0
GPL-3
Authors
Maximilian Boeck [aut, cre] (<https://orcid.org/0000-0001-6024-8305>), Martin Feldkircher [aut] (<https://orcid.org/0000-0002-5511-9215>), Florian Huber [aut] (<https://orcid.org/0000-0002-2896-7921>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.