definition of survival in the code
chanansh opened this issue · 1 comments
chanansh commented
In the paper survival is product of of probabilities (see eq 1 in https://faculty.wharton.upenn.edu/wp-content/uploads/2012/04/Fader_hardie_jim_07.pdf):
S(t) = Pi(r_i, i=1:t)
Yet, in the code it is differences : S = 1 - sum(r_i, i=1:t)
def survivor(probabilities, t):
"""Survivor function S"""
s = 1 - probabilities[0]
for x in xrange(1, t + 1):
s = s - probabilities[x]
return s
chanansh commented
oh sorry, probabilites are p(T) not r(T) so that's ok