Fast Riemannian Manifold Hamiltonian Monte Carlo for Hierarchical Gaussian Process Models
Abstract
1. Introduction
2. Methods and Algorithms
2.1. Preliminaries
2.1.1. Hierarchical GP Models and Their Approximate Representations
2.1.2. RMHMC with a Soft-Absolute Hessian Metric
| Algorithm 1 (RM)HMC |
|
2.2. Two Sources of Redundancy in the Previous Implementations
2.2.1. Order of Computations in the Calculation of Gradient Flow
2.2.2. Dynamically Programmed Eigendecomposition
2.3. Methods of Numerical Experiments
2.3.1. Examination of Computational Complexity
2.3.2. Analysis of 1987 National Medical Expenditure Survey (NMES)
3. Results
3.1. Comparison Among Different Implementations of RMHMC with a Soft-Absolute Hessian Metric
3.2. Comparison with NUT-HMC Sampler
3.3. Calculation of BME Beyond the Laplace Approximation with Simulated Data and NMES Data
4. Discussion
Supplementary Materials
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A. Reduced-Rank Representation of GPs (Svensson et al. and Solin and Särkkä)
| Symbols | Description |
|---|---|
| The sets of real numbers and d-dimensional Euclidean space | |
| The smallest integer that is greater than or equals a | |
| , | Transposition of vector v and matrix A |
| The i-th element of vector v | |
| The element of matrix A in the i-th row of the j-th column | |
| 1 | Vector whose i-th element is |
| 2 | Matrix whose i-th row of the j-th column is |
| Diagonal matrix whose i-th element is | |
| The trace of matrix A | |
| Element a of a set | |
| The Hadamard product of A and B | |
| The number of elements in a set | |
| () | Expectation of the argument random variable (for the specified distribution) |
| Variance of the argument random variable | |
| Empirical standard deviation of the argument variable | |
| Equation defining the object on the left-hand side | |
| Abbreviation of | |
| , () | Independently and identically distributed (objects drawn from the right-hand side) |
| Uniform probability distribution over the open interval | |
| Gaussian probability distribution with mean and (co)variance | |
| Inverse Gamma probability distribution with shape and scale parameters | |
| Bernoulli probability distribution (value 1 with probability p, or 0 otherwise) |
Appendix B. MC Integration for the Calculation of BME (Calderhead and Girolami)
Appendix C. Calculation of BME Values Using INLA
References
- Lawrence, N. Gaussian process latent variable models for visualisation of high dimensional data. Adv. Neural Inf. Process. Syst. 2003, 16, 329. [Google Scholar]
- Wang, J.; Hertzmann, A.; Fleet, D.J. Gaussian process dynamical models. Adv. Neural Inf. Process. Syst. 2005, 18, 1441–1448. [Google Scholar]
- Williams, C.K.; Rasmussen, C.E. Gaussian Processes for Machine Learning; MIT Press: Cambridge, MA, USA, 2006; Volume 2. [Google Scholar]
- van der Vaart, A.W.; van Zanten, J.H. Rates of contraction of posterior distributions based on Gaussian process priors. Ann. Stat. 2008, 36, 1435–1463. [Google Scholar] [CrossRef] [Scilit]
- van der Vaart, A.; van Zanten, H. Information Rates of Nonparametric Gaussian Process Methods. J. Mach. Learn. Res. 2011, 12, 2095–2119. [Google Scholar]
- Suzuki, T. PAC-Bayesian Bound for Gaussian Process Regression and Multiple Kernel Additive Model. In Proceedings of the 25th Annual Conference on Learning Theory, Edinburgh, UK, 25–27 June 2012; Mannor, S., Srebro, N., Williamson, R.C., Eds.; PMLR: Cambridge, MA, USA, 2012; Volume 23, pp. 8.1–8.20. [Google Scholar]
- Iwata, T.; Duvenaud, D.; Ghahramani, Z. Warped mixtures for nonparametric cluster shapes. In Proceedings of the Twenty-Ninth Conference on Uncertainty in Artificial Intelligence, Bellevue, WA, USA, 11–15 August 2013; pp. 311–320. [Google Scholar]
- Damianou, A.; Lawrence, N.D. Deep Gaussian Processes. In Proceedings of the Sixteenth International Conference on Artificial Intelligence and Statistics, Scottsdale, AZ, USA, 29 April–1 May 2013; Carvalho, C.M., Ravikumar, P., Eds.; PMLR: Cambridge, MA, USA, 2013; Volume 31, pp. 207–215. [Google Scholar]
- Frigola, R.; Lindsten, F.; Schön, T.B.; Rasmussen, C.E. Bayesian Inference and Learning in Gaussian Process State-Space Models with Particle MCMC. In Proceedings of the Advances in Neural Information Processing Systems; Burges, C., Bottou, L., Welling, M., Ghahramani, Z., Weinberger, K., Eds.; Curran Associates, Inc.: New York, NY, USA, 2013; Volume 26. [Google Scholar]
- Svensson, A.; Solin, A.; Särkkä, S.; Schön, T. Computationally Efficient Bayesian Learning of Gaussian Process State Space Models. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, Cadiz, Spain, 9–11 May 2016; Gretton, A., Robert, C.C., Eds.; PMLR: Cambridge, MA, USA, 2016; Volume 51, pp. 213–221. [Google Scholar]
- Yerramilli, S.; Iyer, A.; Chen, W.; Apley, D.W. Fully Bayesian Inference for Latent Variable Gaussian Process Models. SIAM/ASA J. Uncertain. Quantif. 2023, 11, 1357–1381. [Google Scholar] [CrossRef] [Scilit]
- Finocchio, G.; Schmidt-Hieber, J. Posterior Contraction for Deep Gaussian Process Priors. J. Mach. Learn. Res. 2023, 24, 1–49. [Google Scholar]
- Bishop, C.M. Pattern Recognition and Machine Learning; Springer: Berlin/Heidelberg, Germany, 2006; Volume 4. [Google Scholar]
- Paquet, U.; Fraccaro, M. An Efficient Implementation of Riemannian Manifold Hamiltonian Monte Carlo for Gaussian Process Models. arXiv 2018, arXiv:1810.11893. [Google Scholar] [CrossRef] [Scilit]
- Pandita, P.; Tsilifis, P.; Ghosh, S.; Wang, L. Scalable Fully Bayesian Gaussian Process Modeling and Calibration with Adaptive Sequential Monte Carlo for Industrial Applications. J. Mech. Des. 2021, 143, 074502. [Google Scholar] [CrossRef] [Scilit]
- Matthews, A.G.d.G.; van der Wilk, M.; Nickson, T.; Fujii, K.; Boukouvalas, A.; León-Villagrá, P.; Ghahramani, Z.; Hensman, J. GPflow: A Gaussian process library using TensorFlow. J. Mach. Learn. Res. 2017, 18, 1–6. [Google Scholar]
- Gardner, J.; Pleiss, G.; Weinberger, K.Q.; Bindel, D.; Wilson, A.G. GPyTorch: Blackbox Matrix-Matrix Gaussian Process Inference with GPU Acceleration. In Proceedings of the Advances in Neural Information Processing Systems; Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., Garnett, R., Eds.; Curran Associates, Inc.: New York, NY, USA, 2018; Volume 31. [Google Scholar]
- Kimeldorf, G.S.; Wahba, G. A correspondence between Bayesian estimation on stochastic processes and smoothing by splines. Ann. Math. Stat. 1970, 41, 495–502. [Google Scholar] [CrossRef] [Scilit]
- Rue, H.; Martino, S.; Chopin, N. Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. J. R. Stat. Soc. Ser. B (Stat. Methodol.) 2009, 71, 319–392. [Google Scholar] [CrossRef] [Scilit]
- Lunn, D.; Spiegelhalter, D.; Thomas, A.; Best, N. The BUGS project: Evolution, critique and future directions. Stat. Med. 2009, 28, 3049–3067. [Google Scholar] [CrossRef] [Scilit]
- Team, S.D. Stan Reference Manual, Version 2.37. 2025. Available online: https://mc-stan.org/docs/reference-manual/ (accessed on 1 November 2025).
- Lindgren, F.; Rue, H. Bayesian Spatial Modelling with R-INLA. J. Stat. Softw. 2015, 63, 1–25. [Google Scholar] [CrossRef] [Scilit]
- Taylor, B.M.; Diggle, P.J. INLA or MCMC? A tutorial and comparative evaluation for spatial prediction in log-Gaussian Cox processes. J. Stat. Comput. Simul. 2014, 84, 2266–2284. [Google Scholar] [CrossRef] [Scilit]
- Rue, H.; Riebler, A.; Sorbye, S.H.; Illian, J.B.; Simpson, D.P.; Lindgren, F.K. Bayesian Computing with INLA: A Review. Annu. Rev. Stat. Its Appl. 2017, 4, 395–421. [Google Scholar] [CrossRef] [Scilit]
- Watanabe, S. Algebraic Geometry and Statistical Learning Theory; Cambridge University Press: Cambridge, UK, 2009; Volume 25. [Google Scholar]
- Martins, T.G.; Rue, H. Extending integrated nested Laplace approximation to a class of near-Gaussian latent models. Scand. J. Stat. 2014, 41, 893–912. [Google Scholar] [CrossRef] [Scilit]
- Hensman, J.; Matthews, A.G.d.G.; Filippone, M.; Ghahramani, Z. MCMC for variationally sparse Gaussian processes. In Proceedings of the 29th International Conference on Neural Information Processing Systems, Cambridge, MA, USA, 22–26 November 2015; NIPS’15. Volume 1, pp. 1648–1656. [Google Scholar]
- Betancourt, M.J. A general metric for Riemannian manifold Hamiltonian Monte Carlo. In International Conference on Geometric Science of Information; Springer: Berlin/Heidelberg, Germany, 2013; pp. 327–334. [Google Scholar]
- Cobb, A.D.; Baydin, A.G.; Markham, A.; Roberts, S.J. Introducing an Explicit Symplectic Integration Scheme for Riemannian Manifold Hamiltonian Monte Carlo. arXiv 2019, arXiv:1910.06243. [Google Scholar] [CrossRef] [Scilit]
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. PyTorch: An imperative style, high-performance deep learning library. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, Vancouver, BC, Canada, 8–14 December 2019; Curran Associates Inc.: Red Hook, NY, USA, 2019. [Google Scholar]
- Abadi, M.; Agarwal, A.; Barham, P.; Brevdo, E.; Chen, Z.; Citro, C.; Corrado, G.S.; Davis, A.; Dean, J.; Devin, M.; et al. TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems, 2015. Software. Available online: http://tensorflow.org/ (accessed on 1 November 2025).
- Fawzi, H.; Goulbourne, H. Faster proximal algorithms for matrix optimization using Jacobi-based eigenvalue methods. In Proceedings of the Advances in Neural Information Processing Systems; Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., Vaughan, J.W., Eds.; Curran Associates, Inc.: New York, NY, USA, 2021; Volume 34, pp. 11397–11408. [Google Scholar]
- Van Weert, P.; Gregoire, M. C++ 17 Standard Library Quick Reference: A Pocket Guide to Data Structures, Algorithms, and Functions; Apress: New York, NY, USA, 2019. [Google Scholar]
- NVIDA Inc. NVIDA HPC SDK Version 23.1 Documentation. 2023. Available online: https://docs.nvidia.com/hpc-sdk/archive/23.1/index.html (accessed on 5 November 2025).
- Solin, A.; Särkkä, S. Hilbert space methods for reduced-rank Gaussian process regression. Stat. Comput. 2020, 30, 419–446. [Google Scholar] [CrossRef] [Scilit]
- Park, S.; Choi, S. Hierarchical Gaussian process regression. In Proceedings of the 2nd Asian Conference on Machine Learning, JMLR Workshop and Conference Proceedings, Tokyo, Japan, 8–10 November 2010; pp. 95–110. [Google Scholar]
- Bach, F.; Jordan, M. Kernel independent component analysis. J. Mach. Learn. Res. 2003, 3, 1–48. [Google Scholar]
- Duane, S.; Kennedy, A.; Pendleton, B.J.; Roweth, D. Hybrid Monte Carlo. Phys. Lett. B 1987, 195, 216–222. [Google Scholar] [CrossRef] [Scilit]
- Neal, R.M. Probabilistic Inference Using Markov Chain MONTE Carlo Methods. 1993. Available online: https://www.cs.princeton.edu/courses/archive/fall07/cos597C/readings/Neal1993.pdf (accessed on 1 November 2025).
- Neal, R.M. Bayesian Learning for Neural Networks; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2012; Volume 118. [Google Scholar]
- Girolami, M.; Calderhead, B. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. J. R. Stat. Soc. Ser. B (Stat. Methodol.) 2011, 73, 123–214. [Google Scholar] [CrossRef] [Scilit]
- Gall, F.L.; Urrutia, F. Improved rectangular matrix multiplication using powers of the coppersmith-winograd tensor. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, New Orleans, LA, USA, 7–10 January 2018; pp. 1029–1046. [Google Scholar]
- van Kempen, H.P.M. On the quadratic convergence of the special cyclic Jacobi method. Numer. Math. 1966, 9, 19–22. [Google Scholar] [CrossRef] [Scilit]
- Golub, G.H.; Van Loan, C.F. Matrix Computations; JHU Press: Baltimore, MD, USA, 2013. [Google Scholar]
- Johnson, E.; Dominici, F.; Griswold, M.; Zeger, S.L. Disease cases and their medical costs attributable to smoking: An analysis of the national medical expenditure survey. J. Econom. 2003, 112, 135–151. [Google Scholar] [CrossRef] [Scilit]
- Imai, K.; Van Dyk, D.A. Causal inference with general treatment regimes: Generalizing the propensity score. J. Am. Stat. Assoc. 2004, 99, 854–866. [Google Scholar] [CrossRef] [Scilit]
- Galagate, D.; Schafer, J.L. Causal Inference with a Continuous Treatment and Outcome: Alternative Estimators for Parametric Dose-Response Functions with Applications. Ph.D. Thesis, University of Maryland, College Park, MD, USA, 2016. [Google Scholar] [CrossRef]
- NVIDIA Inc. NVIDIA Developer Forum: CUBLAS Dgemm Performance Query. 2012. Available online: https://forums.developer.nvidia.com/t/reasonable-timing-with-cublas-dgemm-and-sgemm/14261 (accessed on 5 November 2025).
- Lung-Sheng, C. Jacobi-Based Eigenvalue Solver on GPU. A Shared Slide Presented in GPU Technology Conference. 2017. Available online: https://on-demand.gputechconf.com/gtc/2017/presentation/s7121-lung-sheng-chien-jacobi-based-eigenvalue-solver.pdf (accessed on 1 June 2022).
- Hoffman, M.D.; Gelman, A. The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo. J. Mach. Learn. Res. 2014, 15, 1593–1623. [Google Scholar]
- Betancourt, M.J. Generalizing the No-U-Turn Sampler to Riemannian Manifolds. arXiv 2013, arXiv:1304.1920. [Google Scholar]
- Cheng, X.; Chatterji, N.S.; Bartlett, P.L.; Jordan, M.I. Underdamped Langevin MCMC: A non-asymptotic analysis. In Proceedings of the 31st Conference On Learning Theory, Stockholm, Sweden, 6–9 July 2018; Bubeck, S., Perchet, V., Rigollet, P., Eds.; PMLR: Cambridge, MA, USA, 2018; Volume 75, pp. 300–323. [Google Scholar]
- Dalalyan, A.S.; Riou-Durand, L. On sampling from a log-concave density using kinetic Langevin diffusions. Bernoulli 2020, 26, 1956–1988. [Google Scholar] [CrossRef] [Scilit]
- Conn, A.R.; Gould, N.I.; Toint, P.L. Trust Region Methods; SIAM: Philadelphia, PA, USA, 2000. [Google Scholar]
- Green, P.J. Reversible jump Markov chain Monte Carlo computation and Bayesian model determination. Biometrika 1995, 82, 711–732. [Google Scholar] [CrossRef]
- Karagiannis, G.; Andrieu, C. Annealed Importance Sampling Reversible Jump MCMC Algorithms. J. Comput. Graph. Stat. 2013, 22, 623–648. [Google Scholar] [CrossRef] [Scilit]
- Moral, P. Feynman-Kac Formulae: Genealogical and Interacting Particle Systems with Applications; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
- Chopin, N.; Papaspiliopoulos, O. An Introduction to Sequential Monte Carlo; Springer: Berlin/Heidelberg, Germany, 2020; Volume 4. [Google Scholar]
- Chernozhukov, V.; Chetverikov, D.; Demirer, M.; Duflo, E.; Hansen, C.; Newey, W.; Robins, J. Double/debiased machine learning for treatment and structural parameters. Econom. J. 2018, 21, C1–C68. [Google Scholar] [CrossRef] [Scilit]
- Hayakawa, T.; Asai, S. Debiased Maximum Likelihood Estimators of Hazard Ratios Under Kernel-Based Machine Learning Adjustment. Mathematics 2025, 13, 3092. [Google Scholar] [CrossRef] [Scilit]
- Chandrasekaran, S.; Juckeland, G. OpenACC for Programmers: Concepts and Strategies; Addison-Wesley Professional: Boston, MA, USA, 2017. [Google Scholar]
- Farber, R. Parallel Programming with OpenACC; Newnes: Boston, MA, USA, 2016. [Google Scholar]
- Reinders, J.; Ashbaugh, B.; Brodman, J.; Kinsner, M.; Pennycook, J.; Tian, X. Data Parallel C++: Mastering DPC++ for Programming of Heterogeneous Systems Using C++ and SYCL; Springer Nature: Berlin/Heidelberg, Germany, 2021. [Google Scholar]
- Watanabe, S. A widely applicable Bayesian information criterion. J. Mach. Learn. Res. 2013, 14, 867–897. [Google Scholar]
- Drton, M.; Plummer, M. A Bayesian Information Criterion for Singular Models. J. R. Stat. Soc. Ser. B Stat. Methodol. 2017, 79, 323–380. [Google Scholar] [CrossRef] [Scilit]
- Calderhead, B.; Girolami, M. Estimating Bayes factors via thermodynamic integration and population MCMC. Comput. Stat. Data Anal. 2009, 53, 4028–4045. [Google Scholar] [CrossRef] [Scilit]
- Hubin, A.; Storvik, G. Estimating the marginal likelihood with Integrated nested Laplace approximation (INLA). arXiv 2016, arXiv:1611.01450. [Google Scholar] [CrossRef] [Scilit]
- Gómez-Rubio, V.; Rue, H. Markov chain Monte Carlo with the Integrated Nested Laplace Approximation. Stat. Comput. 2018, 28, 1033–1051. [Google Scholar] [CrossRef] [Scilit]
- Liu, D.C.; Nocedal, J. On the limited memory BFGS method for large scale optimization. Math. Program. 1989, 45, 503–528. [Google Scholar] [CrossRef] [Scilit]



| Data | Model | Algorithm | Estimated BME | Wall Time (s) | # MC (Z) |
|---|---|---|---|---|---|
| Simulation | NL-logistic | prop. method | 16,243 | 50 | |
| Simulation | NL-logistic | INLA | 11,884 | - | |
| NMES | L-mean | prop. method | −11,716.78 | 43,314 | 10 |
| NMES | L-mean | INLA | −11,746.10 | - | |
| NMES | NL-mean | prop.method | −11,602.37 | 49,648 | 10 |
| NMES | NL-mean | INLA | −11,606.00 | 1,407,963 | - |
| NMES | L-mean/var | prop. method | 49,424 | 10 | |
| NMES | L-mean/var | INLA | - | ||
| NMES | NL-mean/var | prop. method | 52,284 | 10 | |
| NMES | NL-mean/var | INLA | - | ≥6,000,000 | - |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Hayakawa, T.; Asai, S. Fast Riemannian Manifold Hamiltonian Monte Carlo for Hierarchical Gaussian Process Models. Mathematics 2026, 14, 146. https://doi.org/10.3390/math14010146
Hayakawa T, Asai S. Fast Riemannian Manifold Hamiltonian Monte Carlo for Hierarchical Gaussian Process Models. Mathematics. 2026; 14(1):146. https://doi.org/10.3390/math14010146
Chicago/Turabian StyleHayakawa, Takashi, and Satoshi Asai. 2026. "Fast Riemannian Manifold Hamiltonian Monte Carlo for Hierarchical Gaussian Process Models" Mathematics 14, no. 1: 146. https://doi.org/10.3390/math14010146
APA StyleHayakawa, T., & Asai, S. (2026). Fast Riemannian Manifold Hamiltonian Monte Carlo for Hierarchical Gaussian Process Models. Mathematics, 14(1), 146. https://doi.org/10.3390/math14010146

