A simplified logistic-regression cardiovascular-risk model combines standardized patient
factors into a linear score z, then squashes it through the sigmoid function
to a probability:
z = b0 + w_age·age + w_bp·bp + w_chol·chol + w_smoke·smoke
p = 1 / (1 + e^-z)
- Coefficients are illustrative, tuned so risk rises smoothly with age, blood
pressure, cholesterol and smoking — the same directional relationships used in
real clinical risk scores (e.g. Framingham-style models).
- The ROC curve is computed by sweeping the classification threshold across
the simulated population and plotting true-positive rate against false-positive rate;
AUC summarises overall discrimination.
- The population histogram re-simulates 1,000 synthetic patients (factors drawn
from randomised distributions) and buckets their computed risk scores, so you can see
how the current threshold splits the population into low- and high-risk groups.
Educational demonstration only — not a validated clinical instrument.