Skip to content

tsgarch

1.0.5Package record

Univariate GARCH Models

1packages dependsuggested by 1
5.5Kdownloads / year
58.5%test coverage
13/13flavors OK

Overview

About

Multiple flavors of the Generalized Autoregressive Conditional Heteroskedasticity (GARCH) model with a large choice of conditional distributions. Methods for specification, estimation, prediction, filtering, simulation, statistical testing and more. Represents a partial re-write and re-think of 'rugarch', making use of automatic differentiation for estimation.

Changes in 1.0.5
  • Added a jointly estimated ARMA(p,q)-X mean equation, via new arma, xreg

and xreg_type arguments to garch_modelspec (defaulting to c(0,0) and

NULL respectively, so fully backward compatible). Available for all 8

GARCH flavors, including igarch and ewma. The constant argument

remains independent of both the ARMA order and the regressors, and continues

to control only whether the unconditional mean mu is estimated or fixed at

zero.

  • Regressors enter the conditional mean through xreg (an xts matrix aligned

to y), with xreg_type selecting between two conventions: `xreg_type =

"arma_errors"` (the default) runs the ARMA recursion on

y_t - mu - x_t'tau, so tau is the long-run marginal effect - this

matches stats::arima's xreg semantics and the sibling **tsarma**

Show all changes in 1.0.5Hide the rest of the changes in 1.0.5

package; xreg_type = "armax" (the **rugarch** convention) adds

x_t'tau to the conditional mean at time t only, so tau is the

impact effect and the long-run effect is tau/(1 - sum(phi)). The two

are algebraically identical whenever the AR order is zero. Both are

restrictions of the same distributed lag model and neither nests the other;

see the "ARMA Mean Equation" section of vignettes/garch_models.Rmd for

guidance on choosing between them. The coefficients are named tau1,

tau2, ... in the parmatrix (xi is already the variance-regressor

coefficient in this package; note that **tsarma** calls its mean-equation

coefficients xi, which is tsgarch's tau). An xreg containing

NA/NaN/Inf values, or which is rank deficient (including a constant

column when constant = TRUE), is rejected at specification time.

  • Mean regressors are supported throughout the model lifecycle:

estimate, tsfilter (via newxreg), predict (via newxreg, and

both parametric and bootstrap predictive distributions), simulate

(via xreg, a raw matrix with h + burn rows - unlike the legacy

vreg argument which is a pre-multiplied vector) and garch_backtest

(sliced per rolling window). When the model includes xreg but the

future regressors are not supplied, a zero matrix is substituted with a

warning; the variance-regressor argument newvreg in predict()

deliberately retains its existing hard-error behaviour. Note that future

regressors are treated as a single deterministic path shared across all

simulated paths, so regressor uncertainty is not propagated into the

predictive distribution.

  • The AR/MA coefficients are guaranteed stationary/invertible by construction,

via a Durbin-Levinson/Jones partial-autocorrelation (PACF) reparameterization

of the raw optimization parameters, so no additional nonlinear constraints

are required; exact (autodiff, not finite-difference) Jacobians of the ARMA

mean equation are available throughout via TMB. The transformed AR/MA

coefficients can be extracted with the new arma_coefficients() function.

  • fitted() now returns the genuinely time-varying conditional mean whenever

the mean equation has ARMA dynamics or regressors (previously always a

constant mu, now completing the documented "vector the size of y"

contract), and residuals() is now always exactly y - fitted(object) for

every model, including a fix for models with no ARMA (a small, purely

internal simplification with no behavior change there). A pure regression

with GARCH errors (arma = c(0,0) with xreg) therefore reports the

regression fit rather than a constant.

  • predict(), simulate(), tsfilter(), garch_backtest() and

tsprofile() all account for the full ARMA-X mean equation: point

forecasts, both the parametric and bootstrap predictive distributions,

simulated paths, incremental filtering, each rolling window's refit and the

simulate/re-estimate profile all reflect the AR/MA dynamics and the

regressor contribution. Variance targeting uses the unconditional variance

of the ARMA innovations rather than deviations from the constant mu, so

the R side unconditional()/target_omega agree with the TMB side. Mean

regressors are refused by tsprofile(), as vreg already was, since its

simulation step does not carry them into the simulated sample. The combined

pre-sample/burn-in length used internally is max(garch order, arma order).

  • summary() (and its console print()/as_flextable() methods) now

displays the transformed ar/ma coefficients with their delta-method

standard errors, rather than the raw (not directly interpretable)

Durbin-Levinson parameters used internally during estimation.

  • An entire AR and/or MA polynomial in the ARMA mean equation can now be

fixed at target coefficients rather than estimated: set value to the

desired ar/ma coefficients (not the internal pacf parameterization) and

estimate = 0 on every arpacf#/mapacf# row of the relevant group in the

spec's parmatrix; the correct internal Durbin-Levinson transform is then

applied automatically wherever needed (estimation, arma_coefficients(),

predict(), simulate(), tsfilter()), and the fixed coefficients are

validated for stationarity/invertibility up front. Fixing only some (not

all) of the lags of a given polynomial is not supported, since the

reparameterization couples all of a polynomial's lags together, and raises

an informative error, as does mixing estimate values within one group.

  • Added a new ARMA diagnostic panel to plot.tsgarch.estimate()

(plot(object, type = "arma")), for models with a non-zero arma order.

The panel shows: inverse AR/MA roots against the unit circle (with visual

flags for near common-factor cancellation), the impulse response function

(plotted from lag 1, since psi_0 = 1 identically and carries no

information about the fitted model; the optional cumulative line is

accumulated from lag 1 as well, so both stay on the same scale),

and the ACFs of the standardized residuals z_t and z_t^2. All four

panels are shown by default (which = NULL); individual panels can be

selected via which. The residual ACF panels support three envelopes:

the default asymptotic "bartlett" band, a "simulate" band from the

fitted innovation distribution at the point parameter estimates (no

parameter uncertainty), and a "parametric" band that perturbs the full

parameter vector using vcov() and re-filters the observed data to reflect

parameter estimation uncertainty. type = "garch" (the original

volatility/news-impact/QQ panel) remains the default and is unchanged. New

computational helpers arma_inverse_roots(), arma_irf() and

arma_near_cancellation() are exported for programmatic use.

  • tsequation(), and the as_flextable summary footer built from it, now

render the conditional mean equation eq_mean first in the equation block,

covering the constant, the ARMA terms and the mean regressors under both

xreg_type conventions.

  • Fixed tsbacktest() silently refitting the wrong model inside its rolling

windows: the inner garch_modelspec() call passed no model, so e.g. an

egarch spec was backtested as a vanilla garch. The spec now records the

user-facing model name in model$model_name, necessary because ewma is

coerced to igarch internally, and each window is refit with it.

  • Fixed spec re-specification dropping the ewma restriction. ewma is

coerced to igarch internally, the difference being only the fixed omega

row of the parmatrix, and both .spec2newspec() and garch_profile()

rebuilt specs from the coerced name. A filtered ewma model therefore

carried a spurious free omega, leaving npars and AIC/BIC out by one

parameter's worth, and garch_profile() re-fit an igarch model. Filtered

sigma is unchanged; filtered ewma AIC/BIC shift accordingly.

  • simulate() now raises an error instead of silently returning zeros when

the implied initial variance is not positive and finite. For an ewma

specification omega is fixed at zero, so the seed was zero and the

variance recursion stayed there at every step, returning sigma identically

zero and a series equal to mu. Supply var_init for such models;

predict() always did, and every other flavor has a positive implied seed

and is unaffected.

  • simulate() on a spec taken from an estimated object (mod$spec, which

carries parmatrix = NULL) no longer aborts the R session, raising a clean

error asking for the estimated parmatrix to be assigned onto the spec

first. A specification serialized by a version up to 1.0.4 predates the

arpacf, mapacf and tau rows of the parmatrix and is likewise refused

with a message naming garch_modelspec() as the remedy, rather than failing

with Error when reading the variable: 'arpacf'.

  • Fixed tsfilter()'s zero fill for a missing newvreg being built with

as.matrix(0, ...), a 1x1 matrix, instead of matrix(0, nrow, ncol).

  • Corrected the pre-sample initialization of the ARCH recursion for the

asymmetric flavors (egarch, gjrgarch, aparch, fgarch). Whether a lag

lookback falls inside the pre-sample was tested against the ARCH order

rather than against the pre-sample length, and the two coincide only when

the ARCH order is the larger. Observations just past the pre-sample

therefore took a zeroed residual in place of the initial ARCH value, in the

likelihood and in simulate() alike; both now test the pre-sample length.

This is reachable through a GARCH order with q > p, so logLik and the

coefficients shift for these four flavors in that case. order = c(1,1) is

arithmetically unchanged, and garch, igarch and ewma are unaffected at

every order, their pre-sample ARCH input being constant.

  • Corrected the pre-sample initialization of simulate(), which now

reproduces a fitted model's sigma to machine precision for every flavor,

where the discrepancy previously reached 5e-2. var_init and innov_init

are documented as seeding every sample path identically, but were filled

column-major for several flavors, rotating them across the paths instead of

broadcasting them; the lag-indexed ARCH initialization was paired with the

oldest pre-sample period rather than the most recent, mismatching each lag

with its coefficient; aparch and fgarch recycled their per-lag gamma

(and fgarch its eta) across paths rather than across lags; and an

arch_initial shorter than the pre-sample was collapsed onto its first

element rather than padded, putting the lag 1 value into every lag. These

are observable with more than one sample path, or a pre-sample longer than

one period.

  • Corrected the default ARCH initialization of a simulation, which is the

expectation of each flavor's ARCH equation. egarch instead evaluated its

equation at the zeroed pre-sample innovations literally, contributing

-gamma_j kappa where both the expectation and the likelihood give zero,

which biased the opening steps downwards. aparch raised its already

power-transformed initial variance to delta/2 a second time, the identity

only at delta = 2, so a default simulation opened away from its own

unconditional level by 3 to 10 percent for any other delta. A default

simulation now opens exactly at the unconditional level for every flavor

that has one.

  • A pre-sample innovation supplied to an egarch simulation through

innov_init now carries its leverage effect; only its magnitude was used,

the alpha_j z_{t-j} term of the ARCH equation being absent from the

pre-sample. The egarch predictive distribution and the

simulation-approximated higher order forecast both move, and at a horizon of

one the mean of the simulated distribution now agrees with the closed form

forecast to machine precision, where it was out by around 3 percent.

  • tsbacktest() no longer warns that its iterations drew random numbers

without declaring a seed. They do draw them, through predict(), so they

are now given parallel-safe streams.

  • A standard error that is legitimately undefined is now reported as NaN

without the low-level warning behind it. When a parameter is estimated at

one of its bounds, or for ewma, whose unit persistence constraint leaves

its two coefficients perfectly dependent, the Hessian has no positive

definite direction there and the delta method variance is negative.

kkt1/kkt2 in the estimated object's conditions remain the signal that

the solution sits on a bound.

  • Documented the matrix form of var_init accepted by simulate() for a

cgarch model: a max(order, arma) by 2 matrix whose first column

initializes the permanent (long run) component and whose second column

initializes the total conditional variance.

  • Fixed the build against Eigen 5.0, which removed the free elementwise

pow(ArrayBase, scalar) for non-arithmetic scalar types such as TMB's

CppAD::AD<double>. The ARCH initialization of the aparch and fgarch

flavors in src/TMB/garchextra.h now raises to the power delta through a

small pow_cwise() helper built on unaryExpr, which compiles under both

Eigen 3.4 and 5.0 and leaves the results unchanged. Thanks to Dirk

Eddelbuettel for the fix (PR #9).

From NEWS.md in the release

Install

Health

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

none known

Documentation

In release 1.0.5
README· In the repository, left out of the releaseVignettesYes · 4 · dynamicNEWSYes · 100% structured · mentions 1.0.5Citation fileNoWebsiteYes
Help pages
47 (2 internal)includes a package overview page
Examples that run
50%1 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
0%
Documented parameters
100%
Return-value docs
93%
Help pages citing references
6% with a bibliography file

Downloads

5.5K
CRAN downloads in the past year
Rank #5,470 · ~15/day · ~459/mo
Daily download trend is not available in this view yet.
64330 days
1.5K90 days
5.5K1 year
Compare downloads with other packages →
Also on406 r2u2 autocran

Repository

20Stars
2Forks
1Open issues
0Open PRs
0Releases
112Commits
2Commit identities
garchr
112 commits · Last activity 2026-10-09 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
14
Median days to close, 50 most recently updated closed PRs
8

Stars over time

2025-09-27 · 152026-08-06 · 20
PracticesBeta

4 development-tooling and community-health practices detected across 3 families in the upstream repository

Checks run against github.com/tsmodels/tsgarch on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

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

CRAN release process (1)
revdep/
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
22 external dependencies (excludes base and recommended)

Installing tsgarch adds 86 packages (52 with compiled code, 67 MB of source tarballs). Heaviest: stringi 11 MB, data.table 5.7 MB, bslib 5.6 MB.

Depends (3)
R >= 4.1.0methodstsmethods
LinkingTo (3)
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (1)
Author, Maintainer since 1.0.0 (2024), Copyright holder
Releases (5)

Pick two releases to compare their code metrics.

  • 1.0.5Latest
    record
    2026-10-09 · current release · diff ↗ ·
    added 4 exports
    arma_coefficients, arma_inverse_roots, arma_irf, arma_near_cancellation
    ·
    listed once in CRAN's queue
    Seen in one reading of CRAN's incoming queue, at 2026-10-09 07:02 UTC, so it stayed less than the time between readings.
  • 1.0.4
    record
    2026-05-23 · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • 1.0.3
    record
    2024-10-12 · diff ↗ ·
    added 1 export
    to_multi_estimate
  • 1.0.2
    record
    2024-05-08 · diff ↗
  • 1.0.0
    record
    2024-04-24
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
Across CRAN, the median accepted release of the past year spent 26 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2024-04-24
Total releases
5 / 2 yrs
License
GPL-2 OSI
Minimum R
≥ 4.1.0
Bundled data
45 KB / 2 files
Download size
838 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("tsgarch")
Galanos, A. (2026). tsgarch: Univariate GARCH Models (Version 1.0.5) [Computer software]. https://doi.org/10.32614/CRAN.package.tsgarch

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 tsgarch version 1.0.5 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, 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