Skip to contents

The bvhar package

bvhar bvhar-package
bvhar: Bayesian Vector Heterogeneous Autoregressive Modeling

VAR

Vector autoregressive model.

var_lm() print(<varlse>) knit_print(<varlse>)
Fitting Vector Autoregressive Model of Order p Model
VARtoVMA()
Convert VAR to VMA(infinite)

VHAR

Vector heterogeneous autoregressive model.

vhar_lm() print(<vharlse>) knit_print(<vharlse>)
Fitting Vector Heterogeneous Autoregressive Model
VHARtoVMA()
Convert VHAR to VMA(infinite)

Bayesian Model

set_bvar() set_bvar_flat() set_bvhar() set_weight_bvhar() print(<bvharspec>) knit_print(<bvharspec>)
Hyperparameters for Bayesian Models
init_ssvs() print(<ssvsinit>) knit_print(<ssvsinit>)
Initial Parameters of Stochastic Search Variable Selection (SSVS) Model
set_ssvs() print(<ssvsinput>) knit_print(<ssvsinput>)
Stochastic Search Variable Selection (SSVS) Hyperparameter for Coefficients Matrix and Cholesky Factor
set_lambda() set_psi() print(<bvharpriorspec>) knit_print(<bvharpriorspec>)
Hyperpriors for Bayesian Models
set_horseshoe() print(<horseshoespec>) knit_print(<horseshoespec>)
Horseshoe Prior Specification
set_sv() print(<svspec>)
Stochastic Volatility Specification
set_intercept() print(<interceptspec>) knit_print(<interceptspec>)
Prior for Constant Term

BVAR

Bayesian VAR model.

bvar_minnesota() print(<bvarmn>) knit_print(<bvarmn>)
Fitting Bayesian VAR(p) of Minnesota Prior
bvar_flat() print(<bvarflat>) knit_print(<bvarflat>)
Fitting Bayesian VAR(p) of Flat Prior
bvar_niwhm() print(<bvarhm>) knit_print(<bvarhm>)
Fitting Hierarchical Bayesian VAR(p)
bvar_sv() print(<bvarsv>) knit_print(<bvarsv>)
Fitting Bayesian VAR-SV
bvar_ssvs() print(<bvarssvs>) knit_print(<bvarssvs>)
Fitting Bayesian VAR(p) of SSVS Prior
bvar_horseshoe() print(<bvarhs>) knit_print(<bvarhs>)
Fitting Bayesian VAR(p) of Horseshoe Prior

BVHAR

Bayesian VHAR model.

bvhar_minnesota() print(<bvharmn>) knit_print(<bvharmn>)
Fitting Bayesian VHAR of Minnesota Prior
bvhar_sv() print(<bvharsv>) knit_print(<bvharsv>)
Fitting Bayesian VHAR-SV
bvhar_ssvs() print(<bvharssvs>) knit_print(<bvharssvs>)
Fitting Bayesian VHAR of SSVS Prior
bvhar_horseshoe() print(<bvharhs>) knit_print(<bvharhs>)
Fitting Bayesian VHAR of Horseshoe Prior

Summary method

Forecasting

Evaluation

mse()
Evaluate the Model Based on MSE (Mean Square Error)
mae()
Evaluate the Model Based on MAE (Mean Absolute Error)
mape()
Evaluate the Model Based on MAPE (Mean Absolute Percentage Error)
mase()
Evaluate the Model Based on MASE (Mean Absolute Scaled Error)
mrae()
Evaluate the Model Based on MRAE (Mean Relative Absolute Error)
relmae()
Evaluate the Model Based on RelMAE (Relative MAE)
rmsfe()
Evaluate the Model Based on RMSFE
rmafe()
Evaluate the Model Based on RMAFE
rmape()
Evaluate the Model Based on RMAPE (Relative MAPE)
rmase()
Evaluate the Model Based on RMASE (Relative MASE)
conf_fdr()
Evaluate the Sparsity Estimation Based on FDR
conf_fnr()
Evaluate the Sparsity Estimation Based on FNR
conf_fscore()
Evaluate the Sparsity Estimation Based on F1 Score
conf_prec()
Evaluate the Sparsity Estimation Based on Precision
conf_recall()
Evaluate the Sparsity Estimation Based on Recall
confusion()
Evaluate the Sparsity Estimation Based on Confusion Matrix
fromse()
Evaluate the Estimation Based on Frobenius Norm
spne()
Evaluate the Estimation Based on Spectral Norm Error
relspne()
Evaluate the Estimation Based on Relative Spectral Norm Error
lpl()
Evaluate the Model Based on Log Predictive Likelihood

Tuning

compute_logml()
Extracting Log of Marginal Likelihood
choose_bvar() choose_bvhar() print(<bvharemp>) knit_print(<bvharemp>)
Finding the Set of Hyperparameters of Individual Bayesian Model
bound_bvhar() print(<boundbvharemp>) knit_print(<boundbvharemp>)
Setting Empirical Bayes Optimization Bounds
choose_bayes()
Finding the Set of Hyperparameters of Bayesian Model
choose_ssvs()
Choose the Hyperparameters Set of SSVS-VAR using a Default Semiautomatic Approach

Information criteria

AIC(<varlse>) AIC(<vharlse>) AIC(<bvarmn>) AIC(<bvarflat>) AIC(<bvharmn>)
Akaike's Information Criterion of Multivariate Time Series Model
BIC(<varlse>) BIC(<vharlse>) BIC(<bvarmn>) BIC(<bvarflat>) BIC(<bvharmn>)
Bayesian Information Criterion of Multivariate Time Series Model
FPE()
Final Prediction Error Criterion
FPE(<varlse>) FPE(<vharlse>)
Final Prediction Error Criterion of Multivariate Time Series Model
HQ()
Hannan-Quinn Criterion
HQ(<varlse>) HQ(<vharlse>) HQ(<bvarmn>) HQ(<bvarflat>) HQ(<bvharmn>)
Hannan-Quinn Criterion of Multivariate Time Series Model
logLik(<varlse>) logLik(<vharlse>) logLik(<bvarmn>) logLik(<bvarflat>) logLik(<bvharmn>)
Extract Log-Likelihood of Multivariate Time Series Model
choose_var()
Choose the Best VAR based on Information Criteria
compute_dic()
Deviance Information Criterion of Multivariate Time Series Model

Plots

autoplot(<normaliw>)
Residual Plot for Minnesota Prior VAR Model
autoplot(<summary.normaliw>)
Density Plot for Minnesota Prior VAR Model
autoplot(<predbvhar>) autolayer(<predbvhar>)
Plot Forecast Result
geom_eval()
Adding Test Data Layer
gg_loss()
Compare Lists of Models
autoplot(<bvharirf>)
Plot Impulse Responses
autoplot(<bvharsp>)
Plot the Result of BVAR and BVHAR MCMC
autoplot(<summary.bvharsp>)
Plot the Heatmap of SSVS Coefficients

Simulation and Random Generation

sim_var()
Generate Multivariate Time Series Process Following VAR(p)
sim_vhar()
Generate Multivariate Time Series Process Following VAR(p)
sim_mncoef()
Generate Minnesota BVAR Parameters
sim_mnvhar_coef()
Generate Minnesota BVAR Parameters
sim_mnormal()
Generate Multivariate Normal Random Vector
sim_matgaussian()
Generate Matrix Normal Random Matrix
sim_iw()
Generate Inverse-Wishart Random Matrix
sim_mniw()
Generate Normal-IW Random Family
sim_mvt()
Generate Multivariate t Random Vector
sim_ssvs_var() sim_ssvs_vhar()
Generate SSVS Parameters
sim_horseshoe_var() sim_horseshoe_vhar()
Generate Horseshoe Parameters

Data

etf_vix
CBOE ETF Volatility Index Dataset
oxfordman_rv oxfordman_rk
Oxford-Man Institute Realized Library

Other generic functions