Bayesian Markov Chain Monte Carlo (MCMC) Model for Estimating Hospital Service Waiting Time
DOI:
https://doi.org/10.59934/jaiea.v6i1.3079Keywords:
Bayesian Gamma Regression, hospital, MCMC, NUTS, patient waiting timeAbstract
Waiting time is an important indicator of hospital service quality because it relates directly to patient satisfaction and service efficiency. This study estimates patient waiting time using Bayesian Gamma Regression with a log link function, fitted by Markov Chain Monte Carlo (MCMC) with the No-U-Turn Sampler (NUTS). The Smart Hospital Appointment dataset of 10,000 records was used, with severity_level, appointment_type, department, and emergency_case as predictors, and an 80:20 train–test split. Observed waiting times ranged from 1 to 59 minutes (mean 25.20, SD 14.86). Severity level was the only predictor with a clearly identifiable association with waiting time: relative to High severity, the posterior mean coefficients for Low (1.37) and Medium (0.89) correspond to mean waiting times about 3.9 and 2.4 times longer, respectively, with 95% credible intervals excluding zero. Credible intervals for most department coefficients included zero, while several parameters (the intercept, emergency_case, and the appointment-type coefficients) were weakly identified, probably because of overlap between emergency_case and appointment_type. Sampling diagnostics were acceptable (R-hat ≤ 1.01; bulk ESS 437–1,778). On the test set, the model achieved an MAE of 7.75 minutes and an RMSE of 9.22 minutes, without comparison to a baseline model. The posterior predictive check showed that the model reproduces the general location of the data but not its shape, as the simulated distribution had a right tail beyond the observed maximum, indicating that the Gamma specification is only an approximation. These findings suggest that severity level largely determines expected waiting time in this dataset, and that the model requires further refinement before it can be used for operational prediction.
Downloads
References
K. Trinh, A. Staib, and A. Pak, “Forecasting emergency department waiting time using a state space representation,” Stat. Med., vol. 42, no. 24, pp. 4458–4483, 2023, doi: 10.1002/sim.9870.
H. Seo et al., “Prediction of hospitalization and waiting time within 24 hours of emergency department patients with unstructured text data,” Health Care Manag. Sci., vol. 27, no. 1, pp. 114–129, 2024, doi: 10.1007/s10729-023-09660-5.
P. A. Moreno-Sánchez, M. Aalto, and M. van Gils, “Prediction of patient flow in the emergency department using explainable artificial intelligence,” Digit. Health, vol. 10, 2024, doi: 10.1177/20552076241264194.
S. I. Watson, R. J. Lilford, J. Sun, and J. Bion, “Estimating the effect of health service delivery interventions on patient length of stay: A Bayesian survival analysis approach,” J. R. Stat. Soc. Ser. C (Appl. Stat.), vol. 70, no. 5, pp. 1164–1186, 2021, doi: 10.1111/rssc.12501.
K. Stone, R. Zwiggelaar, P. Jones, and N. Mac Parthaláin, “A systematic review of the prediction of hospital length of stay: Towards a unified framework,” PLOS Digit. Health, vol. 1, no. 4, p. e0000017, 2022, doi: 10.1371/journal.pdig.0000017.
I. Abdurrab et al., “Predicting the length of stay of cardiac patients based on pre-operative variables—Bayesian models vs. machine learning models,” Healthcare, vol. 12, no. 2, p. 249, 2024, doi: 10.3390/healthcare12020249.
G. A. Fernandez and K. P. Vatcheva, “A comparison of statistical methods for modeling count data with an application to hospital length of stay,” BMC Med. Res. Methodol., vol. 22, p. 211, 2022, doi: 10.1186/s12874-022-01685-8.
M. Taufiqurrochman and A. Oktaviarina, “Analisis perbandingan peramalan Indeks Harga Konsumen di Indonesia dengan metode Autoregressive Integrated Moving Average dan Bayesian Structural Time Series,” Jambura J. Probab. Stat., vol. 7, no. 1, 2026.
F. B. Arafat and P. P. Izati, “Pemodelan angka harapan hidup di Indonesia dengan pendekatan Bayesian: Bayesian Adaptive Sampling dan Bayesian Model Averaging dalam seleksi variabel,” 2025.
A. Munawar, E. H. B. Raharjo, H. Fadhilah, and R. Novriansyah, “Analisis sentimen netizen terhadap kenaikan Pajak Pertambahan Nilai (PPN) di media sosial X: Perbandingan algoritma Naive Bayes dan C4.5,” 2025.
I. M. A. A. Pramana, I. W. Sudiarsa, and P. G. S. C. Nugraha, “Penerapan algoritma Naive Bayes untuk prediksi penjualan produk terlaris pada CV Akusara Jaya Abadi,” J. Tek. Inform. dan Sist. Inf., vol. 10, no. 4, pp. 518–534, 2023, doi: 10.35957/jatisi.v10i4.6498.
R. Zulcharnain, G. Abdurrahman, and Daryanto, “Analisis sentimen ulasan Duolingo dengan metode algoritma Multinomial Naïve Bayes,” J. Inform. dan Teknol. Pendidik., 2025.
A. N. Oktaviani, A. S. Atmaja, K. Putri, S. A. Aprianto, and F. Kartiasih, “Analisis prediksi radiasi matahari dengan algoritma machine learning dan implementasi Bayesian Optimization di Provinsi DKI Jakarta,” J. Manaj. Inform. dan Sist. Inf., vol. 8, no. 1, pp. 45–58, 2025, doi: 10.36595/misi.v8i1.1338.
P. Antwi, G. Muhua, and E. Nyarko, “Bayesian spatio-temporal modeling and hotspot mapping of malaria risk in Ghana,” medRxiv, 2026, doi: 10.64898/2026.05.19.26353586.
D. K. Sewell and A. T. Arakkal, “bayesics: Core statistical methods via Bayesian inference in R,” arXiv, 2026. [Online]. Available: https://arxiv.org/abs/2602.15150
J.-W. Simons, B.-J. Boverhof, and E. Aarts, “The influence of observation sequence features on the performance of the Bayesian hidden Markov model: A Monte Carlo simulation study,” PLoS ONE, vol. 19, no. 12, p. e0314444, 2024, doi: 10.1371/journal.pone.0314444.
Y. Yang et al., “PriorGuide: Test-time prior adaptation for simulation-based inference,” in Proc. Int. Conf. Learn. Represent. (ICLR), 2026.
O. D. Matthew, M. K. Adisa, and E. E. Eno, “Which African countries are at risk of missing SDG 3.2? Bayesian mapping of under-five mortality using UNICEF 2024 data,” medRxiv, 2026, doi: 10.64898/2026.07.04.26357223.
T. Purwaningsih and Y. F. Hardi, “Penggunaan statistika Bayes dalam menganalisis pola suara Pemilu untuk mendeteksi potensi kecurangan,” J. New Trends Sci., vol. 3, no. 1, pp. 14–24, 2025, doi: 10.59031/jnts.v3i1.748.
S. T. Certo, L. A. Albader, K. E. Raney, and J. R. Busenbark, “A Bayesian approach to nested data analysis: A primer for strategic management research,” Glob. Strategy J., 2024, doi: 10.1177/14761270211072248.
Y. L. Hsu et al., “Bayesian learning: A selective overview,” arXiv, 2021. [Online]. Available: https://arxiv.org/abs/2112.12722
W. Xie, C. Li, Y. Wu, and P. Zhang, “A nonparametric Bayesian framework for uncertainty quantification in stochastic simulation,” SIAM/ASA J. Uncertain. Quantif., 2021, doi: 10.1137/20M1345517.
M. Plumlee and H. Lam, “An uncertainty quantification method for inexact simulation models,” SIAM/ASA J. Uncertain. Quantif., 2018.
R. Fung and B. Del Favero, “Backward simulation in Bayesian networks,” in Proc. 10th Annu. Conf. Uncertainty Artif. Intell., Morgan Kaufmann, 1994, pp. 227–234.
N. Tang, C. Liu, J. Q. Shi, and Y. Huang, “Editorial: Bayesian inference and AI,” Front. Big Data, vol. 5, p. 934362, 2022, doi: 10.3389/fdata.2022.934362.
G. K. Befekadu, “Simulation-based Bayesian inference with ameliorative learned summary statistics—Part I,” arXiv, 2026, doi: 10.48550/arXiv.2601.22441.
C. P. Robert and J. Rousseau, “A special issue on Bayesian inference: Challenges, perspectives and prospects,” Philos. Trans. R. Soc. A Math. Phys. Eng. Sci., vol. 381, no. 2247, p. 20220155, 2023, doi: 10.1098/rsta.2022.0155.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Journal of Artificial Intelligence and Engineering Applications (JAIEA)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.








