- Introduced by
- Armero, C. & Bayarri, M. J.
- Year
- 1994
- Type
- Bayesian inference + stochastic simulation
- Family
- Simulation / optimization
What does it do?
Bayesian Queueing Simulation combines Bayesian statistical inference with stochastic queueing simulation to model waiting-line systems under parameter uncertainty.
Instead of treating arrival and service rates as fixed known values, it places prior distributions over them, updates these with observed data to obtain posteriors, and propagates the resulting parameter uncertainty through repeated simulation runs to produce probabilistic predictions of system performance metrics such as queue length, waiting time, and server utilisation.
The intuition behind the method
Classical queueing models assume you know the arrival rate and service rate precisely — but in practice these are estimated from limited data and carry real uncertainty. Bayesian Queueing Simulation treats this uncertainty honestly: it asks 'given what we have observed, what is our updated belief about these rates?' and then runs the simulation many times, drawing different rate values from those updated beliefs each time. The result is not a single point estimate of average waiting time but a full distribution of plausible outcomes, which allows planners to reason about risk, not just expected value. This is especially valuable when data are sparse or when the cost of misjudging system load is high.
History
Armero and Bayarri (1994) published Bayesian prediction in M/M/1 queues in Queueing Systems; this is the work cited as the originator of the approach. Insua, Wiper and Ruggeri (1998) applied Bayesian analysis to M/Er/1 and M/H_k/1 queues, whose service-time distributions are Erlang and hyperexponential, respectively, and are therefore non-exponential.
When to use it
Use this method when arrival or service rates are estimated from limited or noisy counts, and treating them as known would materially change capacity or staffing decisions. It suits queues that can plausibly be described by the model classes named in this entry (M/M/1, M/M/c, M/G/1), with historical counts that exist but are sparse. Check the modelling assumptions listed under limitations before use. It is preferred when the decision requires probability statements, such as the probability that waiting time exceeds five minutes, rather than a single expected value. Do NOT use it when rates are known exactly from engineering specifications, when repeated simulation is too costly and a closed-form queueing formula is adequate, or when the team cannot interpret posterior distributions and MCMC diagnostics.
Limitations and considerations
- More computationally demanding than classical queueing analysis because it requires posterior sampling and, for models without closed-form metrics, repeated simulation.
- Prior specification requires justification; poorly chosen priors can bias results, especially with small datasets.
- MCMC-based posterior inference for non-conjugate or complex multi-server models adds diagnostic burden and convergence risk.
- Output interpretation requires statistical literacy; stakeholders unfamiliar with credible intervals may misread results.
- Results rest on modelling assumptions: Poisson arrivals and exponential service for M/M/1 and M/M/c; independent counts across observation periods; rates that are stationary over the observation window; and, for simulated metrics, a warm-up period before recording so that steady-state summaries are not distorted by the empty initial state. When these assumptions fail, the predictive intervals can look precise while being wrong.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Explicitly accounts for parameter uncertainty rather than assuming rates are known, producing more honest predictions.
- Posterior predictive distributions allow direct probability statements about performance thresholds useful for risk-based planning.
- With Gamma priors on Poisson rates, the rate posteriors have a closed form, and for M/M/1 queues in steady state the performance metrics are closed-form functions of each draw, so simulation is needed only when the model departs from these formulas.
- Naturally incorporates prior expert knowledge about arrival and service rates when historical data are scarce.
- Consistent Bayesian framework allows sequential updating as new data arrive, keeping models current without full refit.
Applications
- Estimating the probability that waiting time exceeds a service-level threshold when arrival and service rates come from a short observation record
- Comparing staffing levels under posterior uncertainty in arrival rates, reporting credible intervals rather than a single expected waiting time
- Assessing queue or buffer capacity where traffic rates are inferred from sparse measurements
- Planning throughput for a service process whose service rate is estimated from a limited number of completed jobs
- Updating a queue model sequentially as new arrival and service counts are recorded
How it works
How it works
Specify prior distributions for the queueing model parameters, typically the arrival rate lambda and the service rate mu. Common choices are Gamma priors, which are conjugate to Poisson-distributed counts: a Gamma prior on a rate, combined with Poisson counts, yields a Gamma posterior. These priors encode pre-existing knowledge or expert belief before data are collected. The number of servers is usually treated as a fixed part of the model structure rather than as an uncertain parameter.
Collect observed data: counts of arrivals over the observed elapsed time, and counts of completed services over the observed busy time of the server. Busy time is the relevant exposure for mu because service completions occur only while the server is working. For a Gamma(a, b) prior in the shape-rate parameterisation and n events observed over total exposure T, the conjugate posterior is Gamma(a + n, b + T). Apply Bayes' theorem analytically in this conjugate case, or numerically (for example via MCMC) when no conjugate form is available, to obtain the posterior distributions p(lambda | data) and p(mu | data). This step combines prior belief with empirical evidence.
Draw N independent samples of (lambda^(k), mu^(k)) from the joint posterior distribution. Each sample represents one plausible configuration of the system's true parameters consistent with the observed data. Choose N large enough that the output summaries are stable across independent batches of draws.
For each parameter sample k, compute the performance metrics using lambda^(k) and mu^(k): mean queue length L^(k), mean waiting time W^(k), and server utilisation rho^(k). For an M/M/1 queue in steady state with rho = lambda/mu < 1, these metrics have standard closed forms (rho = lambda/mu, L = rho/(1 - rho), W = 1/(mu - lambda)), so no simulation is needed for each draw. Discrete-event simulation (for example of M/M/c, M/G/1, or other models) is required when the model departs from these closed forms, such as non-exponential service without a known formula, multiple servers without a closed-form expression, transient behaviour, or queueing networks. Simulated metrics should be recorded only after a warm-up period.
Aggregate the N draws to form posterior predictive distributions over the performance metrics. Each draw contributes one value of each metric, obtained either analytically or from one simulation run. Compute posterior means, credible intervals (e.g., 95% HDI), and tail probabilities (e.g., P(W > threshold)). These summaries quantify performance uncertainty for decision-making.
Common pitfalls
- Using too few parameter draws gives unstable posterior predictive distributions and unreliable tail estimates. Check the Monte Carlo error by comparing summaries across independent batches of draws until they, especially the tail probabilities, stop changing.
- Ignoring MCMC convergence diagnostics (R-hat, trace plots) when using non-conjugate posteriors can produce subtly incorrect parameter samples.
- Treating the posterior mean of rates as a point estimate and running a single simulation defeats the purpose of the Bayesian framework.
- Failing to validate the queueing model structure (M/M/1 vs M/G/1 vs M/M/c) before inference leads to model misspecification that no amount of Bayesian updating can correct.
Frequently asked questions
Does Bayesian Queueing Simulation require MCMC, or are there simpler alternatives?
For Markovian queues (M/M/1, M/M/c) with Gamma priors on the rates, the rate posteriors are available in closed form, so MCMC is not needed for that step. For M/M/1 in steady state, the performance metrics for each draw can also be computed from closed-form expressions. Non-conjugate priors, or non-exponential service-time distributions such as those treated by Insua et al. (1998), may require numerical methods such as MCMC, and the choice of method should be checked against the specific model.
How many simulation replications are needed for reliable results?
The number of posterior parameter draws should be large enough that the summaries are stable. Each draw is one parameter configuration, evaluated either analytically or with one simulation run. Stability can be checked by repeating the analysis with independent batches of draws; tail probabilities are estimated least precisely and usually need the most draws. The worked example in this entry uses 2000 draws.
How is this different from simply running a sensitivity analysis on arrival rates?
Sensitivity analysis varies parameters over a pre-specified range without weighting by plausibility. Bayesian Queueing Simulation weights parameter values by their posterior probability given the observed data, so the resulting uncertainty reflects the statistical evidence rather than an arbitrary range.
Can the method handle time-varying (non-stationary) arrival rates?
This is not part of the basic model and is not covered by the cited sources. In principle, arrival rates can be modelled as piecewise-constant over intervals or with priors that allow smooth variation over time. Such extensions add complexity and may require more involved inference, but the overall pipeline structure remains the same.
What software supports Bayesian Queueing Simulation?
The cited sources do not discuss software. General-purpose Bayesian tools, for example Stan, PyMC or JAGS, can carry out the inference step, and the queue simulation can be written in a general-purpose language or with a discrete-event simulation library. Users should verify that any tool they choose supports the model structure and convergence diagnostics they need.
Related methods
Sources
Armero, C., & Bayarri, M. J. (1994). Bayesian prediction in M/M/1 queues. Queueing Systems, 15(1–4), 401–417.
Open DOI referenceInsua, D. R., Wiper, M., & Ruggeri, F. (1998). Bayesian analysis of M/Er/1 and M/H_k/1 queues. Queueing Systems, 30(3–4), 289–308.
Open DOI reference