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
{"ft_lang_label":"__label__en","ft_lang_prob":0.67086214,"math_prob":0.99998856,"size":1962,"snap":"2019-43-2019-47","text_gpt3_token_len":481,"char_repetition_ratio":0.15526047,"word_repetition_ratio":0.014492754,"special_character_ratio":0.2227319,"punctuation_ratio":0.15178572,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000061,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-19T17:09:08Z\",\"WARC-Record-ID\":\"<urn:uuid:dec316b7-41d9-452f-b0ca-7e2de30003dc>\",\"Content-Length\":\"28515\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a04fa404-6e75-4315-b4c1-8caa21a1f3ba>\",\"WARC-Concurrent-To\":\"<urn:uuid:232431b9-a751-40e3-bd51-b31338d9133f>\",\"WARC-IP-Address\":\"185.199.109.153\",\"WARC-Target-URI\":\"https://square.github.io/pysurvival/models/non_parametric.html\",\"WARC-Payload-Digest\":\"sha1:HE2O24GI6XB5D5VUIYQ2UTNLQVYHNHSK\",\"WARC-Block-Digest\":\"sha1:W3W6D7S7JHJI6LKGD2DSJ3BQFCXLJMOJ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570986697439.41_warc_CC-MAIN-20191019164943-20191019192443-00555.warc.gz\"}"}