IDEAS home Printed from https://ideas.repec.org/a/eee/csdana/v214y2026ics0167947325001471.html

Kernel density estimation with a Markov chain Monte Carlo sample

Author

Listed:
  • Kim, Hang J.
  • MacEachern, Steven N.
  • Kim, Young Min
  • Jung, Yoonsuh

Abstract

Bayesian inference relies on the posterior distribution, which is often estimated with a Markov chain Monte Carlo sampler. The sampler produces a dependent stream of variates from the limiting distribution of the Markov chain, the posterior distribution. When one wishes to display the estimated posterior density, a natural choice is the histogram. However, abundant literature has shown that the kernel density estimator is more accurate than the histogram in terms of mean integrated squared error for an i.i.d. sample. With this as motivation, a kernel density estimation method is proposed that is appropriate for the dependence in the Markov chain Monte Carlo output. To account for the dependence, the cross-validation criterion is modified to select the bandwidth in standard kernel density estimation approaches. A data-driven adjustment to the biased cross-validation method is suggested with introducing the integrated autocorrelation time of the kernel. The convergence of the modified bandwidth to the optimal bandwidth is shown by adapting theorems from the time series literature. Simulation studies show that the proposed method finds the bandwidth close to the optimal value, while standard methods lead to smaller bandwidths under Markov chain samples and hence to undersmoothed density estimates. A study with real data shows that the proposed method has a considerably smaller integrated mean squared error than standard methods. The R package KDEmcmc to implement the suggested algorithm is available on the Comprehensive R Archive Network.

Suggested Citation

  • Kim, Hang J. & MacEachern, Steven N. & Kim, Young Min & Jung, Yoonsuh, 2026. "Kernel density estimation with a Markov chain Monte Carlo sample," Computational Statistics & Data Analysis, Elsevier, vol. 214(C).
  • Handle: RePEc:eee:csdana:v:214:y:2026:i:c:s0167947325001471
    DOI: 10.1016/j.csda.2025.108271
    as

    Download full text from publisher

    File URL: http://www.sciencedirect.com/science/article/pii/S0167947325001471
    Download Restriction: Full text for ScienceDirect subscribers only.

    File URL: https://libkey.io/10.1016/j.csda.2025.108271?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to

    for a different version of it.

    References listed on IDEAS

    as
    1. Fabian Krüger & Sebastian Lerch & Thordis Thorarinsdottir & Tilmann Gneiting, 2021. "Predictive Inference Based on Markov Chain Monte Carlo Output," International Statistical Review, International Statistical Institute, vol. 89(2), pages 274-301, August.
    2. Jones, M. C. & Sheather, S. J., 1991. "Using non-stochastic terms to advantage in kernel-based estimation of integrated squared density derivatives," Statistics & Probability Letters, Elsevier, vol. 11(6), pages 511-514, June.
    3. M. Sköld & G. O. Roberts, 2003. "Density Estimation for the Metropolis–Hastings Algorithm," Scandinavian Journal of Statistics, Danish Society for Theoretical Statistics;Finnish Statistical Society;Norwegian Statistical Association;Swedish Statistical Association, vol. 30(4), pages 699-718, December.
    Full references (including those not matched with items on IDEAS)

    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. Warne, Anders, 2023. "DSGE model forecasting: rational expectations vs. adaptive learning," Working Paper Series 2768, European Central Bank.
    2. Duong, Tarn & Hazelton, Martin L., 2005. "Convergence rates for unconstrained bandwidth matrix selectors in multivariate kernel density estimation," Journal of Multivariate Analysis, Elsevier, vol. 93(2), pages 417-433, April.
    3. HÃ¥vard Hegre & Paola Vesco & Michael Colaresi & Jonas Vestby & Alexa Timlick & Noorain Syed Kazmi & Angelica Lindqvist-McGowan & Friederike Becker & Marco Binetti & Tobias Bodentien & Tobias Bohne & , 2025. "The 2023/24 VIEWS Prediction challenge: Predicting the number of fatalities in armed conflict, with uncertainty," Journal of Peace Research, Peace Research Institute Oslo, vol. 62(6), pages 2070-2087, November.
    4. José E. Chacón & Carlos Tenreiro, 2012. "Exact and Asymptotically Optimal Bandwidths for Kernel Estimation of Density Functionals," Methodology and Computing in Applied Probability, Springer, vol. 14(3), pages 523-548, September.
    5. Mokkadem, Abdelkader & Pelletier, Mariane, 2020. "Online estimation of integrated squared density derivatives," Statistics & Probability Letters, Elsevier, vol. 166(C).
    6. J. Liao & Yujun Wu & Yong Lin, 2010. "Improving Sheather and Jones’ bandwidth selector for difficult densities in kernel density estimation," Journal of Nonparametric Statistics, Taylor & Francis Journals, vol. 22(1), pages 105-114.
    7. Hall, Peter & Wolff, Rodney C. L., 1995. "Estimators of integrals of powers of density derivatives," Statistics & Probability Letters, Elsevier, vol. 24(2), pages 105-110, August.
    8. Rudolf Grübel, 1994. "Estimation of density functionals," Annals of the Institute of Statistical Mathematics, Springer;The Institute of Statistical Mathematics, vol. 46(1), pages 67-75, March.
    9. Bobeica, Elena & Hartwig, Benny, 2023. "The COVID-19 shock and challenges for inflation modelling," International Journal of Forecasting, Elsevier, vol. 39(1), pages 519-539.
    10. Alexey Miroshnikov & Evgeny Savelev, 2019. "Asymptotic properties of parallel Bayesian kernel density estimators," Annals of the Institute of Statistical Mathematics, Springer;The Institute of Statistical Mathematics, vol. 71(4), pages 771-810, August.
    11. Karim M Abadir & Michel Lubrano, 2024. "Explicit solutions for the asymptotically optimal bandwidth in cross-validation," Biometrika, Biometrika Trust, vol. 111(3), pages 809-823.
    12. T. Sclocco & M. Marzio, 2001. "A note on kernel density estimation for non-negative random variables," Statistical Methods & Applications, Springer;Società Italiana di Statistica, vol. 10(1), pages 67-79, January.
    13. Fabian Krüger & Sebastian Lerch & Thordis Thorarinsdottir & Tilmann Gneiting, 2021. "Predictive Inference Based on Markov Chain Monte Carlo Output," International Statistical Review, International Statistical Institute, vol. 89(2), pages 274-301, August.
    14. Malte Knuppel & Fabian Kruger & Marc-Oliver Pohle, 2022. "Score-based calibration testing for multivariate forecast distributions," Papers 2211.16362, arXiv.org, revised Dec 2023.
    15. Tao Hu & Xinyan Zhu & Lian Duan & Wei Guo, 2018. "Urban crime prediction based on spatio-temporal Bayesian model," PLOS ONE, Public Library of Science, vol. 13(10), pages 1-18, October.
    16. Adjemian, Stéphane & Bastani, Houtan & Juillard, Michel & Karamé, Fréderic & Mihoubi, Ferhat & Mutschler, Willi & Pfeifer, Johannes & Ratto, Marco & Rion, Normann & Villemot, Sébastien, 2022. "Dynare: Reference Manual Version 5," Dynare Working Papers 72, CEPREMAP, revised Mar 2023.
      • Stéphane Adjemian & Houtan Bastani & Michel Juillard & Frédéric Karamé & Ferhat Mihoubi & Willi Mutschler & Johannes Pfeifer & Marco Ratto & Sébastien Villemot & Normann Rion, 2023. "Dynare: Reference Manual Version 5," PSE Working Papers hal-04219920, HAL.
      • Stéphane Adjemian & Houtan Bastani & Michel Juillard & Frédéric Karamé & Ferhat Mihoubi & Willi Mutschler & Johannes Pfeifer & Marco Ratto & Sébastien Villemot & Normann Rion, 2023. "Dynare: Reference Manual Version 5," Working Papers hal-04219920, HAL.
    17. Gergely Ganics & Barbara Rossi & Tatevik Sekhposyan, 2024. "From Fixed‐Event to Fixed‐Horizon Density Forecasts: Obtaining Measures of Multihorizon Uncertainty from Survey Density Forecasts," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 56(7), pages 1675-1704, October.
    18. Julius Goes & Henriette Engelhardt, 2026. "Probabilistic population forecasts for small regions," Demographic Research, Max Planck Institute for Demographic Research, Rostock, Germany, vol. 54(23), pages 719-762.
    19. Moreira, C. & Van Keilegom, I., 2013. "Bandwidth selection for kernel density estimation with doubly truncated data," Computational Statistics & Data Analysis, Elsevier, vol. 61(C), pages 107-123.
    20. Christopher Withers & Saralees Nadarajah, 2011. "Nonparametric confidence intervals for the integral of a function of an unknown density," Journal of Nonparametric Statistics, Taylor & Francis Journals, vol. 23(4), pages 943-966.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;

    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:eee:csdana:v:214:y:2026:i:c:s0167947325001471. 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: Catherine Liu (email available below). General contact details of provider: http://www.elsevier.com/locate/csda .

    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.