survival#

Module: survival#

Helper functions for survival analysis#

This module contains functions used for the survival analysis lab of ISLP. Currently it contains just a simple function to generate survival times from a Cox proportional hazards model with a given baseline cumulative hazard.

ISLP.survival.sim_time(linpred, cum_hazard, rng=None)#

Simulate a survival time for a cumulative hazard function \(H\) with cumulative hazard

\[H_l(t) = e^l \cdot H(t)\]

with l the linear predictor linpred as in a Cox proportional hazards model.

Parameters:
lin_predfloat

Linear predictor value.

cum_hazardcallable

Cumulative hazard function, takes a single non-negative argument.

rngnumpy random number generator

Used to generate survival times.