這個是個累積存活率,隨著時間增加一直減少
違約時間函數(shù)是 違約概率函數(shù)的逆函數(shù)
given a uniform random variable u? , the default time is p^-1(u? ).
p^-1 是逆函數(shù)衅谷,inverse
figure(figsize=[10, 6])
ts = np.arange(0, 30, .01)
h = .1
p = np.exp(-h*ts)
plot(ts, p)
xlabel('Time (Y)', fontsize=16)
ylabel('Suvival Prob', fontsize=16)
u = .1
t = -np.log(u)/h
# 23.025850929940454 時刻的生存率為0.1
plot([0, t], [u, u], 'r')
plot([t, t], [0, u], 'r')
plot(t, u, 'o');
u = .8
t1 = -np.log(u)/h
# 2.231435513142097 時刻的存活率是0.8
plot([0, t1], [u, u], 'k')
plot([t1, t1], [0, u], 'k')
plot(t1, u, 'o');
legend(['Survival Prob $p(t)$']);