compute_fitted_values.PosteriorBSVARSV: Computes posterior draws from data predictive density

View source: R/compute_fitted_values.R

compute_fitted_values.PosteriorBSVARSVR Documentation

Computes posterior draws from data predictive density

Description

Each of the draws from the posterior estimation of models from packages bsvars or bsvarSIGNs is transformed into a draw from the data predictive density.

Usage

## S3 method for class 'PosteriorBSVARSV'
compute_fitted_values(posterior)

Arguments

posterior

posterior estimation outcome - an object of class PosteriorBSVARSV obtained by running the estimate function.

Value

An object of class PosteriorFitted, that is, an NxTxS array with attribute PosteriorFitted containing S draws from the data predictive density.

Author(s)

Tomasz Woźniak wozniak.tom@pm.me

See Also

estimate, summary

Examples

specification  = specify_bsvar_sv$new(us_fiscal_lsuw)
burn_in        = estimate(specification, 5)
posterior      = estimate(burn_in, 5)

# compute draws from in-sample predictive density
csd     = compute_fitted_values(posterior)

# workflow with the pipe |>
############################################################
us_fiscal_lsuw |>
  specify_bsvar_sv$new() |>
  estimate(S = 5) |> 
  estimate(S = 5) |> 
  compute_fitted_values() -> csd
  

bsvars documentation built on Aug. 22, 2026, 5:09 p.m.