IDEAS home Printed from
   My bibliography  Save this article

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


  • Kastner, Gregor


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.

Suggested Citation

  • 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).
  • Handle: RePEc:jss:jstsof:v:069:i05

    Download full text from publisher

    File URL:
    Download Restriction: no

    File URL:
    Download Restriction: no

    File URL:
    Download Restriction: no

    References listed on IDEAS

    1. 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.
    2. Kastner, Gregor & Frühwirth-Schnatter, Sylvia, 2014. "Ancillarity-sufficiency interweaving strategy (ASIS) for boosting MCMC estimation of stochastic volatility models," Computational Statistics & Data Analysis, Elsevier, vol. 76(C), pages 408-423.
    3. 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.
    Full references (including those not matched with items on IDEAS)


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

    Cited by:

    1. Martin Feldkircher & Thomas Gruber & Florian Huber, 2017. "Spreading the word or reducing the term spread? Assessing spillovers from euro area monetary policy," Department of Economics Working Papers wuwp248, Vienna University of Economics and Business, Department of Economics.
    2. Manfred M. Fischer & Florian Huber & Michael Pfarrhofer, 2018. "The transmission of uncertainty shocks on income inequality: State-level evidence from the United States," Papers 1806.08278,
    3. repec:eee:ecolet:v:173:y:2018:i:c:p:158-163 is not listed on IDEAS
    4. Florian Huber & Gregor Kastner & Martin Feldkircher, 2016. "Should I stay or should I go? Bayesian inference in the threshold time varying parameter (TTVP) model," Department of Economics Working Papers wuwp235, Vienna University of Economics and Business, Department of Economics.
    5. Huber, Florian & Punzi, Maria Teresa, 2016. "International housing markets, unconventional monetary policy and the zero lower bound," FinMaP-Working Papers 58, Collaborative EU Project FinMaP - Financial Distortions and Macroeconomic Performance: Expectations, Constraints and Interaction of Agents.
    6. Niko Hauzenberger & Maximilian Bock & Michael Pfarrhofer & Anna Stelzer & Gregor Zens, 2018. "Implications of macroeconomic volatility in the Euro area," Papers 1801.02925,, revised Jun 2018.
    7. Christian Hotz‐Behofsits & Florian Huber & Thomas Otto Zörner, 2018. "Predicting crypto‐currencies using sparse non‐Gaussian state space models," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 37(6), pages 627-640, September.
    8. Florian Huber & Daniel Kaufmann, 2015. "Trend Fundamentals and Exchange Rate Dynamics," KOF Working papers 15-393, KOF Swiss Economic Institute, ETH Zurich.
    9. Gregor Kastner, 2016. "Sparse Bayesian time-varying covariance estimation in many dimensions," Papers 1608.08468,, revised Nov 2017.
    10. Chuliá, Helena & Guillén, Montserrat & Uribe, Jorge M., 2017. "Measuring uncertainty in the stock market," International Review of Economics & Finance, Elsevier, vol. 48(C), pages 18-33.
    11. Florian Huber, 2018. "Dealing with cross-country heterogeneity in panel VARs using finite mixture models," Papers 1804.01554,
    12. Liu, Wei-han, 2016. "A re-examination of maturity effect of energy futures price from the perspective of stochastic volatility," Energy Economics, Elsevier, vol. 56(C), pages 351-362.
    13. Martin Feldkircher & Florian Huber & Gregor Kastner, 2017. "Sophisticated and small versus simple and sizeable: When does it pay off to introduce drifting coefficients in Bayesian VARs?," Papers 1711.00564,, revised Nov 2017.
    14. Arthur T. Rego & Thiago R. dos Santos, 2018. "Non-Gaussian Stochastic Volatility Model with Jumps via Gibbs Sampler," Papers 1809.01501,, revised Oct 2018.
    15. Joshua C. C. Chan, 2018. "Specification tests for time-varying parameter models with stochastic volatility," Econometric Reviews, Taylor & Francis Journals, vol. 37(8), pages 807-823, September.
    16. Sophie Altermatt, Simon Beyeler, 2018. "Shall We Twist?," Diskussionsschriften dp1825, Universitaet Bern, Departement Volkswirtschaft.
    17. repec:eee:dyncon:v:93:y:2018:i:c:p:218-238 is not listed on IDEAS
    18. repec:eee:stapro:v:136:y:2018:i:c:p:51-57 is not listed on IDEAS
    19. Jean-Jacques Forneron, 2019. "A Sieve-SMM Estimator for Dynamic Models," Papers 1902.01456,
    20. Afees A. Salisu & Ahamuefula Ephraim Ogbonna, 2018. "Does time-variation matter in the stochastic volatility components for G7 stock returns," Working Papers 062, Centre for Econometric and Allied Research, University of Ibadan.
    21. repec:eee:csdana:v:127:y:2018:i:c:p:187-203 is not listed on IDEAS

    More about this item


    Access and download statistics


    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:jss:jstsof:v:069:i05. See general information about how to correct material in RePEc.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: (Christopher F. Baum). General contact details of provider: .

    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 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.

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

    IDEAS is a RePEc service hosted by the Research Division of the Federal Reserve Bank of St. Louis . RePEc uses bibliographic data supplied by the respective publishers.