Return one-way Welch ANOVA.
508717
def _welch_anova(self, dv=None, between=None, export_filename=None):
    """"""
    aov = welch_anova(data=self, dv=dv, between=between,
                      export_filename=export_filename)
    return aov
370520
def relStdDev(self, limit=None):
        """"""
        moments = self.meanAndStdDev(limit)
        if moments is None:
            return None
        return moments[1] / moments[0]
388277
def get_operator_statistic(self, name):
        """"""
        opdefs = yield from self.get_operator_definitions()

        name = name.lower()
        if name not in opdefs:
            return None

        # some operators (e.g. Kaid and Nomad) don't have a unique statistic sectoin for some reason...
        if "uniqueStatistic" not in opdefs[name] or "pvp" not in opdefs[name]["uniqueStatistic"]:
            return None

        return opdefs[name]["uniqueStatistic"]["pvp"]["statisticId"]
836551
def j0_2(a=1):
    """

    def lhs(x):
        return np.exp(-a*x)

    def rhs(b):
        return 1/np.sqrt(b**2 + a**2)

    return Ghosh('j0', lhs, rhs)
758068
def right(X, i):
    """"""
    if i > X.d-1:
        return np.ones([1, 1])
    answ = np.ones([1, 1])
    cores = tt.tensor.to_list(X)
    for dim in xrange(X.d-1, i-1, -1):
        answ = np.tensordot(cores[dim], answ, 1)
    answ = reshape(answ, (X.r[i], -1))
    return answ.T
78715
def one_hot(cls, n, l):
        
        v = [0.0] * l
        v[n] = 1.0
        return Vector(v)
188012
def one_version(self, index=0):
        '''
        
        '''
        def prep(df):
            start = sorted(df._start.tolist())[index]
            return df[df._start == start]

        return pd.concat([prep(df) for _, df in self.groupby(self._oid)])
1097799
def pstdev(data):
        """"""
        n = len(data)
        if n < 2:
            return 0
            # raise ValueError('variance requires at least two data points')
        ss = TableExtraction._ss(data)
        pvar = ss/n # the population variance
        return pvar**0.5
18797
def obfn_g1var(self):
        
        """

        # Use of self.block_sep1(self.AXnr) instead of self.cnst_A1(self.X)
        # reduces number of calls to self.cnst_A0
        return self.var_y1() if self.opt['gEvalY'] else \
            self.block_sep1(self.AXnr)
215830
def nullval(cls):
        """"""

        d = dict(cls.__dict__.items())

        for k in d:
            d[k] = 0

        d['sl'] = cls.sl
        d[cls.level] = 0

        return cls(**d)
326373
def posterior(self, x, s=1.):
        """"""
        pr0 = 1. / self.sigma**2  # prior precision
        prd = x.size / s**2  # data precision
        varp = 1. / (pr0 + prd)  # posterior variance
        mu = varp * (pr0 * self.mu + prd * x.mean())
        return TruncNormal(mu=mu, sigma=np.sqrt(varp), a=self.a, b=self.b)
1308294
def posterior(self, x, sigma=1.):
        """"""
        pr0 = 1. / self.scale**2  # prior precision
        prd = x.size / sigma**2  # data precision
        varp = 1. / (pr0 + prd)  # posterior variance
        mu = varp * (pr0 * self.loc + prd * x.mean())
        return Normal(loc=mu, scale=np.sqrt(varp))
1267366
def _sample_orthonormal_to(mu):
    """"""
    v = np.random.randn(mu.shape[0])
    proj_mu_v = mu * np.dot(mu, v) / np.linalg.norm(mu)
    orthto = v - proj_mu_v
    return orthto / np.linalg.norm(orthto)
478768
def K(self, X, X2=None):
        """"""
        if X2 is None:
            X2 = X

        base = np.pi * (X[:, None, :] - X2[None, :, :]) / self.period
        exp_dist = np.exp( -0.5* np.sum( np.square(  np.sin( base ) / self.lengthscale ), axis = -1 ) )

        return self.variance * exp_dist
578969
def _call(self, x):
        """"""
        out = x.asarray().ravel()[self._indices_flat]

        if self.variant == 'point_eval':
            weights = 1.0
        elif self.variant == 'integrate':
            weights = getattr(self.domain, 'cell_volume', 1.0)
        else:
            raise RuntimeError('bad variant {!r}'.format(self.variant))

        if weights != 1.0:
            out *= weights

        return out
1315500
def srp1(*args, **kargs):
    """"""
    ans, _ = srp(*args, **kargs)
    if len(ans) > 0:
        return ans[0][1]
    else:
        return None
297607
def lognormcdf(x, mu, tau):
    """"""
    x = np.atleast_1d(x)
    return np.array(
        [0.5 * (1 - flib.derf(-(np.sqrt(tau / 2)) * (np.log(y) - mu))) for y in x])