Returns the CDF of this distribution.
3989
def MakeCdf(self, steps=101):
        """"""
        xs = [i / (steps - 1.0) for i in xrange(steps)]
        ps = [scipy.special.betainc(self.alpha, self.beta, x) for x in xs]
        cdf = Cdf(xs, ps)
        return cdf
1336809
def distribution(self, limit=1024):
        
        res = self._qexec("%s, count(*) as __cnt" % self.name(), group="%s" % self.name(),
                          order="__cnt DESC LIMIT %d" % limit)
        dist = []
        cnt = self._table.size()
        for i, r in enumerate(res):
            dist.append(list(r) + [i, r[1] / float(cnt)])

        self._distribution = pd.DataFrame(dist, columns=["value", "cnt", "r", "fraction"])
        self._distribution.index = self._distribution.r

        return self._distribution
1063813
def value(self):
        """"""
        return self._sign[1] * self.S0 * norm.cdf(
            self._sign[1] * self.d1, 0.0, 1.0
        ) - self._sign[1] * self.K * np.exp(-self.r * self.T) * norm.cdf(
            self._sign[1] * self.d2, 0.0, 1.0
        )
1160740
def Max(self, k):
        
        cdf = self.Copy()
        cdf.ps = [p ** k for p in cdf.ps]
        return cdf
449346
public static double cdf(double x, double mu, double sigma, double skew) {
    x = (x - mu) / sigma;
    if(Math.abs(skew) > 0.) {
      double tmp = 1 - skew * x;
      if(tmp < 1e-15) {
        return (skew < 0.) ? 0. : 1.;
      }
      x = -FastMath.log(tmp) / skew;
    }
    return .5 + .5 * NormalDistribution.erf(x * MathUtil.SQRTHALF);
  }
523854
def get_distributions(self):
        

        pkg_resources = self.safe_import("pkg_resources")
        libdirs = self.base_paths["libdirs"].split(os.pathsep)
        dists = (pkg_resources.find_distributions(libdir) for libdir in libdirs)
        for dist in itertools.chain.from_iterable(dists):
            yield dist
1257103
def get_density(self):
        """"""
        strc = self.get_output_structure()
        density = sum(strc.get_masses()) / strc.get_volume() * 1.660539040
        return Property(scalars=[Scalar(value=density)], units="g/(cm^3)")
949102
def _cdf(self, xloc, dist, cache):
        """"""
        return evaluation.evaluate_forward(dist, numpy.e**xloc, cache=cache)
448181
def fit(self):
        

        # Defaults/anchors
        best_sse = np.inf
        best_param = (0.0, 1.0)
        best_dist = scs.norm

        # Compute the histogram of `x`.  density=True gives a probability
        # density function at each bin, normalized such that the integral over
        # the range is 1.0
        hist, bin_edges = np.histogram(self.x, bins=self.bins, density=True)

        # The results of np.histogram will have len(bin_edges) = len(hist) + 1
        # Find the midpoint at each bin to reduce the size of bin_edges by 1
        bin_edges = (bin_edges + np.roll(bin_edges, -1))[:-1] / 2.0

        with warnings.catch_warnings():
            warnings.filterwarnings("ignore")

            sses = []
            params = []

            for dist in self.distributions:

                dist = getattr(scs, dist)

                try:
                    # The generic rv_continuous.fit() returns `mle_tuple`:
                    #    'MLEs for any shape parameters (if applicable),
                    #    followed by those for location and scale.'
                    param = *shape, loc, scale = dist.fit(self.x)

                    pdf = dist.pdf(bin_edges, loc=loc, scale=scale, *shape)
                    sse = np.sum(np.power(hist - pdf, 2.0))

                    sses.append(sse)
                    params.append(param)

                    if best_sse > sse > 0.0:
                        best_dist = dist
                        best_param = param
                        best_sse = sse
                        best_pdf = pdf

                except (NotImplementedError, AttributeError):
                    sses.append(np.nan)
                    params.append(np.nan)

        self.best_dist = best_dist
        self.best_param = best_param
        self.best_sse = best_sse
        self.best_pdf = best_pdf

        self.sses = sses
        self.params = params
        self.hist = hist
        self.bin_edges = bin_edges

        return self
366940
def density(self):
        """"""
        h = self.histogram.astype(np.float)
        bindifs = np.array(np.diff(self.bin_edges), float)
        return h / (bindifs * self.n)
1257515
public static double cdf(double val, double loc, double scale) {
    val = (val - loc) / scale;
    return 1. / (1. + FastMath.exp(-val));
  }
1057397
public static double cdf(double x, double k, double theta, double shift) {
    x = (x - shift);
    return x <= 0. ? 0. : GammaDistribution.regularizedGammaP(k, FastMath.log1p(x) * theta);
  }
192114
def read_cdf(self, infile):
        """"""
        if not self.return_cdf:
            self.load_cdf_module()

        if self.cdf_module == "scipy":
            # making it compatible to older scipy versions
            file_obj = self.cdf.netcdf_file(infile, mode="r")
        elif self.cdf_module == "netcdf4":
            file_obj = self.cdf.Dataset(infile)
        else:
            raise ImportError(
                "Could not import data \
                              from file {0}".format(
                    infile
                )
            )
        return file_obj
1129318
def std(self) -> Optional[float]:  #, ddof=0):
        
        # TODO: Add DOF
        if self._stats:
            return np.sqrt(self.variance())
        else:
            return None
604003
def df(self, src):
        ''''''
        return self._getStdOutCmd([self._hadoop_cmd, 'fs', '-df', self._full_hdfs_path(src)], True)
94668
def get_cf_distribution_class():
    """"""
    if LooseVersion(troposphere.__version__) == LooseVersion('2.4.0'):
        cf_dist = cloudfront.Distribution
        cf_dist.props['DistributionConfig'] = (DistributionConfig, True)
        return cf_dist
    return cloudfront.Distribution
431402
def dist(self):
        
        if self.func is None:
            return random.uniform(self.min, self.max)
        if self._dist is None:
            x = numpy.arange(self.min, self.max, (self.max-self.min)/1000.0)
            p = self.func(x).cumsum()
            p -= p.min()
            p /= p.max()
            self._dist = interpolate.interp1d(p, x)
        return self._dist(random.random())