def E_tl2_cdf(varg, vare, o): g_mu = 0 # vg = np.sqrt(varg) ve = np.sqrt(vare) b = ve * np.sqrt(1 + varg / vare) c = o / b #_tl2_g_mu = 2*g_mu*E_tl_cdf(varg, vare, o) _tl2_g_mu = cdf(c) * (varg - g_mu * g_mu) _tl2_g_mu -= varg * varg * c * pdf(c) / (vare + varg) return _tl2_g_mu
def fun2(tg): return tg * E_tl_e_trunc_lower(tg, vare, o) * pdf(tg, g_mu, varg)
def fun1(tg): return tg * E_tl_e_trunc_upper(tg, vare, o) * pdf(tg, g_mu, varg)
def E_tl_cdf(varg, vare, o): # vg = np.sqrt(varg) ve = np.sqrt(vare) b = ve * np.sqrt(1 + varg / vare) return -varg * pdf(o / b) / b
def _lambda_alpha(alpha): return pdf(alpha) / (1 - cdf(alpha))