Skip to content

bmgarch

2.1.0Package record

Bayesian Multivariate GARCH Models

0packages depend
5.4Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

Fit Bayesian multivariate GARCH models using 'Stan' for full Bayesian inference. Generate (weighted) forecasts for means, variances (volatility) and correlations. Currently DCC(P,Q), CCC(P,Q), pdBEKK(P,Q), and BEKK(P,Q) parameterizations are implemented, alongside a constant covariance baseline (that can be used for testing whether GARCH is warranted), based either on a multivariate gaussian normal or student-t distribution. DCC and CCC models are based on Engle (2002) doi:10.1198/073500102288618487 and Bollerslev (1990). The BEKK parameterization follows Engle and Kroner (1995) doi:10.1017/S0266466600009063 while the pdBEKK as well as the estimation approach for this package is described in Rast et al. (2020) doi:10.31234/osf.io/j57pk. The fitted models contain 'rstan' objects and can be examined with 'rstan' functions.

Changes in 2.1.0

cmdstanr backend support

  • bmgarch() now accepts backend = "cmdstanr" in addition to the default "rstan". Both MCMC (NUTS) and variational Bayes (sampling_algorithm = "VB") are supported with the new backend.
  • summary(), print(), plot(), forecast(), fitted(), loo(), and model_weights() all work with cmdstanr-fitted objects.
  • Stan function a_b_scale_jacobian renamed to a_b_scale_log_jac to avoid a future name collision with Stan 2.39's reserved _jacobian suffix (affects inst/stan/functions/jacobian.stan).
  • The iterations argument now defaults to 2000 for MCMC and 30000 for VB when left unspecified. Previously the single default of 2000 was too low for ADVI gradient ascent.
Show all changes in 2.1.0Hide the rest of the changes in 2.1.0
  • The backend field is stored in every bmgarch object so that loo() refits and other operations that call back into bmgarch() automatically use the same backend.
  • Threading defaults: cmdstanr models compiled with stan_threads = TRUE now default to threads_per_chain = 1 (MCMC) and threads = 1 (VB). Users can override via ....

Bug fixes

  • Fixed ensemble covariance underestimation in .weighted_samples(). The between-model variance term required by the law of total variance, Σ_m w_m (μ̂_m − μ̂_mix)(μ̂_m − μ̂_mix)ᵀ, is now added to the weighted combination of H and H_forecasted. This corrects the ensemble posterior predictive covariance for both backcasts and forecasts whenever models with differing mean structures are combined. The fix is a no-op for single-model objects.
  • model_weights() and loo() now work with cmdstanr objects: log_lik extraction and chain/iteration metadata no longer rely on rstan S4 slot access (@sim).
  • Weighted forecasts (forecast(..., weights = mw)) now work with cmdstanr backends via a new .extract_param_list() helper that replicates rstan::extract() output for cmdstanr draw objects.
  • Forecast draws passed to rstan::gqs() are now correctly extracted via posterior::as_draws_matrix() for cmdstanr fits, fixing a "no dimnames" error.

Tests

  • Added tests/testthat/test-backends.R covering summary, forecast, and model_weights for all three combinations: rstan/MCMC, cmdstanr/MCMC, and cmdstanr/VB on a CCC model.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 44.0 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-29
  • ERROR12 OK, 1 ERROR2026-07-27
  • OK13 OK2026-05-28
Show 3 earlier changesHide 3 earlier changes
  • NOTE14 NOTE2026-04-22
  • ERROR13 NOTE, 1 ERROR2026-04-18
  • NOTE14 NOTE2026-03-10
Advisories

none known

Documentation

In release 2.1.0
READMEYes · 4,729 wordsVignettesNoNEWSYes · 100% structured · mentions 2.1.0Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
44 (26 internal)includes a package overview page
Examples that run
0%5 never run
Exported functions with examples
80%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
9% with a bibliography file

Downloads

5.4K
CRAN downloads in the past year
Rank #5,173 · ~15/day · ~449/mo
Daily download trend is not available in this view yet.
51830 days
1.6K90 days
5.4K1 year
Compare downloads with other packages →
Also on516 r2u39 autocran110 c2d4u

Repository

18Stars
11Forks
0Open issues
0Open PRs
1Releases
515Commits
5Commit identities
515 commits · Last activity 2026-07-07
Responsiveness
How these are sampled
PRs merged (all time)
94%
Median days to close, 50 most recently updated closed issues
8
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-04-23 · 182026-07-07 · 18
PracticesBeta

8 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/ph-rast/bmgarch on 2026-10-21.

Continuous integration (3)
GitHub ActionsR CMD check workflowTravis CI (config file)

The R CMD check workflow runs on Linux, macOS and Windows

Governance and community (2)
Code of conductContributing guide
Docs source (1)
README.Rmd
Coverage (1)
.covrignore
Show all practicesHide 1 practice
CRAN release process (1)
cran-comments.md
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
17 external dependencies (excludes base and recommended)

Installing bmgarch adds 58 packages (30 with compiled code, 50 MB of source tarballs). Heaviest: BH 14 MB, ggplot2 6.0 MB, loo 2.7 MB.

Depends (3)
R >= 4.0.0methodsRcpp
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (2)
Author, Maintainer since 1.0.0 (2020)
Releases (5)

Pick two releases to compare their code metrics.

  • 2.1.0Latest
    record
    2026-05-21 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 2.0.0
    record
    2023-09-12 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 1.1.0
    record
    2021-12-14 · diff ↗
  • 1.0.1
    record
    2021-06-14 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 1.0.0
    record
    2020-09-17
  • R
    R 4.0.0 released · 2020-04-24

Package metadata

First published
2020-09-17
Total releases
5 / 6 yrs
License
GPL (>= 3) OSI
Additional repositories
stan-dev.r-universe.dev
Minimum R
≥ 4.0.0
Bundled data
40 KB / 2 files
Download size
208 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("bmgarch")
Rast, P., & Martin, S. (2026). bmgarch: Bayesian Multivariate GARCH Models (Version 2.1.0) [Computer software]. https://doi.org/10.32614/CRAN.package.bmgarch

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for bmgarch version 2.1.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy