IDEAS home Printed from https://ideas.repec.org/p/arx/papers/1906.12123.html
   My bibliography  Save this paper

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

Author

Listed:
  • Darjus Hosszejni
  • Gregor Kastner

Abstract

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.

Suggested Citation

  • Darjus Hosszejni & Gregor Kastner, 2019. "Modeling Univariate and Multivariate Stochastic Volatility in R with stochvol and factorstochvol," Papers 1906.12123, arXiv.org, revised Feb 2021.
  • Handle: RePEc:arx:papers:1906.12123
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/1906.12123
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Sangjoon Kim & Neil Shephard & Siddhartha Chib, 1998. "Stochastic Volatility: Likelihood Inference and Comparison with ARCH Models," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 65(3), pages 361-393.
    2. Harry Markowitz, 1952. "Portfolio Selection," Journal of Finance, American Finance Association, vol. 7(1), pages 77-91, March.
    3. Sentana, Enrique & Fiorentini, Gabriele, 2001. "Identification, estimation and testing of conditionally heteroskedastic factor models," Journal of Econometrics, Elsevier, vol. 102(2), pages 143-164, June.
    4. Jacquier, Eric & Polson, Nicholas G & Rossi, Peter E, 2002. "Bayesian Analysis of Stochastic Volatility Models," Journal of Business & Economic Statistics, American Statistical Association, vol. 20(1), pages 69-87, January.
    5. Jacquier, Eric & Polson, Nicholas G & Rossi, Peter E, 1994. "Bayesian Analysis of Stochastic Volatility Models: Comments: Reply," Journal of Business & Economic Statistics, American Statistical Association, vol. 12(4), pages 413-417, October.
    6. McCausland, William J. & Miller, Shirley & Pelletier, Denis, 2011. "Simulation smoothing for state-space models: A computational efficiency analysis," Computational Statistics & Data Analysis, Elsevier, vol. 55(1), pages 199-212, January.
    7. Zhou, Xiaocong & Nakajima, Jouchi & West, Mike, 2014. "Bayesian forecasting and portfolio decisions using dynamic dependent sparse factor models," International Journal of Forecasting, Elsevier, vol. 30(4), pages 963-980.
    8. Geweke, John & Amisano, Gianni, 2010. "Comparing and evaluating Bayesian predictive distributions of asset returns," International Journal of Forecasting, Elsevier, vol. 26(2), pages 216-230, April.
    9. Jensen, Mark J. & Maheu, John M., 2010. "Bayesian semiparametric stochastic volatility modeling," Journal of Econometrics, Elsevier, vol. 157(2), pages 306-316, August.
    10. Frühwirth-Schnatter, Sylvia & Wagner, Helga, 2010. "Stochastic model specification search for Gaussian and partial non-Gaussian state space models," Journal of Econometrics, Elsevier, vol. 154(1), pages 85-100, January.
    11. Bollerslev, Tim, 1986. "Generalized autoregressive conditional heteroskedasticity," Journal of Econometrics, Elsevier, vol. 31(3), pages 307-327, April.
    12. Jouchi Nakajima, 2012. "Bayesian Analysis Of Generalized Autoregressive Conditional Heteroskedasticity And Stochastic Volatility: Modeling Leverage, Jumps And Heavy‐Tails For Financial Time Series," The Japanese Economic Review, Japanese Economic Association, vol. 63(1), pages 81-103, March.
    13. Nakajima, Jouchi & Omori, Yasuhiro, 2012. "Stochastic volatility model with leverage and asymmetrically heavy-tailed error using GH skew Student’s t-distribution," Computational Statistics & Data Analysis, Elsevier, vol. 56(11), pages 3690-3704.
    14. Aguilar, Omar & West, Mike, 2000. "Bayesian Dynamic Factor Models and Portfolio Allocation," Journal of Business & Economic Statistics, American Statistical Association, vol. 18(3), pages 338-357, July.
    15. Harvey, Andrew C & Shephard, Neil, 1996. "Estimation of an Asymmetric Stochastic Volatility Model for Asset Returns," Journal of Business & Economic Statistics, American Statistical Association, vol. 14(4), pages 429-434, October.
    16. Kastner, Gregor, 2016. "Dealing with Stochastic Volatility in Time Series Using the R Package stochvol," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 69(i05).
    17. Jacquier, Eric & Polson, Nicholas G. & Rossi, P.E.Peter E., 2004. "Bayesian analysis of stochastic volatility models with fat-tails and correlated errors," Journal of Econometrics, Elsevier, vol. 122(1), pages 185-212, September.
    18. Yufeng Han, 2006. "Asset Allocation with a High Dimensional Latent Factor Stochastic Volatility Model," The Review of Financial Studies, Society for Financial Studies, vol. 19(1), pages 237-271.
    19. Darjus Hosszejni & Gregor Kastner, 2019. "Approaches Toward the Bayesian Estimation of the Stochastic Volatility Model with Leverage," Papers 1901.11491, arXiv.org, revised Nov 2019.
    20. Omori, Yasuhiro & Chib, Siddhartha & Shephard, Neil & Nakajima, Jouchi, 2007. "Stochastic volatility with leverage: Fast and efficient likelihood inference," Journal of Econometrics, Elsevier, vol. 140(2), pages 425-449, October.
    21. Gregor Kastner & Sylvia Fruhwirth-Schnatter & Hedibert Freitas Lopes, 2016. "Efficient Bayesian Inference for Multivariate Factor Stochastic Volatility Models," Papers 1602.08154, arXiv.org, revised Jul 2017.
    22. Engle, Robert F, 1982. "Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation," Econometrica, Econometric Society, vol. 50(4), pages 987-1007, July.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Ioannis Papageorgiou & Ioannis Kontoyiannis, 2023. "The Bayesian Context Trees State Space Model for time series modelling and forecasting," Papers 2308.00913, arXiv.org, revised Oct 2023.
    2. Sylvia Fruhwirth-Schnatter & Peter Knaus, 2022. "Sparse Bayesian State-Space and Time-Varying Parameter Models," Papers 2207.12147, arXiv.org.
    3. Anthony N. Rezitis & Gregor Kastner, 2021. "On the joint volatility dynamics in dairy markets," Papers 2104.12707, arXiv.org.
    4. Zexuan Yin & Paolo Barucca, 2022. "Variational Heteroscedastic Volatility Model," Papers 2204.05806, arXiv.org.
    5. Mauro Bernardi & Daniele Bianchi & Nicolas Bianco, 2022. "Smoothing volatility targeting," Papers 2212.07288, arXiv.org.
    6. Będowska-Sójka, Barbara & Kliber, Agata, 2022. "Can cryptocurrencies hedge oil price fluctuations? A pandemic perspective," Energy Economics, Elsevier, vol. 115(C).
    7. David Edmund Allen, 2020. "Stochastic Volatility and GARCH: Do Squared End-of-Day Returns Provide Similar Information?," JRFM, MDPI, vol. 13(9), pages 1-25, September.
    8. Niko Hauzenberger & Daniel Kaufmann & Rebecca Stuart & Cédric Tille, 2022. "What Drives Long-Term Interest Rates? Evidence from the Entire Swiss Franc History 1852-2020," IRENE Working Papers 22-03, IRENE Institute of Economic Research.
    9. Anthony N. Rezitis & Gregor Kastner, 2021. "On the joint volatility dynamics in international dairy commodity markets," Australian Journal of Agricultural and Resource Economics, Australian Agricultural and Resource Economics Society, vol. 65(3), pages 704-728, July.
    10. Omar Abbara & Mauricio Zevallos, 2022. "Maximum Likelihood Inference for Asymmetric Stochastic Volatility Models," Econometrics, MDPI, vol. 11(1), pages 1-18, December.
    11. Luis Gruber & Gregor Kastner, 2022. "Forecasting macroeconomic data with Bayesian VARs: Sparse or dense? It depends!," Papers 2206.04902, arXiv.org, revised Jul 2023.

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Gregor Kastner & Sylvia Fruhwirth-Schnatter & Hedibert Freitas Lopes, 2016. "Efficient Bayesian Inference for Multivariate Factor Stochastic Volatility Models," Papers 1602.08154, arXiv.org, revised Jul 2017.
    2. Anthony N. Rezitis & Gregor Kastner, 2021. "On the joint volatility dynamics in international dairy commodity markets," Australian Journal of Agricultural and Resource Economics, Australian Agricultural and Resource Economics Society, vol. 65(3), pages 704-728, July.
    3. Anthony N. Rezitis & Gregor Kastner, 2021. "On the joint volatility dynamics in dairy markets," Papers 2104.12707, arXiv.org.
    4. Lengua Lafosse, Patricia & Rodríguez, Gabriel, 2018. "An empirical application of a stochastic volatility model with GH skew Student's t-distribution to the volatility of Latin-American stock returns," The Quarterly Review of Economics and Finance, Elsevier, vol. 69(C), pages 155-173.
    5. Torben G. Andersen & Tim Bollerslev & Peter F. Christoffersen & Francis X. Diebold, 2005. "Volatility Forecasting," PIER Working Paper Archive 05-011, Penn Institute for Economic Research, Department of Economics, University of Pennsylvania.
    6. Patricia Lengua Lafosse & Cristian Bayes & Gabriel Rodríguez, 2015. "A Stochastic Volatility Model with GH Skew Student’s t-Distribution: Application to Latin-American Stock Returns," Documentos de Trabajo / Working Papers 2015-405, Departamento de Economía - Pontificia Universidad Católica del Perú.
    7. Andersen, Torben G. & Bollerslev, Tim & Christoffersen, Peter F. & Diebold, Francis X., 2006. "Volatility and Correlation Forecasting," Handbook of Economic Forecasting, in: G. Elliott & C. Granger & A. Timmermann (ed.), Handbook of Economic Forecasting, edition 1, volume 1, chapter 15, pages 777-878, Elsevier.
    8. Kastner, Gregor, 2019. "Sparse Bayesian time-varying covariance estimation in many dimensions," Journal of Econometrics, Elsevier, vol. 210(1), pages 98-115.
    9. Gael M. Martin & David T. Frazier & Ruben Loaiza-Maya & Florian Huber & Gary Koop & John Maheu & Didier Nibbering & Anastasios Panagiotelis, 2023. "Bayesian Forecasting in the 21st Century: A Modern Review," Monash Econometrics and Business Statistics Working Papers 1/23, Monash University, Department of Econometrics and Business Statistics.
    10. Willy Alanya & Gabriel Rodríguez, 2019. "Asymmetries in Volatility: An Empirical Study for the Peruvian Stock and Forex Markets," Review of Pacific Basin Financial Markets and Policies (RPBFMP), World Scientific Publishing Co. Pte. Ltd., vol. 22(01), pages 1-18, March.
    11. Manabu Asai & Michael McAleer & Jun Yu, 2006. "Multivariate Stochastic Volatility," Microeconomics Working Papers 22058, East Asian Bureau of Economic Research.
    12. Deschamps, Philippe J., 2011. "Bayesian estimation of an extended local scale stochastic volatility model," Journal of Econometrics, Elsevier, vol. 162(2), pages 369-382, June.
    13. Philipp Otto & Osman Dou{g}an & Suleyman Tac{s}p{i}nar & Wolfgang Schmid & Anil K. Bera, 2023. "Spatial and Spatiotemporal Volatility Models: A Review," Papers 2308.13061, arXiv.org.
    14. Gael M. Martin & David T. Frazier & Worapree Maneesoonthorn & Ruben Loaiza-Maya & Florian Huber & Gary Koop & John Maheu & Didier Nibbering & Anastasios Panagiotelis, 2022. "Bayesian Forecasting in Economics and Finance: A Modern Review," Papers 2212.03471, arXiv.org, revised Jul 2023.
    15. António Alberto Santos, 2015. "The evolution of the Volatility in Financial Returns: Realized Volatility vs Stochastic Volatility Measures," GEMF Working Papers 2015-10, GEMF, Faculty of Economics, University of Coimbra.
    16. Todd E. Clark & Francesco Ravazzolo, 2012. "The macroeconomic forecasting performance of autoregressive models with alternative specifications of time-varying volatility," Working Paper 2012/09, Norges Bank.
    17. David Edmund Allen, 2020. "Stochastic Volatility and GARCH: Do Squared End-of-Day Returns Provide Similar Information?," JRFM, MDPI, vol. 13(9), pages 1-25, September.
    18. Cross, Jamie L. & Hou, Chenghan & Trinh, Kelly, 2021. "Returns, volatility and the cryptocurrency bubble of 2017–18," Economic Modelling, Elsevier, vol. 104(C).
    19. Jensen, Mark J. & Maheu, John M., 2010. "Bayesian semiparametric stochastic volatility modeling," Journal of Econometrics, Elsevier, vol. 157(2), pages 306-316, August.
    20. Mike K. P. So & C. Y. Choi, 2009. "A threshold factor multivariate stochastic volatility model," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 28(8), pages 712-735.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:1906.12123. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.