tpx : Returns the probability that x will survive within t years
964620
def tpx(mt, x, t):
    
    """ npx : Returns n years survival probability at age x """
    return mt.lx[x + t] / mt.lx[x]
487204
def value_px(self):
        """"""
        step = self.w / (self.max - self.min)
        return self.x + step * (self.get() - self.min)
1366417
private double getExpectedProbability(double x)
    {
        double y = 1 / (standardDeviation * Math.sqrt(Math.PI * 2));
        double z = -(Math.pow(x - mean, 2) / (2 * Math.pow(standardDeviation, 2)));
        return y * Math.exp(z);
    }
854337
def probability_lt(self, x):
        
        if self.mean is None:
            return
        return normdist(x=x, mu=self.mean, sigma=self.standard_deviation)
951337
def lnprior(x):
    """"""
    per, t0, b = x
    if b < -1 or b > 1:
        return -np.inf
    elif per < 7 or per > 10:
        return -np.inf
    elif t0 < 1978 or t0 > 1979:
        return -np.inf
    else:
        return 0.
897795
def find_ge(a, x):
    """"""
    i = bs.bisect_left(a, x)
    if i != len(a): return i
    raise ValueError
484865
def absolute(self):
        
        return Timeseries(np.absolute(self), self.tspan, self.labels)
666712
def prob(self, pw):
        
        return float(self._T.get(pw, 0)) / self._T[TOTALF_W]
795243
def probabilities(self) -> bk.BKTensor:
        
        value = bk.absolute(self.tensor)
        return value * value
703730
def p_x_boolx(self,t):
    
    # todo: ply exposes precedence with %prec, use it.
    if len(t)==4: t[0] = bin_priority(t[2],t[1],t[3])
    elif len(t)==3: t[0] = un_priority(t[1],t[2])
    else: raise NotImplementedError('unk_len',len(t)) # pragma: no cover
104461
def bukin(self, x):
        """"""
        s = 0
        for k in xrange((1+len(x)) // 2):
            z = x[2 * k]
            y = x[min((2*k + 1, len(x)-1))]
            s += 100 * np.abs(y - 0.01 * z**2)**0.5 + 0.01 * np.abs(z + 10)
        return s
1180432
def Iax(mt, x, *args):
    
    return Sx(mt, x + 1) / Dx(mt, x)
433365
def probabilities(self) -> bk.BKTensor:
        
        prob = bk.productdiag(self.tensor)
        return prob
904031
def iter_by_year(self):
        """"""
        for yr, details in self.txn_details.iter_by_year():
            yield yr, Performance(details)
1144900
def prox_min(X, step, thresh=0):
    
    thresh_ = _step_gamma(step, thresh)
    below = X - thresh_ < 0
    X[below] = thresh_
    return X
1340300
def qAx(mt, x, q):
    
    q = float(q)
    j = (mt.i - q) / (1 + q)
    mtj = Actuarial(nt=mt.nt, i=j)
    return Ax(mtj, x)
1070289
def TP3(x, u, jac=False):
    ''''''

    q = 2 + 0.5*x + 1.5*(1-x)*u
    if not jac:
        return q
    else:
        grad = 0.5 -1.5*u
        return q, grad