This repository contains the official Python reference implementations of the Kahl Model of Epistemic Dissonance (KMED). KMED is a mathematical and computational framework for modelling epistemic clientelism, dissonance, and resilience in intimate and institutional contexts.
The scripts reproduce the simulations documented in the paper: Epistemic Clientelism in Intimate Relationships: The Kahl Model of Epistemic Dissonance (KMED) and the Foundations of Epistemic Psychology (Lex et Ratio Ltd, London, 2025).
Each simulation corresponds to the versions published in Appendix A of the paper:
- Simulation 1 — Fiduciary scaffold vs clientelist suppression (single agent)
- Simulation 2 — Regime switching (rupture → repair)
- Simulation 3 — Intermittent clientelism vs stable fiduciary
- Simulation 4 — Gaslighting (oscillating recognition and suppression)
- Simulation 5 — Dissonance Training (therapeutic scaffolding)
All simulations share a consistent coding style and produce three primary plots:
- Epistemic Autonomy (EA)
- Dissonance Tolerance (DT)
- Dependence (D)
- Python 3.9+
numpymatplotlibos
Install dependencies via:
pip install numpy matplotlib osClone the repository:
git clone https://github.com/Peter-Kahl/KMED-Scripts.gitRun a simulation directly from the simulations/ folder. For example:
python simulations/sim1_fiduciary_vs_clientelist.py
Plots will be saved into the directory outputs/.
- Code is released under the MIT License (see LICENSE).
- Accompanying paper and documentation are released under Creative Commons BY-NC-ND 4.0.
You may freely use, adapt, and extend the code for research and educational purposes. Please cite appropriately.
If you use these scripts in academic work, please cite:
Kahl, P. (2025). Epistemic clientelism in intimate relationships: The Kahl Model of Epistemic Dissonance (KMED) and the Foundations of Epistemic Psychology (2nd ed.). Lex et Ratio Ltd. GitHub: https://github.com/Peter-Kahl/Epistemic-Clientelism-in-Intimate-Relationships DOI: http://dx.doi.org/10.13140/RG.2.2.22662.43849