def mean(t, a, b):
# TODO this is not tested yet.
# tests:
# cemean(0., a, b)==mean(a, b, p)
# mean(t, a, 1., p)==mean(0., a, 1., p) == a
# conditional excess mean
# E[Y|y>t]
# (conditional mean age at failure)
# http://reliabilityanalyticstoolkit.appspot.com/conditional_distribution
from scipy.special import gamma
from scipy.special import gammainc
# Regularized lower gamma
print('not tested')
v = 1. + 1. / b
gv = gamma(v)
L = np.power((t + .0) / a, b)
cemean = a * gv * np.exp(L) * (1 - gammainc(v, t / a) / gv)
return cemean
评论列表
文章目录