Skip to contents

Package

The bvhar package

bvhar bvhar-package
bvhar: Bayesian Vector Heterogeneous Autoregressive Modeling

Frequentist modeling

Vector autoregressive (VAR) and heterogeneous autoregressive (VHAR) models.

var_lm() print(<varlse>) logLik(<varlse>) AIC(<varlse>) BIC(<varlse>) is.varlse() is.bvharmod() knit_print(<varlse>)
Fitting Vector Autoregressive Model of Order p Model
vhar_lm() print(<vharlse>) logLik(<vharlse>) AIC(<vharlse>) BIC(<vharlse>) is.vharlse() knit_print(<vharlse>)
Fitting Vector Heterogeneous Autoregressive Model
VARtoVMA()
Convert VAR to VMA(infinite)
VHARtoVMA()
Convert VHAR to VMA(infinite)
summary(<varlse>) print(<summary.varlse>) knit_print(<summary.varlse>)
Summarizing Vector Autoregressive Model
summary(<vharlse>) print(<summary.vharlse>) knit_print(<summary.vharlse>)
Summarizing Vector HAR Model

Prior specification

Prior settings for Bayesian models.

set_bvar() set_bvar_flat() set_bvhar() set_weight_bvhar() print(<bvharspec>) is.bvharspec() knit_print(<bvharspec>)
Hyperparameters for Bayesian Models
set_ssvs() print(<ssvsinput>) is.ssvsinput() knit_print(<ssvsinput>)
Stochastic Search Variable Selection (SSVS) Hyperparameter for Coefficients Matrix and Cholesky Factor
set_lambda() set_psi() print(<bvharpriorspec>) is.bvharpriorspec() knit_print(<bvharpriorspec>)
Hyperpriors for Bayesian Models
set_horseshoe() print(<horseshoespec>) is.horseshoespec() knit_print(<horseshoespec>)
Horseshoe Prior Specification
set_ng() print(<ngspec>) is.ngspec() experimental
Normal-Gamma Hyperparameter for Coefficients and Contemporaneous Coefficients
set_dl() print(<dlspec>) is.dlspec() experimental
Dirichlet-Laplace Hyperparameter for Coefficients and Contemporaneous Coefficients
set_ldlt() set_sv() print(<covspec>) is.covspec() is.svspec() is.ldltspec() experimental
Covariance Matrix Prior Specification
set_intercept() print(<interceptspec>) is.interceptspec() knit_print(<interceptspec>)
Prior for Constant Term

Bayesian modeling

Bayesian VAR and Bayesian VHAR models.

Forecasting

Structural analysis

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

Tuning

compute_logml()
Extracting Log of Marginal Likelihood
choose_bvar() choose_bvhar() print(<bvharemp>) is.bvharemp() knit_print(<bvharemp>)
Finding the Set of Hyperparameters of Individual Bayesian Model
bound_bvhar() print(<boundbvharemp>) is.boundbvharemp() knit_print(<boundbvharemp>) experimental
Setting Empirical Bayes Optimization Bounds
choose_bayes() experimental
Finding the Set of Hyperparameters of Bayesian Model

Information criteria

FPE()
Final Prediction Error Criterion
HQ()
Hannan-Quinn Criterion
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
autoplot(<bvhardynsp>)
Dynamic Spillover Indices Plot

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_gig()
Generate Generalized Inverse Gaussian Distribution

Data

etf_vix
CBOE ETF Volatility Index Dataset

Other generic functions

stableroot()
Roots of characteristic polynomial
is.stable()
Stability of the process
coef(<varlse>) coef(<vharlse>) coef(<bvarmn>) coef(<bvarflat>) coef(<bvharmn>) coef(<bvharsp>) coef(<summary.bvharsp>)
Coefficient Matrix of Multivariate Time Series Models
residuals(<varlse>) residuals(<vharlse>) residuals(<bvarmn>) residuals(<bvarflat>) residuals(<bvharmn>)
Residual Matrix from Multivariate Time Series Models
fitted(<varlse>) fitted(<vharlse>) fitted(<bvarmn>) fitted(<bvarflat>) fitted(<bvharmn>)
Fitted Matrix from Multivariate Time Series Models