Modeling Univariate and Multivariate Stochastic Volatility in R with stochvol and factorstochvol

Stochastic volatility (SV) models are nonlinear state-space models that enjoy increasing popularity for fitting and predicting heteroskedastic time series. However, due to the large number of latent quantities, their efficient estimation is non-trivial and software that allows to easily fit SV models to data is rare. We aim to alleviate this issue by presenting novel implementations of four SV models delivered in two R packages. Several unique features are included and documented. As opposed to previous versions, stochvol is now capable of handling linear mean models, heavy-tailed SV, and SV with leverage. Moreover, we newly introduce factorstochvol which caters for multivariate SV. Both packages offer a user-friendly interface through the conventional R generics and a range of tailor-made methods. Computational efficiency is achieved via interfacing R to C++ and doing the heavy work in the latter. In the paper at hand, we provide a detailed discussion on Bayesian SV estimation and showcase the use of the new software through various examples.

[1]  Torben G. Andersen,et al.  Stochastic volatility , 2003 .

[2]  J. Geweke,et al.  Bayesian Treatment of the Independent Student- t Linear Model , 1993 .

[3]  G. Casella,et al.  The Bayesian Lasso , 2008 .

[4]  G. Kastner Sparse Bayesian time-varying covariance estimation in many dimensions , 2016, Journal of Econometrics.

[5]  Mark J. Jensen,et al.  Bayesian Semiparametric Stochastic Volatility Modeling , 2008 .

[6]  William J. McCausland,et al.  Simulation smoothing for state-space models: A computational efficiency analysis , 2011, Comput. Stat. Data Anal..

[7]  J. Griffin,et al.  Inference with normal-gamma prior distributions in regression problems , 2010 .

[8]  Yasuhiro Omori,et al.  Leverage, heavy-tails and correlated jumps in stochastic volatility models , 2007, Comput. Stat. Data Anal..

[9]  Drew D. Creal A Class of Non-Gaussian State Space Models With Exact Likelihood Inference , 2014 .

[10]  Dirk Eddelbuettel,et al.  Rcpp: Seamless R and C++ Integration , 2011 .

[11]  G. Hunanyan,et al.  Portfolio Selection , 2019, Finanzwirtschaft, Banken und Bankmanagement I Finance, Banks and Bank Management.

[12]  R Core Team,et al.  R: A language and environment for statistical computing. , 2014 .

[13]  Bayesian Analysis of Generalized Autoregressive Conditional Heteroskedasticity and Stochastic Volatility: Modeling Leverage, Jumps and Heavy�?Tails for Financial Time Series , 2012 .

[14]  J. Geweke,et al.  Comparing and Evaluating Bayesian Predictive Distributions of Asset Returns , 2008 .

[15]  Richard McElreath,et al.  Statistical Rethinking: A Bayesian Course with Examples in R and Stan , 2015 .

[16]  Charles S. Bos Relating Stochastic Volatility Estimation Methods , 2011 .

[17]  S. Frühwirth-Schnatter,et al.  Stochastic model specification search for Gaussian and partial non-Gaussian state space models , 2010 .

[18]  M. Plummer,et al.  CODA: convergence diagnosis and output analysis for MCMC , 2006 .

[19]  Yaming Yu,et al.  To Center or Not to Center: That Is Not the Question—An Ancillarity–Sufficiency Interweaving Strategy (ASIS) for Boosting MCMC Efficiency , 2011 .

[20]  M. West,et al.  Bayesian Dynamic Factor Models and Portfolio Allocation , 2000 .

[21]  M. West,et al.  Bayesian forecasting and portfolio decisions using dynamic dependent sparse factor models , 2014 .

[22]  N. Shephard,et al.  Stochastic volatility with leverage: Fast and efficient likelihood inference , 2007 .

[23]  N. Shephard,et al.  Stochastic Volatility: Likelihood Inference And Comparison With Arch Models , 1996 .

[24]  Ming-Hui Chen,et al.  Maximum likelihood estimation for stochastic volatility in mean models with heavy-tailed distributions. , 2017, Applied stochastic models in business and industry.

[25]  Gregor Kastner,et al.  Approaches Toward the Bayesian Estimation of the Stochastic Volatility Model with Leverage , 2019, Springer Proceedings in Mathematics & Statistics.

[26]  Conrad Sanderson,et al.  RcppArmadillo: Accelerating R with high-performance C++ linear algebra , 2014, Comput. Stat. Data Anal..

[27]  Mark J. Jensen,et al.  FEDERAL RESERVE BANK of ATLANTA WORKING PAPER SERIES Estimating a Semiparametric Asymmetric Stochastic Volatility Model with a Dirichlet Process Mixture , 2011 .

[28]  N. Shephard,et al.  Multivariate stochastic variance models , 1994 .

[29]  Gregor Kastner,et al.  Efficient Bayesian Inference for Multivariate Factor Stochastic Volatility Models , 2016, 1602.08154.

[30]  R. Engle Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation , 1982 .

[31]  N. Higham Analysis of the Cholesky Decomposition of a Semi-definite Matrix , 1990 .

[32]  Yasuhiro Omori,et al.  Stochastic volatility model with leverage and asymmetrically heavy-tailed error using GH skew Student's t-distribution , 2012, Comput. Stat. Data Anal..

[33]  N. Shephard,et al.  Estimation of an Asymmetric Stochastic Volatility Model for Asset Returns , 1996 .

[34]  Helio S. Migon,et al.  The extended generalized inverse Gaussian distribution for log-linear and stochastic volatility models , 2006 .

[35]  Wilfrid S. Kendall,et al.  ON PERFECT SIMULATION , 2004 .

[36]  Gregor Kastner,et al.  Ancillarity-sufficiency interweaving strategy (ASIS) for boosting MCMC estimation of stochastic volatility models , 2014, Comput. Stat. Data Anal..

[37]  S. Frühwirth-Schnatter Data Augmentation and Dynamic Linear Models , 1994 .

[38]  H. Lopes,et al.  Sparse Bayesian Factor Analysis When the Number of Factors Is Unknown , 2018, Bayesian Analysis.

[39]  J McCauslandWilliam,et al.  Simulation smoothing for state-space models , 2011 .

[40]  Yanan Fan,et al.  Handbook of Approximate Bayesian Computation , 2018 .

[41]  Gregor Kastner,et al.  Heavy-Tailed Innovations in the R Package stochvol , 2015 .

[42]  H. Rue Fast sampling of Gaussian Markov random fields , 2000 .

[43]  M. Pitt,et al.  Time Varying Covariances: A Factor Stochastic Volatility Approach (with discussion , 1998 .

[44]  R. Kohn,et al.  On Gibbs sampling for state space models , 1994 .

[45]  Peter E. Rossi,et al.  Bayesian Analysis of Stochastic Volatility Models , 1994 .

[46]  Hadley Wickham,et al.  Tools to Make Developing R Packages Easier , 2016 .

[47]  Gregor Kastner Efficient Bayesian Inference for Stochastic Volatility (SV)Models , 2016 .

[48]  J. Griffin,et al.  Bayesian Nonparametric Modelling of the Return Distribution with Stochastic Volatility , 2010 .

[49]  T. Bollerslev,et al.  Generalized autoregressive conditional heteroskedasticity , 1986 .

[50]  Conrad Sanderson,et al.  Armadillo: a template-based C++ library for linear algebra , 2016, J. Open Source Softw..

[51]  N. Shephard,et al.  Analysis of high dimensional multivariate stochastic volatility models , 2006 .

[52]  Yufeng Han,et al.  Asset Allocation with a High Dimensional Latent Factor Stochastic Volatility Model , 2005 .

[53]  J. Rosenthal,et al.  Coupling and Ergodicity of Adaptive Markov Chain Monte Carlo Algorithms , 2007, Journal of Applied Probability.

[54]  A. Harvey,et al.  5 Stochastic volatility , 1996 .

[55]  A. Zeileis,et al.  zoo: S3 Infrastructure for Regular and Irregular Time Series , 2005, math/0505527.

[56]  S. Taylor Financial Returns Modelled by the Product of Two Stochastic Processes , 1961 .

[57]  Andrew Gelman,et al.  Handbook of Markov Chain Monte Carlo , 2011 .

[58]  Gabriele Fiorentini,et al.  Identification, Estimation and Testing of Conditionally Heteroskedastic Factor Models , 2001 .

[59]  Gregor Kastner,et al.  Dealing with Stochastic Volatility in Time Series Using the R Package stochvol , 2016, 1906.12134.

[60]  Peter E. Rossi,et al.  Bayesian analysis of stochastic volatility models with fat-tails and correlated errors , 2004 .