Package: bvhar 2.1.2

Young Geun Kim

bvhar: Bayesian Vector Heterogeneous Autoregressive Modeling

Tools to model and forecast multivariate time series including Bayesian Vector heterogeneous autoregressive (VHAR) model by Kim & Baek (2023) (<doi:10.1080/00949655.2023.2281644>). 'bvhar' can model Vector Autoregressive (VAR), VHAR, Bayesian VAR (BVAR), and Bayesian VHAR (BVHAR) models.

Authors:Young Geun Kim [aut, cre, cph], Changryong Baek [ctb]

bvhar_2.1.2.tar.gz
bvhar_2.1.2.tar.gz(r-4.5-noble)bvhar_2.1.2.tar.gz(r-4.4-noble)
bvhar_2.1.2.tgz(r-4.4-emscripten)bvhar_2.1.2.tgz(r-4.3-emscripten)
bvhar.pdf |bvhar.html
bvhar/json (API)
NEWS

# Install 'bvhar' in R:
install.packages('bvhar', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ygeunkim/bvhar/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • etf_vix - CBOE ETF Volatility Index Dataset

4.86 score 1 stars 27 scripts 437 downloads 107 exports 55 dependencies

Last updated 1 months agofrom:eb59ae74bc. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKNov 11 2024
R-4.5-linux-x86_64OKNov 11 2024

Exports:%>%autolayerautoplotbound_bvharbvar_flatbvar_horseshoebvar_minnesotabvar_ssvsbvar_svbvhar_horseshoebvhar_minnesotabvhar_ssvsbvhar_svchoose_bayeschoose_bvarchoose_bvharchoose_ssvschoose_varcompute_diccompute_logmlconf_fdrconf_fnrconf_fscoreconf_precconf_recallconfusiondivide_tsdynamic_spilloverforecast_expandforecast_rollFPEfromsegeom_evalgg_lossHQinit_ssvsirfis.boundbvharempis.bvarflatis.bvarmnis.bvharcvis.bvharempis.bvharirfis.bvharmnis.bvharmodis.bvharpriorspecis.bvharspecis.covspecis.dlspecis.horseshoespecis.interceptspecis.ldltspecis.ngspecis.predbvharis.ssvsinitis.ssvsinputis.stableis.svspecis.varlseis.vharlsemaemapemasemraemserelmaerelspnermafermapermasermsfeset_bvarset_bvar_flatset_bvharset_dlset_horseshoeset_interceptset_lambdaset_ldltset_ngset_psiset_ssvsset_svset_weight_bvharsim_gigsim_horseshoe_varsim_horseshoe_vharsim_iwsim_matgaussiansim_mncoefsim_mniwsim_mnormalsim_mnvhar_coefsim_mvtsim_ssvs_varsim_ssvs_vharsim_varsim_vharspilloverspnestablerootvar_bayesvar_lmVARtoVMAvhar_bayesvhar_lmVHARtoVMA

Dependencies:abindbackportsbayesplotBHcheckmateclicodetoolscolorspacecpp11distributionaldplyrfansifarverforeachgenericsggplot2ggridgesgluegtableisobanditeratorslabelinglatticelifecyclemagrittrMASSMatrixmatrixStatsmgcvmunsellnlmenumDerivoptimParallelpillarpkgconfigplyrposteriorpurrrR6RColorBrewerRcppRcppEigenreshape2rlangscalesstringistringrtensorAtibbletidyrtidyselectutf8vctrsviridisLitewithr

Bayesian VAR and VHAR Models

Rendered fromshrinkage.Rmdusingknitr::rmarkdownon Nov 11 2024.

Last update: 2024-09-17
Started: 2023-12-19

Cpp source usage

Rendered fromlinking.Rmdusingknitr::rmarkdownon Nov 11 2024.

Last update: 2024-10-11
Started: 2024-02-15

Forecasting

Rendered fromforecasting.Rmdusingknitr::rmarkdownon Nov 11 2024.

Last update: 2024-09-17
Started: 2023-11-08

Introduction to bvhar

Rendered frombvhar.Rmdusingknitr::rmarkdownon Nov 11 2024.

Last update: 2024-09-17
Started: 2023-11-08

Minnesota Prior

Rendered fromminnesota.Rmdusingknitr::rmarkdownon Nov 11 2024.

Last update: 2024-09-17
Started: 2023-11-08

Stochastic Volatility Models

Rendered fromstochastic-volatility.Rmdusingknitr::rmarkdownon Nov 11 2024.

Last update: 2024-09-17
Started: 2024-09-17

Readme and manuals

Help Manual

Help pageTopics
Dynamic Spillover Indices Plotautoplot.bvhardynsp
Plot Impulse Responsesautoplot.bvharirf
Plot the Result of BVAR and BVHAR MCMCautoplot.bvharsp
Residual Plot for Minnesota Prior VAR Modelautoplot.normaliw
Plot Forecast Resultautolayer.predbvhar autoplot.predbvhar
Plot the Heatmap of SSVS Coefficientsautoplot.summary.bvharsp
Density Plot for Minnesota Prior VAR Modelautoplot.summary.normaliw
Setting Empirical Bayes Optimization Boundsbound_bvhar is.boundbvharemp knit_print.boundbvharemp print.boundbvharemp
Fitting Bayesian VAR(p) of Flat PriorAIC.bvarflat BIC.bvarflat bvar_flat is.bvarflat knit_print.bvarflat logLik.bvarflat print.bvarflat
Fitting Bayesian VAR(p) of Horseshoe Priorbvar_horseshoe knit_print.bvarhs print.bvarhs
Fitting Bayesian VAR(p) of Minnesota PriorAIC.bvarmn BIC.bvarmn bvar_minnesota is.bvarmn knit_print.bvarhm knit_print.bvarmn logLik.bvarmn print.bvarhm print.bvarmn
Fitting Bayesian VAR(p) of SSVS Priorbvar_ssvs knit_print.bvarssvs print.bvarssvs
Fitting Bayesian VAR-SVbvar_sv knit_print.bvarsv print.bvarsv
Fitting Bayesian VHAR of Horseshoe Priorbvhar_horseshoe knit_print.bvharhs print.bvharhs
Fitting Bayesian VHAR of Minnesota PriorAIC.bvharmn BIC.bvharmn bvhar_minnesota is.bvharmn knit_print.bvharhm knit_print.bvharmn logLik.bvharmn print.bvharhm print.bvharmn
Fitting Bayesian VHAR of SSVS Priorbvhar_ssvs knit_print.bvharssvs print.bvharssvs
Fitting Bayesian VHAR-SVbvhar_sv knit_print.bvharsv print.bvharsv
Finding the Set of Hyperparameters of Bayesian Modelchoose_bayes
Finding the Set of Hyperparameters of Individual Bayesian Modelchoose_bvar choose_bvhar is.bvharemp knit_print.bvharemp print.bvharemp
Choose the Hyperparameters Set of SSVS-VAR using a Default Semiautomatic Approachchoose_ssvs
Choose the Best VAR based on Information Criteriachoose_var
Coefficient Matrix of Multivariate Time Series Modelscoef coef.bvarflat coef.bvarmn coef.bvharmn coef.bvharsp coef.summary.bvharsp coef.varlse coef.vharlse
Deviance Information Criterion of Multivariate Time Series Modelcompute_dic compute_dic.bvarmn
Extracting Log of Marginal Likelihoodcompute_logml compute_logml.bvarmn compute_logml.bvharmn
Evaluate the Sparsity Estimation Based on FDRconf_fdr conf_fdr.summary.bvharsp
Evaluate the Sparsity Estimation Based on FNRconf_fnr conf_fnr.summary.bvharsp
Evaluate the Sparsity Estimation Based on F1 Scoreconf_fscore conf_fscore.summary.bvharsp
Evaluate the Sparsity Estimation Based on Precisionconf_prec conf_prec.summary.bvharsp
Evaluate the Sparsity Estimation Based on Recallconf_recall conf_recall.summary.bvharsp
Evaluate the Sparsity Estimation Based on Confusion Matrixconfusion confusion.summary.bvharsp
Split a Time Series Dataset into Train-Test Setdivide_ts
Dynamic Spilloverdynamic_spillover dynamic_spillover.ldltmod dynamic_spillover.normaliw dynamic_spillover.olsmod dynamic_spillover.svmod knit_print.bvhardynsp print.bvhardynsp
CBOE ETF Volatility Index Datasetetf_vix
Fitted Matrix from Multivariate Time Series Modelsfitted fitted.bvarflat fitted.bvarmn fitted.bvharmn fitted.varlse fitted.vharlse
Out-of-sample Forecasting based on Expanding Windowforecast_expand forecast_expand.ldltmod forecast_expand.normaliw forecast_expand.olsmod forecast_expand.svmod
Out-of-sample Forecasting based on Rolling Windowforecast_roll forecast_roll.ldltmod forecast_roll.normaliw forecast_roll.olsmod forecast_roll.svmod is.bvharcv knit_print.bvharcv print.bvharcv
Final Prediction Error CriterionFPE FPE.varlse FPE.vharlse
Evaluate the Estimation Based on Frobenius Normfromse fromse.bvharsp
Adding Test Data Layergeom_eval
Compare Lists of Modelsgg_loss
Hannan-Quinn CriterionHQ HQ.bvarflat HQ.bvarmn HQ.bvharmn HQ.logLik HQ.varlse HQ.vharlse
Initial Parameters of Stochastic Search Variable Selection (SSVS) Modelinit_ssvs is.ssvsinit knit_print.ssvsinit print.ssvsinit
Impulse Response Analysisirf irf.varlse irf.vharlse is.bvharirf knit_print.bvharirf print.bvharirf
Stability of the processis.stable is.stable.bvarflat is.stable.bvarmn is.stable.bvharmn is.stable.varlse is.stable.vharlse
Evaluate the Model Based on MAE (Mean Absolute Error)mae mae.bvharcv mae.predbvhar
Evaluate the Model Based on MAPE (Mean Absolute Percentage Error)mape mape.bvharcv mape.predbvhar
Evaluate the Model Based on MASE (Mean Absolute Scaled Error)mase mase.bvharcv mase.predbvhar
Evaluate the Model Based on MRAE (Mean Relative Absolute Error)mrae mrae.bvharcv mrae.predbvhar
Evaluate the Model Based on MSE (Mean Square Error)mse mse.bvharcv mse.predbvhar
Forecasting Multivariate Time Seriesis.predbvhar knit_print.predbvhar predict predict.bvarflat predict.bvarhs predict.bvarldlt predict.bvarmn predict.bvarssvs predict.bvarsv predict.bvharhs predict.bvharldlt predict.bvharmn predict.bvharssvs predict.bvharsv predict.varlse predict.vharlse print.predbvhar
Summarizing BVAR and BVHAR with Shrinkage Priorsknit_print.summary.bvharsp print.summary.bvharsp summary.bvharsp summary.hsmod summary.ngmod summary.ssvsmod
Evaluate the Model Based on RelMAE (Relative MAE)relmae relmae.bvharcv relmae.predbvhar
Evaluate the Estimation Based on Relative Spectral Norm Errorrelspne relspne.bvharsp
Residual Matrix from Multivariate Time Series Modelsresiduals residuals.bvarflat residuals.bvarmn residuals.bvharmn residuals.varlse residuals.vharlse
Evaluate the Model Based on RMAFErmafe rmafe.bvharcv rmafe.predbvhar
Evaluate the Model Based on RMAPE (Relative MAPE)rmape rmape.bvharcv rmape.predbvhar
Evaluate the Model Based on RMASE (Relative MASE)rmase rmase.bvharcv rmase.predbvhar
Evaluate the Model Based on RMSFErmsfe rmsfe.bvharcv rmsfe.predbvhar
Hyperparameters for Bayesian Modelsis.bvharspec knit_print.bvharspec print.bvharspec set_bvar set_bvar_flat set_bvhar set_weight_bvhar
Dirichlet-Laplace Hyperparameter for Coefficients and Contemporaneous Coefficientsis.dlspec print.dlspec set_dl
Horseshoe Prior Specificationis.horseshoespec knit_print.horseshoespec print.horseshoespec set_horseshoe
Prior for Constant Termis.interceptspec knit_print.interceptspec print.interceptspec set_intercept
Hyperpriors for Bayesian Modelsis.bvharpriorspec knit_print.bvharpriorspec print.bvharpriorspec set_lambda set_psi
Covariance Matrix Prior Specificationis.covspec is.ldltspec is.svspec print.covspec set_ldlt set_sv
Normal-Gamma Hyperparameter for Coefficients and Contemporaneous Coefficientsis.ngspec print.ngspec set_ng
Stochastic Search Variable Selection (SSVS) Hyperparameter for Coefficients Matrix and Cholesky Factoris.ssvsinput knit_print.ssvsinput print.ssvsinput set_ssvs
Generate Generalized Inverse Gaussian Distributionsim_gig
Generate Horseshoe Parameterssim_horseshoe_var sim_horseshoe_vhar
Generate Inverse-Wishart Random Matrixsim_iw
Generate Matrix Normal Random Matrixsim_matgaussian
Generate Minnesota BVAR Parameterssim_mncoef
Generate Normal-IW Random Familysim_mniw
Generate Multivariate Normal Random Vectorsim_mnormal
Generate Minnesota BVAR Parameterssim_mnvhar_coef
Generate Multivariate t Random Vectorsim_mvt
Generate SSVS Parameterssim_ssvs_var sim_ssvs_vhar
Generate Multivariate Time Series Process Following VAR(p)sim_var
Generate Multivariate Time Series Process Following VAR(p)sim_vhar
h-step ahead Normalized Spilloverknit_print.bvharspillover print.bvharspillover spillover spillover.bvarldlt spillover.bvharldlt spillover.normaliw spillover.olsmod
Evaluate the Estimation Based on Spectral Norm Errorspne spne.bvharsp
Roots of characteristic polynomialstableroot stableroot.bvarflat stableroot.bvarmn stableroot.bvharmn stableroot.varlse stableroot.vharlse
Summarizing Bayesian Multivariate Time Series Modelknit_print.summary.normaliw print.summary.normaliw summary.normaliw
Summarizing Vector Autoregressive Modelknit_print.summary.varlse print.summary.varlse summary.varlse
Summarizing Vector HAR Modelknit_print.summary.vharlse print.summary.vharlse summary.vharlse
Fitting Bayesian VAR with Coefficient and Covariance Priorknit_print.bvarldlt print.bvarldlt var_bayes
Fitting Vector Autoregressive Model of Order p ModelAIC.varlse BIC.varlse is.bvharmod is.varlse knit_print.varlse logLik.varlse print.varlse var_lm
Convert VAR to VMA(infinite)VARtoVMA
Fitting Bayesian VHAR with Coefficient and Covariance Priorknit_print.bvharldlt print.bvharldlt vhar_bayes
Fitting Vector Heterogeneous Autoregressive ModelAIC.vharlse BIC.vharlse is.vharlse knit_print.vharlse logLik.vharlse print.vharlse vhar_lm
Convert VHAR to VMA(infinite)VHARtoVMA