示例#1
0
def normal_lccdf(mu, sigma, x):
    z = (x - mu) / sigma
    return tt.switch(
        tt.gt(z, 1.0),
        tt.log(tt.erfcx(z / tt.sqrt(2.)) / 2.) - tt.sqr(z) / 2.,
        tt.log1p(-tt.erfc(-z / tt.sqrt(2.)) / 2.)
    )
示例#2
0
def normal_lccdf(mu, sigma, x):
    z = (x - mu) / sigma
    return tt.switch(
        tt.gt(z, 1.0),
        tt.log(tt.erfcx(z / tt.sqrt(2.0)) / 2.0) - tt.sqr(z) / 2.0,
        tt.log1p(-tt.erfc(-z / tt.sqrt(2.0)) / 2.0),
    )
示例#3
0
def normal_lcdf(mu, sigma, x):
    z = (x - mu) / sigma
    return tt.switch(
        tt.lt(z, -1.0),
        tt.log(tt.erfcx(-z / tt.sqrt(2.)) / 2.) - tt.sqr(z) / 2,
        tt.log1p(-tt.erfc(z / tt.sqrt(2.)) / 2.)
    )
示例#4
0
def normal_lcdf(mu, sigma, x):
    """Compute the log of the cumulative density function of the normal."""
    z = (x - mu) / sigma
    return tt.switch(
        tt.lt(z, -1.0),
        tt.log(tt.erfcx(-z / tt.sqrt(2.0)) / 2.0) - tt.sqr(z) / 2.0,
        tt.log1p(-tt.erfc(z / tt.sqrt(2.0)) / 2.0),
    )
示例#5
0
def normal_lcdf(mu, sigma, x):
    """Compute the log of the cumulative density function of the normal."""
    z = (x - mu) / sigma
    return tt.switch(
        tt.lt(z, -1.0),
        tt.log(tt.erfcx(-z / tt.sqrt(2.)) / 2.) - tt.sqr(z) / 2.,
        tt.log1p(-tt.erfc(z / tt.sqrt(2.)) / 2.)
    )
def invprobit(x):
    return .5 * erfc(-x / sqrt(2.))
示例#7
0
def phi(x):
    return 0.5 * (tt.erfc(-x / tt.sqrt(2)))
示例#8
0
def invprobit(x):
    return 0.5 * erfc(-x / sqrt(2))
示例#9
0
def invprobit(x):
    return .5 * erfc(-x / sqrt(2.))
def cdf(mu, sd, value):
    z = zvalue(value, mu=mu, sd=sd)
    return tt.erfc(-z / tt.sqrt(2.)) / 2.
示例#11
0
文件: math.py 项目: taku-y/pymc3
def invprobit(x):
    return 0.5 * erfc(-x / sqrt(2))
def logp_emg_weighted(x, mu, sigma, lamb, weighted):
    inner_erfc = (mu + lamb * (sigma ** 2) - x) / (np.sqrt(2) * sigma)
    return (
        1
        / weighted
        * (tt.log(lamb / 2) + (lamb / 2) * (2 * mu + lamb * (sigma ** 2) - 2 * x) + tt.log(tt.erfc(inner_erfc)))
    )
def logp_emg(x, mu, sigma, lamb):
    inner_erfc = (mu + lamb * (sigma ** 2) - x) / (np.sqrt(2) * sigma)
    return tt.log(lamb / 2) + (lamb / 2) * (2 * mu + lamb * (sigma ** 2) - 2 * x) + tt.log(tt.erfc(inner_erfc))
示例#14
0
def s_normal_logcdf(x, mean, var):
    z = (x - mean) / TT.sqrt(var)
    return TT.log(.5) + TT.log(TT.erfc(-z / np.sqrt(2)))
示例#15
0
def s_normal_cdf(x, mean, var):
    z = (x - mean) / TT.sqrt(var)
    return .5 * TT.erfc(-z / np.sqrt(2))
示例#16
0
def cdf(sample, location=0, var=1):
    z = (sample - location) / T.sqrt(var)
    return .5 * (T.erfc(-z / SQRT2))