Abstract
Will a browser-based Bayesian risk engine give probabilistic water safety assessments calibrated to regional bacteria prevalence (for low-resource settings)? We built WaterNajia as a 1,784-line single-file application implementing logit-scale risk scoring. It uses Monte Carlo simulation across 15 environmental and infrastructure risk factors for six water source types. The engine utilises exponential decay modelling for time-since-contamination events, factor-group exclusivity logic, and region-specific bacteria prevalence priors derived from WHO and UNICEF surveillance data. For the full risk stack scenario with piped water, the posterior contamination probability was 0.92 (95% credible interval 0.87 to 0.96). This used 200 Monte Carlo samples with seed-deterministic XorShift128Plus pseudorandom generation. A parallel Rust and WebAssembly implementation achieved bit-exact agreement with the JavaScript reference across all five golden test vectors. Real-time probabilistic water safety scoring could then support field-level decision-making in humanitarian and public health contexts. The risk model relies on aggregate regional prevalence data. It cannot capture hyperlocal contamination sources or seasonal variation.
Github link below
https://github.com/Najia-Ahmad/Water-Safety-Risk-Engine
References
1. Hamouda, M. A., Anderson, N. W., & Huang, R. R. (2018). "A decision support system for assessing the risk of waterborne disease outbreaks." Journal of Environmental Management.
2. Souter, P. F., et al. (2003). "Evaluation of a low-cost, point-of-use combined coagulation-flocculation-disinfection treatment of polluted water." Applied and Environmental Microbiology. (In conjunction with newer literature on WASH-GIS and mobile health (mHealth) integration).

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