Return the total yield and its associated statistical and
        systematic uncertainties.
510382
def total(self, xbin1=1, xbin2=-2):
        
        integral, stat_error = self.hist.integral(
            xbin1=xbin1, xbin2=xbin2, error=True)
        # sum systematics in quadrature
        ups = [0]
        dns = [0]
        for sys_name in self.sys_names():
            sys_low, sys_high = self.sys_hist(sys_name)
            up = sys_high.integral(xbin1=xbin1, xbin2=xbin2) - integral
            dn = sys_low.integral(xbin1=xbin1, xbin2=xbin2) - integral
            if up > 0:
                ups.append(up**2)
            else:
                dns.append(up**2)
            if dn > 0:
                ups.append(dn**2)
            else:
                dns.append(dn**2)
        syst_error = (sqrt(sum(ups)), sqrt(sum(dns)))
        return integral, stat_error, syst_error
1167176
def cv_residuals(self, cv=True):
        """"""
        vals = self.cv_values(cv)
        return (self.y - vals) / self.dy
219480
def total_errors(self):
        

        child_errors = sum(len(tree) for _, tree in iteritems(self._contents))
        return len(self.errors) + child_errors
606819
def yieldOutput(self):
        
        width = self.__width
        if width:
            num_cols = len(width)
            fmt = ['%%%ds' % -w for w in width]
            if width[-1] > 0:
                fmt[-1] = '%s'
            fmt = self.__sep.join(fmt)
            for row in self.__cols:
                row.extend( [''] * (num_cols - len(row)) )
                yield fmt % tuple(row)
292047
def get(self):
        """"""

        values = self.reservoir.sorted_values

        def safe(f, *args):
            try:
                return f(values, *args)
            except exceptions.StatisticsError:
                return 0.0

        plevels = [50, 75, 90, 95, 99, 99.9]
        percentiles = [safe(statistics.percentile, p) for p in plevels]

        try:
            histogram = statistics.get_histogram(values)
        except exceptions.StatisticsError:
            histogram = [(0, 0)]

        res = dict(
            kind="histogram",
            min=values[0] if values else 0,
            max=values[-1] if values else 0,
            arithmetic_mean=safe(statistics.mean),
            geometric_mean=safe(statistics.geometric_mean),
            harmonic_mean=safe(statistics.harmonic_mean),
            median=safe(statistics.median),
            variance=safe(statistics.variance),
            standard_deviation=safe(statistics.stdev),
            skewness=safe(statistics.skewness),
            kurtosis=safe(statistics.kurtosis),
            percentile=py3comp.zip(plevels, percentiles),
            histogram=histogram,
            n=len(values))
        return res
904031
def iter_by_year(self):
        """"""
        for yr, details in self.txn_details.iter_by_year():
            yield yr, Performance(details)
331823
def results(self):
        ""
        if self._results is None:
            results = self._json_struct['results']
            def result_iterator():
                for result in results:
                    datatype = None
                    conversion = None
                    for param in self.parent.parameters:
                        if param['name'] == result['paramName']:
                            datatype = param['datatype']
                    if datatype is None:
                        conversion = str
                    else:
                        conversion = datatype.fromJson
                    dt = result['paramName']
                    val = conversion(result['value'])
                    yield (dt, val)
            self._results = dict(res for res in result_iterator())
        return self._results
1018896
def total(self, where=None, xbin1=1, xbin2=-2):
        
        nominal, _ = self.sys_hist(None, where=where)
        integral, stat_error = nominal.integral(
            xbin1=xbin1, xbin2=xbin2, error=True)
        ups = [0]
        dns = [0]
        for sys_name in self.sys_names():
            low, high = self.sys_hist(sys_name, where=where)
            up = high.integral(xbin1=xbin1, xbin2=xbin2) - integral
            dn = low.integral(xbin1=xbin1, xbin2=xbin2) - integral
            if up > 0:
                ups.append(up**2)
            else:
                dns.append(up**2)
            if dn > 0:
                ups.append(dn**2)
            else:
                dns.append(dn**2)
        syst_error = (sqrt(sum(ups)), sqrt(sum(dns)))
        return integral, stat_error, syst_error
1188507
def pvalues(self):
        """"""
        self.compute_statistics()

        lml_alts = self.alt_lmls()
        lml_null = self.null_lml()

        lrs = -2 * lml_null + 2 * asarray(lml_alts)

        from scipy.stats import chi2
        chi2 = chi2(df=1)

        return chi2.sf(lrs)
331984
def results(self):
        """"""

        # Add all saved samples (and ancillary quantities) to the results.
        with warnings.catch_warnings():
            warnings.simplefilter("ignore")
            results = [('niter', self.it - 1),
                       ('ncall', np.array(self.saved_nc)),
                       ('eff', self.eff),
                       ('samples', np.array(self.saved_v)),
                       ('samples_id', np.array(self.saved_id)),
                       ('samples_batch', np.array(self.saved_batch,
                                                  dtype='int')),
                       ('samples_it', np.array(self.saved_it)),
                       ('samples_u', np.array(self.saved_u)),
                       ('samples_n', np.array(self.saved_n)),
                       ('logwt', np.array(self.saved_logwt)),
                       ('logl', np.array(self.saved_logl)),
                       ('logvol', np.array(self.saved_logvol)),
                       ('logz', np.array(self.saved_logz)),
                       ('logzerr', np.sqrt(np.array(self.saved_logzvar))),
                       ('information', np.array(self.saved_h)),
                       ('batch_nlive', np.array(self.saved_batch_nlive,
                                                dtype='int')),
                       ('batch_bounds', np.array(self.saved_batch_bounds))]

        # Add any saved bounds (and ancillary quantities) to the results.
        if self.sampler.save_bounds:
            results.append(('bound', copy.deepcopy(self.bound)))
            results.append(('bound_iter',
                            np.array(self.saved_bounditer, dtype='int')))
            results.append(('samples_bound',
                            np.array(self.saved_boundidx, dtype='int')))
            results.append(('scale', np.array(self.saved_scale)))

        return Results(results)
217319
def iter_values(self):
        
        yVal = self._element.yVal
        if yVal is None:
            return

        for idx in range(yVal.ptCount_val):
            yield yVal.pt_v(idx)
436203
def total_return(self):
        """"""
        pxend = self.close
        pxstart = pxend.shift(1).bfill()
        return (1. + (pxend - pxstart + self.dvds.fillna(0)) / pxstart).cumprod() - 1
124162
def get_all(self):
        ''''''
        for name, values in self._map.items():
            for value in values:
                yield (name, value)
128016
def generateAmplitudes(k):
    """"""
    res = np.array([np.random.random() for i in range(k)])
    return res/res.sum()
34209
def r(self):
        """"""
        if not self._counters_calculated:
            self._counters_calculated = True
            self._extract_counters()

        return self._r
613372
def get_values(item):
    """"""
    fracs = r'|'.join(r.UNI_FRAC)

    value = item.group(2)
    value = re.sub(ur'(?<=\d)(%s)10' % r.MULTIPLIERS, 'e', value)
    value = re.sub(fracs, callback, value, re.IGNORECASE)
    value = re.sub(' +', ' ', value)

    range_separator = re.findall(ur'\d+ ?(-|and|(?:- ?)?to) ?\d', value)
    uncer_separator = re.findall(ur'\d+ ?(\+/-|±) ?\d', value)
    fract_separator = re.findall(ur'\d+/\d+', value)

    uncertainty = None
    if range_separator:
        values = value.split(range_separator[0])
        values = [float(re.sub(r'-$', '', i)) for i in values]
    elif uncer_separator:
        values = [float(i) for i in value.split(uncer_separator[0])]
        uncertainty = values[1]
        values = [values[0]]
    elif fract_separator:
        values = value.split()
        if len(values) > 1:
            values = [float(values[0]) + float(Fraction(values[1]))]
        else:
            values = [float(Fraction(values[0]))]
    else:
        values = [float(re.sub(r'-$', '', value))]

    logging.debug(u'\tUncertainty: %s', uncertainty)
    logging.debug(u'\tValues: %s', values)

    return uncertainty, values
419283
def total_coverage(self):
        ''''''
        if 'COV' in self.FORMAT:
            return sum([int(x) for x in self.FORMAT['COV'].split(',')])
        else:
            return None