A Software Tool for Estimating Uncertainty of Bayesian Posterior Probability for Disease

The role of medical diagnosis is essential in patient care and healthcare. Established diagnostic practices typically rely on predetermined clinical criteria and numerical thresholds. In contrast, Bayesian inference provides an advanced framework that supports diagnosis via in-depth probabilistic analysis. This study’s aim is to introduce a software tool dedicated to the quantification of uncertainty in Bayesian diagnosis, a field that has seen minimal exploration to date. The presented tool, a freely available specialized software program, utilizes uncertainty propagation techniques to estimate the sampling, measurement, and combined uncertainty of the posterior probability for disease. It features two primary modules and fifteen submodules, all designed to facilitate the estimation and graphical representation of the standard uncertainty of the posterior probability estimates for diseased and non-diseased population samples, incorporating parameters such as the mean and standard deviation of the test measurand, the size of the samples, and the standard measurement uncertainty inherent in screening and diagnostic tests. Our study showcases the practical application of the program by examining the fasting plasma glucose data sourced from the National Health and Nutrition Examination Survey. Parametric distribution models are explored to assess the uncertainty of Bayesian posterior probability for diabetes mellitus, using the oral glucose tolerance test as the reference diagnostic method.


Introduction 1.Diagnosis in Medicine
Diagnosis in medicine fundamentally involves identifying the unique characteristics of a disease and distinguishing it from other conditions with similar presentations.The term "diagnosis", originating from the Greek word "διάγνωσις" meaning "discernment" [1], emphasizes the critical role of distinguishing between healthy and diseased states in individuals.Diagnostic tests are essential in classifying individuals based on their health status.However, the reliance on a singular threshold for diagnosis across a range of data points introduces uncertainty, owing to the overlapping probability distributions of a measurand in both healthy and diseased populations [2].While traditional diagnostic methods have been broadly effective, they may not fully encompass the diversity of disease manifestations, particularly across varied groups of people [3].
As underlined previously [2], Bayesian inference represents a paradigm shift in the field of medical diagnosis, offering a robust framework for integrating various sources of information to make probabilistic assessments.At its core, Bayesian inference relies on the Bayes' theorem for updating beliefs in light of new evidence, integrating prior disease probabilities with the distribution of diagnostic measurands to calculate posterior probabilities for disease [4][5][6][7].This approach enables a more comprehensive probabilistic assessment, evaluation of the information conveyed by diagnostic measurements, and a personalized patient approach [3,8].
Historically, the application of Bayesian methods in medicine has undergone significant evolution.Despite facing several challenges and being met with skepticism, these methods have gradually gained acceptance.

Bayes' Theorem in Medical Diagnostics
Bayes' theorem, a fundamental principle in probability theory [5], forms a connection between the direct probability P(H|E) of a hypothesis H given specific data E, and the inverse probability P(E|H) of data E given the hypothesis H [9].In medical diagnostics, Bayes' theorem is instrumental in transforming the prior probability for disease into a posterior probability following diagnostic tests [4].

Challenges in Applying Bayesian Inference
The application of Bayesian inference in diagnostics, however, faces significant challenges.

Computational Complexity
The computational complexity of Bayesian inference requires considerable resources.

Statistical Distributions in Diagnostics
A major challenge involves comprehensively understanding the statistical distributions of diagnostic test measurands in both diseased and nondiseased populations [10].Calculation of posterior probabilities requires probability density functions (PDF) for the measurands in these populations.The normal distribution, often used for its simplicity, may not be suitable for measurands with non-normal characteristics like skewness or multimodality.Critical evaluation and potential adoption of alternative distributions are necessary for more accurate Bayesian diagnostic methods [10][11][12].Bayesian Diagnosis, our previously published software, addresses this challenge [2].

Uncertainty of Bayesian Posterior Probabilities
Another significant challenge involves estimating the uncertainty associated with Bayesian posterior probabilities in disease diagnosis.This uncertainty can substantially affect their clinical utility.Despite its critical importance, the task of estimating, evaluating, and mitigating uncertainty in Bayesian diagnostic test interpretation has seldom been addressed in medical literature [13].To confront this issue, we have developed Bayesian Diagnostic Uncertainty, a software tool for the estimation of uncertainty in Bayesian diagnosis, which is presented in detail in this study.
Both Bayesian Diagnostic Uncertainty and Bayesian Diagnosis, enhance the applicability of Bayesian methods in medical diagnostics.

Quantifying Uncertainty in Diagnostics
Uncertainty can be quantified and is often expressed probabilistically [14].

Combined Uncertainty
In the context of Bayesian posterior probability for disease, we consider two main components of combined uncertainty:

Measurement Uncertainty
This reflects the inherent variability in measurement processes and is defined as a parameter characterizing the dispersion of values that could reasonably be attributed to the measurand [15].While crucial for laboratory quality assurance, the impact of measurement uncertainty on clinical decision-making and outcomes is often underexplored and rarely quantified [16,17].Emerging research focuses on its effects on misclassification [18] and on diagnostic accuracy measures [19].

Sampling Uncertainty
The variability in sampling contributes to the uncertainty of posterior probability for disease [20], and it is essential in evaluating diagnostic methods.

Bayes' Theorem
Bayes' theorem calculates the posterior probability P(D|T) of a disease D given a test result T = x and a parameter vector θ, as follows: Here r denotes the prior probability for disease, f D ( x|θ) the PDF in disease presence, while f D (x; θ) denotes the PDF in its absence (refer to Appendix A.1 for details).

Parametric Distributions
Parametric statistics operate under the assumption that data from a population can be accurately represented by a probability distribution with a fixed set of parameters [21].The program supports the following parametric distributions: 1. Normal distribution 2. Lognormal distribution 3. Gamma distribution.

Uncertainty Quantification
Uncertainty of input parameters can manifest as standard uncertainty u(x), the standard deviation of x, and expanded uncertainty U(x), a range around x encompassing x with a probability p [16].

Measurement Uncertainty
Measurement uncertainty is computed following guidelines in the "Guide to the expression of uncertainty in measurement" (GUM) [15] and "Expression of measurement uncertainty in laboratory medicine" [16].Bias is considered a component of this uncertainty [22].
The relationship between the standard measurement uncertainty u(x) to the value of the measurand x, is generally expressed as: where b 0 is a constant and b 1 is a proportionality constant.
If needed, it is approximated linearly as: The general approach to estimating the coefficients of the above equations is delineated in Appendix A5 of "Quantifying Uncertainty in Analytical Measurement" [23].

Sampling Uncertainties of Means and Standard Deviations
If m P and s P are the mean and standard deviation of a measurand in a population sample of size n P , then the standard sampling uncertainties of m P and s P are estimated as: using the central limit theorem and the chi-square distribution [24][25][26].

Sampling Uncertainty of Prior Probability for Disease
If n D and n D are the respective numbers of diseased and nondiseased in a population sample, then the standard uncertainty of the prior probability for disease r = n D n D +n D is estimated as: using the Agresti-Coull adjustment of the Waldo interval [27].

Combined Uncertainty of Posterior Probability for Disease
The standard combined uncertainty u c (x) of posterior probability for disease is com- puted via uncertainty propagation rules, employing a first-order Taylor series approximation [28] (refer to Supplementary File S2).
When there are l components of uncertainty, with standard uncertainties u i (x), then:

. Expanded Uncertainty of Posterior Probability for Disease
When there are l components of uncertainty, with standard uncertainties u i (x) and v i degrees of freedom, then the effective degrees of freedom v e f f of the combined uncertainty u c (x) are obtained from the Welch-Satterthwaite formula [29,30]: If v min the minimum of v 1 , v 2 , . . ., v l , then: is the Student's t-distribution cumulative distribution function with v degrees of freedom and u c (x) is the standard combined uncertainty of posterior probability for disease, its expanded combined uncertainty U c (x) at a confidence level p is: The confidence interval of x at the same confidence level p is approximated as: The confidence intervals of the posterior probability for disease were truncated to the [0, 1] range.

Program Overview
To facilitate the estimation of the uncertainty of Bayesian posterior probability for disease, the software program Bayesian Diagnostic Uncertainty was developed in Wolfram Language, using Wolfram Mathematica ® Ver.13.3 (Wolfram Research, Inc., Champaign, IL, USA).Bayesian Diagnostic Uncertainty was designed to estimate and plot the standard sampling, measurement, and combined uncertainty and the confidence intervals of the Bayesian posterior probability for disease of a screening or diagnostic test (See Figure 1).

Program Overview
To facilitate the estimation of the uncertainty of Bayesian posterior probability for disease, the software program Bayesian Diagnostic Uncertainty was developed in Wolfram Language, using Wolfram Mathematica ® Ver.13.3 (Wolfram Research, Inc., Champaign, IL, USA).Bayesian Diagnostic Uncertainty was designed to estimate and plot the standard sampling, measurement, and combined uncertainty and the confidence intervals of the Bayesian posterior probability for disease of a screening or diagnostic test (See Figure 1).Due to the complexity of the calculations required, it is computationally intensive.

Input Parameters
The program allows for the definition of three parametric distributions of a measurand for the diseased and nondiseased populations.
Distribution Selection: The user selects the type of distribution of each population from a predefined list: 1. Normal distribution 2. Lognormal distribution 3. Gamma distribution.
Definition of Statistical Parameters: For each population, the user defines its size n, the mean µ, and the standard deviation σ of the measurand.

Measurement Uncertainty
The user selects a linear or nonlinear equation of the measurement uncertainty versus the value x of the measurand and defines the constant contribution b 0 to the standard measurement uncertainty, the proportionality constant b 1 , and the number of quality control samples that have been analyzed for its estimation.

Output Specifications Visualizations
The program generates a series of plots designed to elucidate various uncertainty measures and statistics: 1. Uncertainty of posterior probability for disease: Plots are generated to show the standard sampling, measurement, and combined uncertainty of the posterior probability for disease.2. Relative uncertainty of posterior probability for disease: Plots are generated to show the relative standard sampling, measurement, and combined uncertainty of the posterior probability for disease.3. Confidence intervals of posterior probability for disease: Plots are generated to show the confidence intervals of the posterior probability for disease, for a user defined confidence level.

Tables
For each combination of parametric distributions of the diseased and nondiseased populations, the program tabulates for a user defined measurand value: 1.The standard sampling, measurement, and combined uncertainty of the posterior probability for disease.2. The relative standard sampling, measurement, and combined uncertainty of the posterior probability for disease.3. The confidence intervals of the posterior probability for disease for a user defined confidence level.
By providing this comprehensive set of input parameters and output specifications (see Figure 2), the program offers a robust platform for exploring the uncertainty in Bayesian diagnosis of disease using parametric distributions of medical diagnostic measurands.

Illustrative Case Study
To demonstrate the application of the program, fasting plasma glucose (FPG) was used as the diagnostic test measurand for the Bayesian diagnosis of diabetes mellitus (From now on, when mentioning "diabetes", we are referring to diabetes mellitus).The oral glucose tolerance test (OGTT) was used as the reference diagnostic method.A diagnosis of diabetes was confirmed if the plasma glucose value was equal to or greater than 200 mg/dL, measured two hours after oral administration of 75 g of glucose [31], during an OGTT (2-h PG).The study population was confined to individuals aged between 70 and 80 years, a decision guided by the well-documented strong correlation between age and the prevalence of diabetes [32].
National Health and Nutrition Examination Survey (NHANES) data from participants was retrieved for the period from 2005 to 2016 (n = 60,936) [33].NHANES is a series of studies designed to evaluate the health and nutritional status of adults and children in the United States.
The inclusion criteria for participants were: 1. Valid FPG and OGTT results (n = 13,836).

Illustrative Case Study
To demonstrate the application of the program, fasting plasma glucose (FPG) was used as the diagnostic test measurand for the Bayesian diagnosis of diabetes mellitus (From now on, when mentioning "diabetes", we are referring to diabetes mellitus).The oral glucose tolerance test (OGTT) was used as the reference diagnostic method.A diagnosis of diabetes was confirmed if the plasma glucose value was equal to or greater than 200 mg/dL, measured two hours after oral administration of 75 g of glucose [31], during an OGTT (2-h PG).The study population was confined to individuals aged between 70 and 80 years, a decision guided by the well-documented strong correlation between age and the prevalence of diabetes [32].
National Health and Nutrition Examination Survey (NHANES) data from participants was retrieved for the period from 2005 to 2016 (n = 60,936) [33].NHANES is a series of studies designed to evaluate the health and nutritional status of adults and children in the United States.
The inclusion criteria for participants were: 1. Valid FPG and OGTT results (n = 13,836).
The prior probability for diabetes was estimated as: The statistics of the FPG datasets are presented in Table 1 (Hereafter, FPG and its uncertainty are expressed in mg/dL).Lognormal distributions were estimated to model FPG measurements in diabetic and nondiabetic participants, using the maximum likelihood estimation method [35].The respective distributions, parametrized for their means µ D and µ D , and standard deviations σ D and σ D , were the following: NHANES quality control data of the FPG measurements was retrieved for the same period (2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015)(2016).1350 QC samples had been analyzed.The weighted nonlinear least squares analysis [36] yielded the following function relating the standard measurement uncertainty u m (x) to the measurement value x: where b 0 = 0.866 and b 1 = 0.109.The means of the standard measurement uncertainty of FPG of the included diabetic and nondiabetic participants were estimated as: Consequently, the distributions of the measurands, assuming negligible uncertainty, were estimated as:             Likelihoods and posterior probabilities were estimated accordingly.Likelihoods and posterior probabilities were estimated accordingly.

Results
Using the settings of    Figure 5 shows the plots of the standard sampling, measurement, and co certainty of posterior probability for diabetes versus FPG, while Figure 6 s spective plots of the relative standard uncertainty.
Figure 7 shows the plots of the confidence intervals of posterior probab betes versus FPG for a confidence level  = 0.95. Figure 5 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus FPG, while Figure 6 shows the respective plots of the relative standard uncertainty.
Figure 7 shows the plots of the confidence intervals of posterior probability for diabetes versus FPG for a confidence level  = 0.95.Assessing the combined standard uncertainty of the posterior probability for diabetes, we note the following: 1.It is substantially affected by measurement uncertainty of FPG.  2.
while the relative combined standard uncertainty is equal to 0.278.
Figure 8 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus the constant contribution  of measurement uncertainty of FPG, while Figure 9 shows the respective plots of the relative standard uncertainty.Figure 10 shows the plots of the confidence intervals of posterior probability for diabetes versus the constant contribution  of measurement uncertainty of FPG, for a confidence level  = 0.95.2.
the settings of the program in Table 2.
Figure 10 shows the plots of the confidence intervals of posterior probability for diabetes versus the constant contribution  of measurement uncertainty of FPG, for a confidence level  = 0.95.   Figure 11 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus the proportionality constant  of measurement uncertainty of FPG, while Figure 12 shows the respective plots of the relative standard uncertainty.Figure 11 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus the proportionality constant  of measurement uncertainty of FPG, while Figure 12 shows the respective plots of the relative standard uncertainty.Figure 13 shows the plots of the confidence intervals of posterior probability for diabetes versus the proportionality constant  of measurement uncertainty of FPG for a confidence level  = 0.95.2.
tainty proportionality constant  curves plot, with the settings of the program in Table 2.
Figure 13 shows the plots of the confidence intervals of posterior probability for diabetes versus the proportionality constant  of measurement uncertainty of FPG for a confidence level  = 0.95.2. Figure 14 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus the total population size n, while Figure 15 shows the respective plots of the relative standard uncertainty.
Figure 16 shows the plots of the confidence intervals of posterior probability for diabetes versus the total population size n, for a confidence level  = 0.95. Figure 14 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus the total population size n, while Figure 15 shows the respective plots of the relative standard uncertainty.
Figure 16 shows the plots of the confidence intervals of posterior probability for diabetes versus the total population size n, for a confidence level  = 0.95.As anticipated, the impact of sampling uncertainty decreases markedly as the size of the population sample increases.
Figure 17 shows a table of the standard sampling, measurement, and combined standard uncertainty of posterior probability for diabetes for FPG value equal to 126 mg/dL, while Figure 18 shows a table of the respective values of relative standard uncertainty.2.    2.
Figure 18 shows the confidence intervals of posterior probability for diabetes for FPG value equal to 126 mg/dL and confidence level  = 0.95.
The tables distinctly demonstrate the considerable magnitude of uncertainty and relative uncertainty associated with the posterior probability for diabetes at an FPG level of 126 mg/dL, the established threshold for the diagnosis of diabetes.Furthermore, the posterior probabilities delineated in the tables suggest a limited concordance between the classification criteria of diabetes derived from the OGTT and FPG tests [31], as found previously in existing literature [38].

Reevaluation of Traditional Diagnostic Methods
Traditional diagnostic methods rely on the use of predetermined thresholds; how- Figure 5 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus FPG, while Figure 6 shows the respective plots of the relative standard uncertainty.
Figure 7 shows the plots of the confidence intervals of posterior probability for diabetes versus FPG for a confidence level p = 0.95.
Assessing the combined standard uncertainty of the posterior probability for diabetes, we note the following: 1.It is substantially affected by measurement uncertainty of FPG.
2. Two local maxima are observed, corresponding to the regions near the steepest segments of the posterior probability curve, which exhibits an approximately double sigmoidal configuration.These maxima are quantitatively defined as following: 2.1.At an FPG value of 58.7 mg/dL, the posterior probability for disease is equal to 0.585, while the combined standard uncertainty is equal to 0.893.2.2.At an FPG value of 133.2 mg/dL, the posterior probability for disease is equal to 0.725, while the combined standard uncertainty is equal to 0.182.
This pattern of local maxima is indicative of heightened uncertainty in the regions where the posterior probability curve demonstrates its most pronounced inflections.The confidence intervals are affected accordingly.
Assessing the relative combined standard uncertainty of the posterior probability for diabetes, we note that two local maxima are observed as well, quantitatively defined as following: 1.At an FPG value of 64.1 mg/dL, the posterior probability for disease is equal to 0.257, while the relative combined standard uncertainty is equal to 2.044.2. At an FPG value of 128.1 mg/dL, the posterior probability for disease is equal to 0.561, while the relative combined standard uncertainty is equal to 0.278.
Figure 8 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus the constant contribution b 0 of measurement uncertainty of FPG, while Figure 9 shows the respective plots of the relative standard uncertainty.
Figure 10 shows the plots of the confidence intervals of posterior probability for diabetes versus the constant contribution b 0 of measurement uncertainty of FPG, for a confidence level p = 0.95.
Figure 11 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus the proportionality constant b 1 of measurement uncertainty of FPG, while Figure 12 shows the respective plots of the relative standard uncertainty.
Figure 13 shows the plots of the confidence intervals of posterior probability for diabetes versus the proportionality constant b 1 of measurement uncertainty of FPG for a confidence level p = 0.95.
Figure 14 shows the plots of the standard sampling, measurement, and combined uncertainty of posterior probability for diabetes versus the total population size n, while Figure 15 shows the respective plots of the relative standard uncertainty.
Figure 16 shows the plots of the confidence intervals of posterior probability for diabetes versus the total population size n, for a confidence level p = 0.95.
As anticipated, the impact of sampling uncertainty decreases markedly as the size of the population sample increases.
Figure 17 shows a table of the standard sampling, measurement, and combined standard uncertainty of posterior probability for diabetes for FPG value equal to 126 mg/dL, while Figure 18 shows a table of the respective values of relative standard uncertainty.
Figure 18 shows the confidence intervals of posterior probability for diabetes for FPG value equal to 126 mg/dL and confidence level p = 0.95.
The tables distinctly demonstrate the considerable magnitude of uncertainty and relative uncertainty associated with the posterior probability for diabetes at an FPG level of 126 mg/dL, the established threshold for the diagnosis of diabetes.Furthermore, the posterior probabilities delineated in the tables suggest a limited concordance between the classification criteria of diabetes derived from the OGTT and FPG tests [31], as found previously in existing literature [38].

Reevaluation of Traditional Diagnostic Methods
Traditional diagnostic methods rely on the use of predetermined thresholds; however, this often fails to consider the complexities of disease pathology.While this has been historically effective, it may lack the ability to offer a holistic approach in today's patientcentered medicine, where personalized care is paramount [39].The evolving nature of diseases and shifts in patient demographics increase the complexity of the diagnostic process, pushing the boundaries of conventional methodologies.In this challenging context, Bayesian inference emerges as an alternative approach, offering probabilistic evaluations that can adapt to the individual patient profiles [2,3].
Nevertheless, estimating the uncertainty of posterior probabilities within Bayesian inference remains a pivotal challenge [13].This issue is critically important in the context of diagnostic and screening tests for life-threatening conditions or those associated with considerable morbidity risk.It underscores the need for well-informed clinical judgments and comprehensive uncertainty evaluation in medical decision-making.Key examples include: 1. Cardiac troponin for diagnosing myocardial injury and infarction [40]; 2. Natriuretic peptides for the diagnosis of heart failure [41]; 3. D-dimer for diagnosing thromboembolic events [42]; 4. FPG, OGTT, and glycated hemoglobin (HbA1c) for diagnosing diabetes [31]; 5. OGTT for the diagnosis of gestational diabetes [43]; 6. Thyroid stimulating hormone (TSH), free serum triiodothyronine (T 3 ), and free serum thyroxine (T 4 ) for diagnosing thyroid dysfunction [44]; 7. Protein-to-creatinine ratio for the diagnosis of preeclampsia [45]; 8. Creatinine or cystatin C derived glomerular filtration rate (GFR), and albuminuria for diagnosing chronic kidney disease [46].
The ability to quantify this uncertainty is not a purely academic concern but also a practical necessity in improving diagnosis and patient outcomes.
To address this, our software explores the sampling, measurement, and combined uncertainty of Bayesian posterior probabilities.This exploration is not only vital for enhancing clinical decision-making but also plays a significant role in the fields of quality and risk management in laboratory medicine [47].Additionally, it may contribute to the design and implementation of test accuracy studies [48,49].As mentioned in Section 1, despite the extensive body of research on Bayesian diagnosis and uncertainty as separate entities, the intersection of these two areas remains relatively unexplored [50,51].
The illustrative case study, focusing on individuals aged 70 to 80 years, was designed to mitigate age-related variations in disease prevalence.This focus exemplifies the considerations required in modern diagnostics, where factors such as age, genetics, and lifestyle choices should be accounted for in the diagnostic equation.
Our software manages through its analysis of sampling, measurement, and combined uncertainty (as illustrated in Figures 5,8,11,14 and 17), relative uncertainty (Figures 6, 9, 12, 15 and 18) and the corresponding confidence limits ( Figures 7,10,13,16 and 19), to display its versatility in addressing these diagnostic challenges.Although the software's calculations are highly sophisticated, its user-friendly interface renders it an effective tool for medical researchers and professionals.
The case study from Section 4 highlights the substantial impact of combined uncertainty on the diagnostic process.This finding emphasizes the predominant role of measurement uncertainty, and thus stresses the demanding path toward enhancing diagnostic accuracy.By improving the analytical methods of screening and diagnostic tests, the medical community could achieve more accurate diagnosis, leading to more effective and tailored patient care.
Looking ahead, future research should focus on improving the estimations of the uncertainty of posterior probabilities under a diverse array of clinically relevant parameter settings.To transition from research into practical application, it is necessary to focus on clinical decision analysis, studies on cost-effectiveness, and research on quality of care, which includes conducting implementation studies [48].Such efforts are necessary in addressing the complex issues in diagnostic medicine and finding new and effective approaches to tackle ongoing challenges.

Limitations of the Program
This program's limitations, which provide paths for further research, include: 1. Underlying assumptions: 1.1.The existence of "gold standards" in diagnostics.If a "gold standard" does not exist, there are alternative approaches for classification [52][53][54].1.2.The hypothesis of parametric distribution of measurements or their transformations.However, existing literature underlines the robustness of nonparametric techniques in capturing complex data distributions [55].1.3.The generally accepted bimodality of the measurands, although unimodal distributions could be considered [56,57].
If these assumptions are not valid, the program may underestimate the standard uncertainty of the posterior probability for disease.
2. The use of first-order Taylor series approximations in uncertainty propagation calculations, where higher-order approximations may provide more accurate estimations [15].3. The approximation of the uncertainty of the prior probability for disease using the Agresti-Coull-adjusted Waldo interval, despite more accurate methods being available [58]. 4. The approximations of the sampling uncertainties for both the sample means and standard deviations, which can be improved for smaller samples or pronounced skewness observed in lognormal and gamma distributions [59,60]. 5.The use of confidence intervals derived from the t-distribution despite the high relative uncertainty [61].Though not typical in a Bayesian context, this can be employed instead of credible intervals as a practical tool under certain circumstances [5,62].
While addressing these limitations would increase considerably computational complexity, they represent key areas for future enhancement [63,64].

Limitations of the Case Study
The case study's main limitations include reliance on the OGTT as the reference method for diagnosing diabetes mellitus, despite several factors influencing glucose tolerance [65][66][67][68][69][70][71][72].Additionally, the lognormal distributions used only approximate the distributions of the FPG measurements from NHANES datasets, highlighting the need for more flexible statistical models.

Challenges in Bayesian Analysis for Disease Diagnosis
While Bayesian analysis may be beneficial in medical diagnostics, it presents certain challenges.For instance, the substantial uncertainty of the posterior probability for disease revealed in our study could lead to clinical indecision.Additionally, there is a notable lack of comprehensive statistical research on the distribution of measurands in both diseased and nondiseased populations, hindering further advancements in Bayesian analysis in this field.

Implications of Incomplete Data
1. Over-reliance on prior probabilities: Limited empirical data may cause an overdependence on prior probabilities, leading to distorted posterior probabilities and potentially flawed clinical decisions [73].2. Increased uncertainty: Insufficient data amplifies the uncertainty of computed posterior probabilities, which in turn could exacerbate clinical indecision [74].

Analysis of the Double Sigmoidal Curve in Posterior Probability Estimation and Its Impact on Uncertainty
The posterior probability for disease curve, characterized by a double sigmoidal shape featuring two symmetrical sigmoid functions, presents compelling analytical perspectives in the field of medical diagnostic statistics.This configuration implies that the risk associated with the disease may escalate at both the lower and upper extremes of a given measurand, while a zone of relative safety exists in the intermediate range.Notably, the uncertainty associated with the posterior probability for disease becomes markedly pronounced along the steep segments of the double sigmoidal curve.This heightened uncertainty is attributable to the fact that minor variations in the measurand value can lead to significant alterations in the computed posterior probability.

Conclusions
The program we have developed represents a novel approach to estimating and analyzing the uncertainty of Bayesian posterior probabilities in disease diagnosis.This tool stands out not only for its innovative capabilities in the field of medical diagnostics but also as a significant educational and research asset.Considering the difficulties and complexities we have outlined, this software offers essential assistance in applying Bayesian methods and dealing with diagnostic uncertainties, thereby enhancing well-informed decision-making.
Looking forward, it seems imperative that future research should focus on improving this method with advanced statistical concepts and empirically validating it with comprehensive test accuracy studies.Such studies are essential to verify the efficacy and reliability of the program in real clinical settings.Additionally, it is necessary to expand its application across a diverse range of diagnostic modalities.Doing so could enable the program to address a broader spectrum of diagnostic challenges, further enhancing its utility and impact on the medical field.
Our research, undertaken alongside our prior work on the uncertainty of diagnostic accuracy measures [19], creates a foundation for understanding uncertainties in diagnostic tests.With this consideration, we would recommend employing our approach in diagnostic accuracy research, aiming at formulating clear guidelines and establishing best practices to effectively integrate such information into clinical practice [48,[75][76][77].
Regarding regulatory issues, it is necessary to ensure that the application of the software adheres to the standards set forth by local regulatory authorities.
The potential of this program seems to be extending beyond its practical implications in medical diagnostics.As an educational resource, it could offer significant opportunities for training in medical statistics, particularly in the understanding of the uncertainty of Bayesian posterior probabilities.Its user-friendly interface, coupled with the depth of its analytical capabilities, makes it an effective learning tool for both aspiring and experienced professionals in the medical community.
In conclusion, the development and refinement of the Bayesian Diagnostic Uncertainty program are pivotal steps towards navigating the complexities of modern medical diag-nostics.Its role in enhancing Bayesian diagnostic methods, coupled with its educational benefits, highlights its capability as a supporting tool in the ongoing evolution of medical practice and research.where r denotes the prior probability for disease, L D (θ|x ) and f D ( x|θ) denote the likeli- hood function and the PDF of the test measurand in the presence of the disease, respectively, while L D ( x|θ) and f D ( x|θ) are the respective functions in the absence of the disease.

Figure 1 .
Figure 1.A simplified flowchart of the program Bayesian Diagnostic Uncertainty with the number of input parameters and of output types for each submodule.This interactive program is freely available as a Wolfram Language notebook (.nb) (Supplementary File S2: BayesianUncertainty.nb).It can be run on Wolfram Player ® (Wolfram Research, Inc., Champaign, IL, USA (2023)) or Wolfram Mathematica ® (see Appendix A.2). Due to the complexity of the calculations required, it is computationally intensive.

Figure 1 .
Figure 1.A simplified flowchart of the program Bayesian Diagnostic Uncertainty with the number of input parameters and of output types for each submodule.This interactive program is freely available as a Wolfram Language notebook (.nb) (Supplementary File S2: BayesianUncertainty.nb).It can be run on Wolfram Player ® (Wolfram Research, Inc., Champaign, IL, USA (2023)) or Wolfram Mathematica ® (see Appendix A.2). Due to the complexity of the calculations required, it is computationally intensive.

Figure 2 .
Figure 2. A screenshot of the program Bayesian Diagnostic Uncertainty.

Figure 2 .
Figure 2. A screenshot of the program Bayesian Diagnostic Uncertainty.

Figures 3
Figures3 and 4show the estimated PDFs of FPG in the diabetic and nondiabetic populations, assuming a lognormal distribution and negligible measurement uncertainty, and the histograms of the respective NHANES datasets.

Figure 3 .
Figure 3.The estimated PDF of the FPG (mg/dL) in diabetic participants, assuming a lognormal distribution and negligible measurement uncertainty, and the histogram of the respective NHANES dataset, with the parameters of the distribution in Table2.

Figure 4 .
Figure 4.The estimated PDF of the FPG (mg/dL) in nondiabetic participants, assuming a lognormal distribution and negligible measurement uncertainty, and the histogram of the respective NHANES dataset, with the parameters of the distribution in Table2.

Figure 3 .
Figure 3.The estimated PDF of the FPG (mg/dL) in diabetic participants, assuming a lognormal distribution and negligible measurement uncertainty, and the histogram of the respective NHANES dataset, with the parameters of the distribution in Table2.

Figures 3
Figures3 and 4show the estimated PDFs of FPG in the diabetic and nondiabetic populations, assuming a lognormal distribution and negligible measurement uncertainty, and the histograms of the respective NHANES datasets.

Figure 3 .
Figure 3.The estimated PDF of the FPG (mg/dL) in diabetic participants, assuming a lognormal distribution and negligible measurement uncertainty, and the histogram of the respective NHANES dataset, with the parameters of the distribution in Table2.

Figure 4 .
Figure 4.The estimated PDF of the FPG (mg/dL) in nondiabetic participants, assuming a lognormal distribution and negligible measurement uncertainty, and the histogram of the respective NHANES dataset, with the parameters of the distribution in Table2.

Figure 4 .
Figure 4.The estimated PDF of the FPG (mg/dL) in nondiabetic participants, assuming a lognormal distribution and negligible measurement uncertainty, and the histogram of the respective NHANES dataset, with the parameters of the distribution in Table2.

Figure 5 .
Figure 5.Standard sampling, measurement, and combined uncertainty of the posteri for diabetes versus FPG curve plot, with the settings of the program in Table2.

Figure 5 .Figure 6 .
Figure 5.Standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus FPG curve plot, with the settings of the program in Table2.

Figure 6 . 27 Figure 6 .
Figure 6.Relative standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus FPG curve plot, with the settings of the program in Table2.

Figure 7 .
Figure 7. Confidence intervals of the posterior probability for diabetes versus FPG curves plot, with the settings of the program in Table2.

Figure 7 .
Figure 7. Confidence intervals of the posterior probability for diabetes versus FPG curves plot, with the settings of the program in Table2.

Figure 8 .
Figure 8.Standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus measurement uncertainty constant contribution  curve plot, with the settings of the program in Table2.

Figure 8 . 27 Figure 9 .
Figure 8.Standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus measurement uncertainty constant contribution b 0 curve plot, with the settings of the program in Table 2. Diagnostics 2024, 14, 402 13 of 27

Figure 9 .
Figure 9. Relative standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus measurement uncertainty constant contribution b 0 curve plot, with the settings of the program in Table2.

Figure 10 .
Figure 10.Confidence intervals of the posterior probability for diabetes versus measurement uncertainty constant contribution  curves plot, with the settings of the program in Table2.

Figure 10 .
Figure 10.Confidence intervals of the posterior probability for diabetes versus measurement uncertainty constant contribution b 0 curves plot, with the settings of the program inTable 2. Diagnostics 2024, 14, 402 14 of 27

Figure 11 .
Figure 11.Standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus measurement uncertainty proportionality constant  curve plot, with the settings of the program in Table2.

Figure 11 .
Figure 11.Standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus measurement uncertainty proportionality constant b 1 curve plot, with the settings of the program in Table2.

Figure 12 .
Figure 12.Relative standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus measurement uncertainty proportionality constant  curve plot, with the settings of the program in Table2.

Figure 12 . 27 Figure 13 .
Figure 12.Relative standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus measurement uncertainty proportionality constant b 1 curve plot, with the settings of the program in Table 2. Diagnostics 2024, 14, 402 15 of 27

Figure 13 .
Figure 13.Confidence intervals of the posterior probability for diabetes versus measurement uncertainty proportionality constant b 1 curves plot, with the settings of the program in Table2.

Figure 14 .
Figure 14.Standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus total population sample size n curve plot, with the settings of the program in Table2.

Figure 14 . 27 Figure 15 .
Figure 14.Standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus total population sample size n curve plot, with the settings of the program inTable 2. Diagnostics 2024, 14, 402 16 of 27

Figure 15 .
Figure 15.Relative standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes versus total population sample size n curve plot, with the settings of the program in Table2.

Figure 16 .
Figure 16.Confidence intervals of the posterior probability for diabetes versus total population sample size n curves plot, with the settings of the program in Table2.

Figure 16 .
Figure 16.Confidence intervals of the posterior probability for diabetes versus total population sample size n curves plot, with the settings of the program in Table2.

Figure 17 .
Figure 17.Table of the standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes, with the settings of the program in Table2.

Figure 17 .
Figure 17.Table of the standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes, with the settings of the program in Table2.

Figure 17 .
Figure 17.Table of the standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes, with the settings of the program in Table 2.

Figure 18 .
Figure 18.Table of the relative standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes, with the settings of the program in Table2.

Figure 18 .
Figure 18.Table of the relative standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes, with the settings of the program in Table2.

Figure 19 .
Figure 19.Confidence intervals of the posterior probability for diabetes, with the settings of the program in Table2.

Figure 19 .
Figure 19.Confidence intervals of the posterior probability for diabetes, with the settings of the program in Table2.

b 0 :
constant contribution to measurement uncertainty b 1 : measurement uncertainty proportionality constant û: mean standard measurement uncertainty p: confidence level v e f f : effective degrees of freedom Functions P(A): probability of the event A P(A|B): conditional probability of the event A given the event B L(θ|z): likelihood function F −1 (.) : the inverse function F (.)Bayes' TheoremFor the purposes of our study, Bayes' theorem is formulated as:P(D|T) = P(T|D)P(D) P(T) = P(T|D)P(D) P(T|D)P(D) + P T D (1 − P(D)) where P(D|T) denotes the posterior probability of having a disease D given a test result T. P(T|D) denotes the likelihood of obtaining the result T given the presence of the disease D. P T D denotes the likelihood of obtaining the result T given the absence of the disease D. P(D) is the prior probability or prevalence r of the disease D. P(T) is the overall probability of the result T. According to Bayes' theorem, the posterior probability for a disease D given a test result T = x and a parameter vector θ is calculated as: P(D|T) = L D (θ|x )r L D ( x|θ)r + L D ( x|θ)(1 − r) = f D ( x|θ)r f D ( x|θ)r + f D ( x|θ)(1 − r)

Table 1 .
Descriptive statistics of the fasting plasma glucose datasets.

Table 2
[37]lays the descriptive statistics of the estimated lognormal distributions of the diabetic and nondiabetic populations, including the respective p-values of the Cramérvon Mises goodness-of-fit test[37].

Table 2 .
Descriptive statistics of the estimated lognormal distributions of the diabetic and nondiabetic populations.Figures3 and 4show the estimated PDFs of FPG in the diabetic and nondiabetic populations, assuming a lognormal distribution and negligible measurement uncertainty, and the histograms of the respective NHANES datasets.

Table 2 .
Descriptive statistics of the estimated lognormal distributions of the diabetic and nondiabetic populations.

Table 2 .
Descriptive statistics of the estimated lognormal distributions of the diabetic and nondiabetic populations.

Table 3 ,
the program generated the plots of Figures 5-17 and the tables of Figures 17-19.

Table 3 .
The settings of the program Bayesian Diagnostic Uncertainty for Figures5-19.

Table 3
, the program generated the plots of Figure tables of Figure 17-19.

Table 3 .
The settings of the program Bayesian Diagnostic Uncertainty for Figures5-1

Table 2 .
Diagnostics 2024, 14, 402 17 of 27 Table of the relative standard sampling, measurement, and combined uncertainty of the posterior probability for diabetes, with the settings of the program in Table 2.