Statistics and machine learning
Survival analysis and censoring
Use event time when accounts have different follow-up or default risk changes over time.

Purpose
Introduce survival, hazard, and censoring concepts for credit events.
Key terms
Hover over or focus a term for a quick definition, or open its glossary entry.
Key definitions
- Survival analysis models time until an event.
- Right censoring means the event has not been observed by the end of available follow-up.
Kaplan–Meier survival estimate multiplies period survival fractions (1 − events/at-risk) across event times.Worked example
An account observed for six months without default is not automatically a one-year non-default; its outcome is right-censored at six months.
Detailed explanation
A fixed-horizon classifier requires complete outcome windows or special handling. Survival methods can use partial follow-up by representing event times and censoring, which is valuable when accounts enter at different times or observation ends before the full horizon. Hazard models can also describe how risk changes with account age or covariates.
Define default, time origin, competing events such as prepayment, and censoring rules. Do not mark an account with incomplete follow-up as a negative label for the full horizon. Validate term structures by cohort and time, and explain the assumptions used to turn survival output into marginal or cumulative PD for a specific reporting purpose.
Try a reproducible Python example
These examples use synthetic inputs and run locally in a browser worker. Edit the code, run it, and compare its output with the published example.
Runnable Python · local in your browser
Calculate WOE and IV from grouped counts
Use synthetic good and bad counts for three ordered scorecard bins. The 0.5 adjustment avoids a zero distribution in this small example.
Output
Run the code to see the output.
Runtime loads only after you press Run. Code runs in a separate browser worker with a 10-second limit and a 20,000-character output cap. Use synthetic examples only; browser execution is not a secure environment for secrets or sensitive records.
Runnable Python · local in your browser
Convert a logistic model logit to PD
Apply the logistic function to an illustrative intercept plus two feature contributions.
Output
Run the code to see the output.
Runtime loads only after you press Run. Code runs in a separate browser worker with a 10-second limit and a 20,000-character output cap. Use synthetic examples only; browser execution is not a secure environment for secrets or sensitive records.
Assumptions
- Censoring is conditionally independent under the model or is addressed by an appropriate method.
Limitations
- Prepayment and other exits may be competing risks, not ordinary censoring.
- Model assumptions and event definitions require review.
References
- Metrics and scoring: quantifying the quality of predictions — scikit-learn documentation
- IFRS 9 Financial Instruments — IFRS Foundation
Educational material only. Methods and examples are simplified; state and validate the assumptions required for your use case.