# Non Parametric models

Non Parametric models offer a straightforward and easy-to-interpret way to compute the survival and hazard functions without imposing any assumptions. Pysurvival provides the following non-parametric models:

## Kaplan-Meier model

One of the most straight-forward ways to estimate the Survival function $S(t)$ of an entire group, is by using the Kaplan-Meier method. Given $N$ units in a cohort, let's assume that there are $J$ distinct actual event times such that $t_1 < t_2 < ... < t_J$ with $J \leq N$, then the Survival function estimator $S_{KM}(t)$ is given by: with:

• $S_{KM}(0) = 1$
• $d_j$ is the number of individuals experiencing an event at $t_j$
• $r_j$ is the number of individuals at risk within $[t_{j-1}, t_j)$ - those who have not been censored or experienced an event

## Smooth Kaplan-Meier

Despite its ease of use, the main drawback of the Kaplan-Meier estimator is that it is a step function with jumps. Kernel smoothing can therefore solve this issue, provided that the best kernel and bandwidth are properly chosen.

Let $S_b(t)$ be a Smooth estimator of the Kaplan-Meier survival function. $S_b(t)$ can be written such that:

with:

• $s_j$, the height of the jump of the Kaplan-Meier estimator at $T_j$
• $K$, the infinite order kernel function. Here are the most common kernel functions:

• Biweight: $f(x) = 0$ if $|x| \leq 1$ else $f(x)=\frac{15}{16}(1-x^2)^2$
• Cosine: $f(x) = 0$ if $|x| \leq 1$ else $f(x)=\frac{\pi}{4}\cos( \frac{\pi x}{2} )$
• Epanechnikov: $f(x) = 0$ if $|x| \leq 1$ else $f(x) = 0.75 \cdot (1 - x^2 )$
• Normal: $f(x) = \frac{\exp( -x^2/2)}{ \sqrt{ 2 \pi }}$
• Triweight: $f(x) = 0$ if $|x| \leq 1$ else $f(x)=\frac{35}{32}(1-x^2)^3$
• Uniform: $f(x) = 0$ if $|x|<1$ else $f(x) = 0.5$
• $b$, the kernel function bandwidth