PyDTS: A Python Package for Discrete-Time Survival Analysis with Competing Risks and Optional Penalization
Tomer Meir, Rom Gutman, Malka Gorfine
TL;DR
PyDTS tackles discrete-time survival data with competing risks by implementing two estimation frameworks: the Collapsed Log-Likelihood approach and the faster two-step method for semi-parametric logit-link models. It supports time-dependent covariates, regularized regression on the betas, and performance metrics such as cause-specific AUC and Brier score, along with a simulation module and comprehensive prediction routines for S(t|Z), λ_j(t|Z), Pr(T=t,J=j|Z), and F_j(t|Z). The package enables model evaluation via CV and grid-search for penalty tuning, and provides data regrouping utilities to handle sparse events. Demonstrated on the MIMIC-IV LOS case study, PyDTS shows competitive estimation accuracy and substantial speedups for large datasets, making discrete-time competing-risks analysis accessible in Python.
Abstract
Time-to-event (survival) analysis models the time until a pre-specified event occurs. When time is measured in discrete units or rounded into intervals, standard continuous-time models can yield biased estimators. In addition, the event of interest may belong to one of several mutually exclusive types, referred to as competing risks, where the occurrence of one event prevents the occurrence or observation of the others. PyDTS is an open-source Python package for analyzing discrete-time survival data with competing-risks. It provides regularized estimation methods, model evaluation metrics, variable screening tools, and a simulation module to support research and development.
