Skip to content

Repository files navigation

Tunisia Water-Interruption Risk

R pipeline Reproducible environment License: MIT Pages

An independent actuarial study of self-reported economic loss associated with insufficient water supply among formal Tunisian businesses. It combines survey-weighted frequency–severity modelling, temporal validation, conditional 2026–2030 provisions, a governed machine-learning challenger and reproducible SONEDE open-data ingestion.

Public study: https://aminemanai2003.github.io/tunisia-water-interruption-risk/

Results at a glance

  • The 2024 WBES wave gives a 15.97% survey-weighted rate of businesses reporting insufficient water supply.
  • The calibrated 2024 expected loss ratio is 0.0523% of annual-sales exposure.
  • Per 10 million TND exposure, the 2026 continuity provision is 5,752 TND; the 2030 severe annual provision is 18,177 TND.
  • A temporal holdout reveals strong drift: both the actuarial GLM and gradient-boosting challenger materially underpredict 2024.
  • The severity GLM and ML promotion gates are blocked because the evidence does not meet the predeclared thresholds.

These are conditional portfolio illustrations, not forecasts of SONEDE operations, national loss estimates, insurance premiums or booked reserves.

Architecture

flowchart LR
    A["Restricted WBES panel"] --> B["Harmonisation + survey design"]
    C["SONEDE CKAN workbooks"] --> D["Checksummed public-data ingestion"]
    E["SONEDE public notices"] --> F["Auditable text-mining register"]
    B --> G["Occurrence · frequency · duration"]
    B --> H["2024 actuarial loss chain"]
    B --> I["Temporal GLM / ML validation"]
    H --> J["Bootstrap uncertainty"]
    J --> K["2026–2030 stress provisions"]
    D --> L["Contextual infrastructure evidence"]
    F --> L
    G --> M["Disclosure-safe artifacts"]
    I --> M
    K --> M
    L --> M
    M --> N["Quarto dashboard + technical report"]
Loading

Actuarial framework

The baseline loss ratio is

$$ \widehat{ELR} =\widehat{\Pr}_w(\text{shortage}) \times\widehat{\Pr}_w(\text{positive loss}\mid\text{shortage}) \times\widehat{\mathbb E}_w[\text{loss ratio}\mid\text{positive loss}]. $$

The projected management provision for scenario (s) and year (t) is

$$ P_{s,t}=E_{s,t}\widehat{ELR}_{2024}m_s(1+g_s)^{t-2026}(1+\lambda_s). $$

All stress, trend, growth and prudence assumptions are visible in config/scenarios.csv.

Data boundary

The WBES firm-level panel is restricted and intentionally excluded from Git. Public SONEDE workbooks are downloaded locally and checksum-logged. Only aggregate, disclosure-safe outputs under artifacts/public are published.

Data sources:

Reproduce locally

Requirements: R 4.6+, Python 3.11+, Quarto 1.6+ and a locally authorized copy of Tunisia_2013_2020_2024.dta at data/raw/wbes/.

renv::restore()
pip install -e .
./scripts/run_all.ps1

The build runs public-data ingestion, notice discovery, the evaluation-only ML challenger, the R targets pipeline, unit tests, the privacy release check and the Quarto site render.

Model governance

The project distinguishes estimation, validation and promotion. The non-linear challenger is evaluated on 2024 after training on 2013/2020, but it is not promoted because the event threshold is unmet and calibration is weak. Feature importance is diagnostic, not causal. The machine-readable boundary is in model_card.yml.

Repository map

R/                     actuarial ingestion, estimators, models and projections
scripts/               public download, notice mining, ML challenger and release checks
config/                versioned scenario assumptions
tests/                 data-contract and actuarial-identity tests
artifacts/public/       disclosure-safe tables, figures and model card
reports/                technical report source and PDF
site/                   visual system and shared render helpers
docs/                   rendered GitHub Pages site

License and citation

Code is released under the MIT License. Cite the repository using CITATION.cff and cite the underlying data providers separately.

About

Actuarial study of water-supply interruptions, business losses, model validation and conditional provisions in Tunisia.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages