pith. sign in

arxiv: 1906.12134 · v1 · pith:FO4R5Q56new · submitted 2019-06-28 · 📊 stat.CO · econ.EM· q-fin.CP· q-fin.ST

Dealing with Stochastic Volatility in Time Series Using the R Package stochvol

Pith reviewed 2026-05-25 13:33 UTC · model grok-4.3

classification 📊 stat.CO econ.EMq-fin.CPq-fin.ST
keywords stochastic volatilityBayesian inferenceMCMC samplingR packageheteroskedasticitytime seriesvolatility prediction
0
0 comments X

The pith

The stochvol R package implements fully Bayesian stochastic volatility modeling for time series using MCMC sampling to obtain posterior draws.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

This paper presents the stochvol R package as a tool for modeling heteroskedasticity in time series data within a stochastic volatility framework. The approach relies on Markov chain Monte Carlo samplers to draw from the posterior distributions of model parameters and unobserved volatility processes. These samples enable predictions of future volatilities and can be used independently or embedded in other sampling routines. The description includes the underlying model, sampling methods, and examples applied to exchange rate series.

Core claim

The package delivers a fully Bayesian treatment of stochastic volatility models by employing MCMC to sample the joint posterior of parameters and latent variables, allowing straightforward application to time series and integration with broader MCMC workflows.

What carries the argument

MCMC samplers that target the posterior distribution of the stochastic volatility model parameters and the latent volatility process.

If this is right

  • The draws support prediction of future volatilities.
  • The package serves as a stand-alone tool.
  • It integrates into other MCMC samplers.
  • It applies to exchange rate data.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • Practitioners can incorporate stochastic volatility into existing Bayesian workflows without custom coding.
  • The package's design supports both standalone analysis and extension to more complex models.
  • Examples with exchange rates indicate direct utility for series that exhibit volatility clustering.

Load-bearing premise

The implemented MCMC sampling schemes correctly and efficiently target the posterior distribution of the stochastic volatility parameters and latent process.

What would settle it

Running the package on simulated data with known true posterior distributions and finding that the sampled draws do not converge to those known distributions would challenge the implementation's correctness.

Figures

Figures reproduced from arXiv: 1906.12134 by Gregor Kastner.

Figure 1
Figure 1. Figure 1: Visualization of EUR-USD exchange rates included in the [PITH_FULL_IMAGE:figures/full_fig_p005_1.png] view at source ↗
Figure 2
Figure 2. Figure 2: Visualization of a simulated time series as provided by the default [PITH_FULL_IMAGE:figures/full_fig_p006_2.png] view at source ↗
Figure 3
Figure 3. Figure 3: Visualization of estimated contemporaneous volatilities of EUR-USD exchange [PITH_FULL_IMAGE:figures/full_fig_p009_3.png] view at source ↗
Figure 4
Figure 4. Figure 4: As above, now with medians (black line) and 1%/10%/90%/99% quantiles (gray [PITH_FULL_IMAGE:figures/full_fig_p010_4.png] view at source ↗
Figure 5
Figure 5. Figure 5: Trace plots of posterior draws for the parameters [PITH_FULL_IMAGE:figures/full_fig_p011_5.png] view at source ↗
Figure 6
Figure 6. Figure 6: Posterior density estimates (black solid lines) along with prior densities (dashed [PITH_FULL_IMAGE:figures/full_fig_p011_6.png] view at source ↗
Figure 7
Figure 7. Figure 7: Illustration of the default plot method for svdraws-objects. This visualization combines volplot ( [PITH_FULL_IMAGE:figures/full_fig_p012_7.png] view at source ↗
Figure 8
Figure 8. Figure 8: Mean standardized residual plots for assessing the model fit, as provided by the cor [PITH_FULL_IMAGE:figures/full_fig_p013_8.png] view at source ↗
Figure 9
Figure 9. Figure 9: Trace plots and kernel density estimates for some draws from the marginal posterior [PITH_FULL_IMAGE:figures/full_fig_p016_9.png] view at source ↗
Figure 10
Figure 10. Figure 10: Trace plots and kernel density estimates in the regression model with heteroskedas [PITH_FULL_IMAGE:figures/full_fig_p018_10.png] view at source ↗
Figure 11
Figure 11. Figure 11: Scatterplot of daily log prices at time [PITH_FULL_IMAGE:figures/full_fig_p020_11.png] view at source ↗
Figure 12
Figure 12. Figure 12: Visualization of the posterior distributions [PITH_FULL_IMAGE:figures/full_fig_p021_12.png] view at source ↗
Figure 13
Figure 13. Figure 13: Visualization of mean standardized residuals. Top left panel shows a scatterplot [PITH_FULL_IMAGE:figures/full_fig_p022_13.png] view at source ↗
Figure 14
Figure 14. Figure 14: Top panel: Observed series (green) and symmetrical 98% one-day-ahead predictive [PITH_FULL_IMAGE:figures/full_fig_p025_14.png] view at source ↗
Figure 15
Figure 15. Figure 15: Top panel: Observed residuals with respect to the median of the one-day-ahead [PITH_FULL_IMAGE:figures/full_fig_p026_15.png] view at source ↗
read the original abstract

The R package stochvol provides a fully Bayesian implementation of heteroskedasticity modeling within the framework of stochastic volatility. It utilizes Markov chain Monte Carlo (MCMC) samplers to conduct inference by obtaining draws from the posterior distribution of parameters and latent variables which can then be used for predicting future volatilities. The package can straightforwardly be employed as a stand-alone tool; moreover, it allows for easy incorporation into other MCMC samplers. The main focus of this paper is to show the functionality of stochvol. In addition, it provides a brief mathematical description of the model, an overview of the sampling schemes used, and several illustrative examples using exchange rate data.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

1 major / 0 minor

Summary. The manuscript presents the R package stochvol, which supplies a fully Bayesian implementation of stochastic volatility models for time series exhibiting heteroskedasticity. It employs MCMC samplers to generate draws from the joint posterior of model parameters and latent volatility processes, enabling inference and prediction of future volatilities. The paper supplies a brief mathematical description of the SV model, an overview of the sampling schemes, and several illustrative examples using exchange rate data. The package is positioned for both standalone use and integration into larger MCMC workflows.

Significance. If the samplers are correctly implemented, the package would constitute a practical contribution by making fully Bayesian SV modeling accessible within R, with the ability to produce posterior draws for both parameters and latent states supporting uncertainty-aware volatility forecasts. The provision of real-data examples demonstrates usability and the integration option adds flexibility for users embedding the routines in custom samplers. These elements would strengthen the manuscript's value as a software contribution if accompanied by verification of the core MCMC functionality.

major comments (1)
  1. [Abstract and sampling schemes overview] Abstract, paragraph 1, and the section describing the sampling schemes: the central claim that the MCMC samplers obtain draws from the posterior distribution of parameters and latent variables is not supported by any simulation recovery experiments, comparison against known exact samplers, or reported convergence diagnostics, which is load-bearing for establishing that the package performs the stated inference.

Simulated Author's Rebuttal

1 responses · 0 unresolved

We thank the referee for the detailed review and constructive suggestion. We address the single major comment below.

read point-by-point responses
  1. Referee: [Abstract and sampling schemes overview] Abstract, paragraph 1, and the section describing the sampling schemes: the central claim that the MCMC samplers obtain draws from the posterior distribution of parameters and latent variables is not supported by any simulation recovery experiments, comparison against known exact samplers, or reported convergence diagnostics, which is load-bearing for establishing that the package performs the stated inference.

    Authors: The manuscript is a software paper whose primary purpose is to document the functionality, interface, and usage of the stochvol package rather than to re-derive or exhaustively validate the underlying MCMC algorithms. The sampling schemes are standard methods whose theoretical properties and correctness have already been established in the cited literature (Kastner & Frühwirth-Schnatter 2014 and related works). That said, we agree that the absence of any reported convergence diagnostics or recovery experiments in the current version leaves the central claim without direct empirical support within the manuscript itself. We will therefore revise the paper by (i) adding trace plots, effective sample sizes, and Gelman–Rubin statistics to the exchange-rate examples and (ii) inserting a short simulation subsection that demonstrates parameter and latent-state recovery on synthetic data generated from the model. These additions will be placed in the section describing the sampling schemes. revision: yes

Circularity Check

0 steps flagged

No circularity: software description with no derivation chain

full rationale

The paper is a description of the stochvol R package and its MCMC implementation for stochastic volatility models. It supplies a brief model overview and sampling scheme summary but advances no new mathematical derivations, parameter fits, or predictions that could reduce to inputs by construction. No self-definitional steps, fitted-input predictions, or load-bearing self-citations appear. The central claim concerns software functionality and is independent of any circular reduction. This matches the default expectation of no circularity for non-derivational papers.

Axiom & Free-Parameter Ledger

0 free parameters · 0 axioms · 0 invented entities

No new mathematical model, free parameters, or invented entities are introduced; the paper describes software for standard stochastic volatility models already present in the literature.

pith-pipeline@v0.9.0 · 5639 in / 1067 out tokens · 27466 ms · 2026-05-25T13:33:05.218625+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Reference graph

Works this paper leans on

30 extracted references · 30 canonical work pages

  1. [1]

    Generalized Autoregressive Conditional Heteroskedasticity

    Bollerslev T (1986). Generalized Autoregressive Conditional Heteroskedasticity. Journal of Econometrics, 31(3), 307--327. doi:10.1016/0304-4076(86)90063-1

  2. [2]

    Relating Stochastic Volatility Estimation Methods

    Bos CS (2012). Relating Stochastic Volatility Estimation Methods. In L Bauwens, C Hafner, S Laurent (eds.), Handbook of Volatility Models and Their Applications, pp. 147--174. John Wiley & Sons. doi:10.1002/9781118272039.ch6

  3. [3]

    Rcpp : Seamless R and C++ Integration

    Eddelbuettel D, Fran c ois R (2011). Rcpp : Seamless R and C++ Integration. Journal of Statistical Software, 40(8), 1--18. doi:10.18637/jss.v040.i08

  4. [4]

    Autoregressive Conditional Heteroscedasticity With Estimates of the Variance of U nited K ingdom Inflation

    Engle RF (1982). Autoregressive Conditional Heteroscedasticity With Estimates of the Variance of U nited K ingdom Inflation. Econometrica, 50(4), 987--1007. doi:10.2307/1912773

  5. [5]

    Stochastic Model Specification Search for G aussian and Partial Non- G aussian State Space Models

    Fr \"u hwirth-Schnatter S, Wagner H (2010). Stochastic Model Specification Search for G aussian and Partial Non- G aussian State Space Models. Journal of Econometrics, 154(1), 85--100. doi:10.1016/j.jeconom.2009.07.003

  6. [6]

    mvtnorm : Multivariate Normal and t Distributions

    Genz A, Bretz F, Miwa T, Mi X, Leisch F, Scheipl F, Hothorn T (2013). mvtnorm : Multivariate Normal and t Distributions . R package version 0.9-9996, ://CRAN.R-project.org/package=mvtnorm

  7. [7]

    Comparing and Evaluating B ayesian Predictive Distributions of Asset Returns

    Geweke J, Amisano G (2010). Comparing and Evaluating B ayesian Predictive Distributions of Asset Returns. International Journal of Forecasting, 26(2), 216--230. doi:10.1016/j.ijforecast.2009.10.007

  8. [8]

    Stochastic Volatility

    Ghysels E, Harvey AC, Renault E (1996). Stochastic Volatility. In GS Maddala, CR Rao (eds.), Statistical Methods in Finance, volume 14 of Handbook of Statistics, pp. 119--191. Elsevier. doi:10.1016/S0169-7161(96)14007-4

  9. [9]

    Parameterization Issues in B ayesian Inference

    Hills SE, Smith AFM (1992). Parameterization Issues in B ayesian Inference. In JM Bernardo, JO Berger, AP Dawid, AFM Smith (eds.), P roceedings of the F ourth V alencia I nternational M eeting , volume 4 of Bayesian S tatistics , pp. 227--246. Oxford University Press

  10. [10]

    Bayesian Analysis of Stochastic Volatility Models

    Jacquier E, Polson NG, Rossi PE (1994). Bayesian Analysis of Stochastic Volatility Models. Journal of Business & Economic Statistics , 12(4), 371--389. doi:10.1080/07350015.1994.10524553

  11. [11]

    Bayesian Analysis of Stochastic Volatility Models With Fat-Tails and Correlated Errors

    Jacquier E, Polson NG, Rossi PE (2004). Bayesian Analysis of Stochastic Volatility Models With Fat-Tails and Correlated Errors. Journal of Econometrics, 122(1), 185--212. doi:10.1016/j.jeconom.2003.09.001

  12. [12]

    Theory of Probability

    Jeffreys H (1961). Theory of Probability. Third edition. Oxford University Press

  13. [13]

    B ayes Factors

    Kass RE, Raftery AE (1995). B ayes Factors. Journal of the American Statistical Association, 90, 773--795. doi:10.1080/01621459.1995.10476572

  14. [14]

    Dealing with Stochastic Volatility in Time Series Using the R Package stochvol

    Kastner G (2016 a ). Dealing with Stochastic Volatility in Time Series Using the R Package stochvol . Journal of Statistical Software, 69(5), 1--30. doi:10.18637/jss.v069.i05

  15. [15]

    stochvol : Efficient Bayesian Inference for Stochastic Volatility (SV) Models

    Kastner G (2016 b ). stochvol : Efficient Bayesian Inference for Stochastic Volatility (SV) Models . R package version 1.2.3, ://CRAN.R-project.org/package=stochvol

  16. [16]

    A ncillarity-Sufficiency Interweaving Strategy ( ASIS ) for Boosting MCMC Estimation of Stochastic Volatility Models

    Kastner G, Fr \"u hwirth-Schnatter S (2014). A ncillarity-Sufficiency Interweaving Strategy ( ASIS ) for Boosting MCMC Estimation of Stochastic Volatility Models. Computational Statistics & Data Analysis, 76, 408--423. doi:10.1016/j.csda.2013.01.002

  17. [17]

    Analysis of Exchange Rates via Multivariate B ayesian Factor Stochastic Volatility Models

    Kastner G, Fr\" u hwirth-Schnatter S, Lopes HF (2014). Analysis of Exchange Rates via Multivariate B ayesian Factor Stochastic Volatility Models. In E Lanzarone, F Ieva (eds.), The Contribution of Young Researchers to B ayesian Statistics -- Proceedings of BAYSM2013 , volume 63 of Springer Proceedings in Mathematics & Statistics, pp. 181--185. Springer-Ve...

  18. [18]

    Stochastic Volatility: Likelihood Inference and Comparison With ARCH Models

    Kim S, Shephard N, Chib S (1998). Stochastic Volatility: Likelihood Inference and Comparison With ARCH Models. Review of Economic Studies, 65(3), 361--393. doi:10.1111/1467-937X.00050

  19. [19]

    Portfolio Selection

    Markowitz H (1952). Portfolio Selection. The Journal of Finance, 7(1), 77--91. doi:10.1111/j.1540-6261.1952.tb01525.x

  20. [20]

    Simulation Smoothing for State-Space Models: A Computational Efficiency Analysis

    McC ausland WJ, Miller S, Pelletier D (2011). Simulation Smoothing for State-Space Models: A Computational Efficiency Analysis. Computational Statistics and Data Analysis, 55(1), 199--212. doi:10.1016/j.csda.2010.07.009

  21. [21]

    BUGS for a B ayesian Analysis of Stochastic Volatility Models

    Meyer R, Yu J (2000). BUGS for a B ayesian Analysis of Stochastic Volatility Models. The Econometrics Journal, 3(2), 198--215. doi:10.1111/1368-423X.00046

  22. [22]

    Stochastic Volatility With Leverage: F ast and Efficient Likelihood Inference

    Omori Y, Chib S, Shephard N, Nakajima J (2007). Stochastic Volatility With Leverage: F ast and Efficient Likelihood Inference. Journal of Econometrics, 140(2), 425--449. doi:10.1016/j.jeconom.2006.07.008

  23. [23]

    coda : Convergence Diagnosis and Output Analysis for MCMC

    Plummer M, Best N, Cowles K, Vines K (2006). coda : Convergence Diagnosis and Output Analysis for MCMC . R News , 6(1), 7--11. ://CRAN.R-project.org/doc/Rnews/Rnews_2006-1.pdf

  24. [24]

    R : A Language and Environment for Statistical Computing

    R Core Team (2016). R : A Language and Environment for Statistical Computing . R Foundation for Statistical Computing, Vienna, Austria. ://www.R-project.org/

  25. [25]

    Fast Sampling of G aussian M arkov Random Fields

    Rue H (2001). Fast Sampling of G aussian M arkov Random Fields. Journal of the Royal Statistical Society B, 63(2), 325--338. doi:10.1111/1467-9868.00288

  26. [26]

    Financial Returns Modelled by the Product of Two Stochastic Processes: A Study of Daily Sugar Prices 1691--79

    Taylor SJ (1982). Financial Returns Modelled by the Product of Two Stochastic Processes: A Study of Daily Sugar Prices 1691--79. In OD Anderson (ed.), Time Series Analysis: Theory and Practice 1, pp. 203--226. North-Holland, Amsterdam

  27. [27]

    snow : Simple Network of Workstations

    Tierney L, Rossini AJ, Li N, Sevcikova H (2013). snow : Simple Network of Workstations . R package version 0.3-12, ://CRAN.R-project.org/package=snow

  28. [28]

    fGarch : Rmetrics - Autoregressive Conditional Heteroskedastic Modelling

    Wuertz D, Chalabi Y, Miklovic M, Boudt C, Chausse P, others (2013). fGarch : Rmetrics - Autoregressive Conditional Heteroskedastic Modelling . R package version 3010.82, ://CRAN.R-project.org/package=fGarch

  29. [29]

    On Leverage in a Stochastic Volatility Model

    Yu J (2005). On Leverage in a Stochastic Volatility Model. Journal of Econometrics, 127(2), 165--178. doi:10.1016/j.jeconom.2004.08.002

  30. [30]

    To Center or Not to Center: That is Not the Question---An Ancillarity-Suffiency Interweaving Strategy (ASIS) for Boosting MCMC Efficiency

    Yu Y, Meng XL (2011). To Center or Not to Center: That is Not the Question---An Ancillarity-Suffiency Interweaving Strategy (ASIS) for Boosting MCMC Efficiency. Journal of Computational and Graphical Statistics, 20(3), 531--570. doi:10.1198/jcgs.2011.203main