當前位置: 首頁>>代碼示例>>Python>>正文


Python special.ndtri方法代碼示例

本文整理匯總了Python中scipy.special.ndtri方法的典型用法代碼示例。如果您正苦於以下問題:Python special.ndtri方法的具體用法?Python special.ndtri怎麽用?Python special.ndtri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在scipy.special的用法示例。


在下文中一共展示了special.ndtri方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _norm_ppf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _norm_ppf(q):
    return sc.ndtri(q) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:4,代碼來源:_continuous_distns.py

示例2: _ppf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _ppf(self, q, a):
        return 1.0/np.asarray(a-sc.ndtri(q*_norm_cdf(a))) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:4,代碼來源:_continuous_distns.py

示例3: _ndtri_cpu

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _ndtri_cpu(x, dtype):
    from scipy import special
    return numpy.vectorize(special.ndtri, otypes=[dtype])(x) 
開發者ID:chainer,項目名稱:chainer,代碼行數:5,代碼來源:test_ndtri.py

示例4: label

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def label(self):
        return 'ndtri' 
開發者ID:chainer,項目名稱:chainer,代碼行數:4,代碼來源:ndtri.py

示例5: forward_cpu

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def forward_cpu(self, x):
        if not available_cpu:
            raise ImportError('SciPy is not available. Forward computation'
                              ' of ndtri in CPU can not be done.' +
                              str(_import_error))
        self.retain_outputs((0,))
        return utils.force_array(special.ndtri(x[0]), dtype=x[0].dtype), 
開發者ID:chainer,項目名稱:chainer,代碼行數:9,代碼來源:ndtri.py

示例6: ndtri

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def ndtri(x):
    """Elementwise inverse function of ndtr.

    .. note::
       Forward computation in CPU can not be done if
       `SciPy <https://www.scipy.org/>`_ is not available.

    Args:
        x (:class:`~chainer.Variable` or :ref:`ndarray`): Input variable.

    Returns:
        ~chainer.Variable: Output variable.
    """
    return Ndtri().apply((x,))[0] 
開發者ID:chainer,項目名稱:chainer,代碼行數:16,代碼來源:ndtri.py

示例7: p_to_z

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def p_to_z(p, tail='two'):
    """Convert p-values to (unsigned) z-values.

    Parameters
    ----------
    p : array_like
        P-values
    tail : {'one', 'two'}, optional
        Whether p-values come from one-tailed or two-tailed test. Default is
        'two'.

    Returns
    -------
    z : array_like
        Z-statistics (unsigned)
    """
    eps = np.spacing(1)
    p = np.array(p)
    p[p < eps] = eps
    if tail == 'two':
        z = ndtri(1 - (p / 2))
        z = np.array(z)
    elif tail == 'one':
        z = ndtri(1 - p)
        z = np.array(z)
        z[z < 0] = 0
    else:
        raise ValueError('Argument "tail" must be one of ["one", "two"]')

    if z.shape == ():
        z = z[()]
    return z 
開發者ID:neurostuff,項目名稱:NiMARE,代碼行數:34,代碼來源:transforms.py

示例8: setUp

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def setUp(self):
        np.random.seed(1983)
        shape = (2, 3)
        self.mu = np.random.normal(size=shape)
        self.sig = np.square(np.random.normal(size=shape))
        self.obs = np.random.normal(loc=self.mu, scale=self.sig, size=shape)

        n = 1000
        q = np.linspace(0. + 0.5 / n, 1. - 0.5 / n, n)
        # convert to the corresponding normal deviates
        normppf = special.ndtri
        z = normppf(q)

        forecasts = z.reshape(-1, 1, 1) * self.sig + self.mu
        self.expected = crps_ensemble(self.obs, forecasts, axis=0) 
開發者ID:TheClimateCorporation,項目名稱:properscoring,代碼行數:17,代碼來源:test_crps.py

示例9: _cdf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _cdf(self, x, C, Ci):
        out = special.ndtr(numpy.dot(Ci, special.ndtri(x)))
        return out 
開發者ID:jonathf,項目名稱:chaospy,代碼行數:5,代碼來源:nataf.py

示例10: _ppf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _ppf(self, q, C, Ci):
        out = special.ndtr(numpy.dot(C, special.ndtri(q)))
        return out 
開發者ID:jonathf,項目名稱:chaospy,代碼行數:5,代碼來源:nataf.py

示例11: _ppf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _ppf(self, q, c):
        tmp = c*special.ndtri(q)
        return 0.25*(tmp + numpy.sqrt(tmp**2 + 4))**2 
開發者ID:jonathf,項目名稱:chaospy,代碼行數:5,代碼來源:fatigue_life.py

示例12: _ppf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _ppf(self, q):
        val = special.ndtri(1-q/2.0)
        return 1.0/(val*val) 
開發者ID:jonathf,項目名稱:chaospy,代碼行數:5,代碼來源:levy.py

示例13: _ppf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _ppf(self, q, c):
        return -special.ndtri(pow(1-q, 1./c)) 
開發者ID:jonathf,項目名稱:chaospy,代碼行數:4,代碼來源:power_normal.py

示例14: _ppf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _ppf(self, q, a, b, mu, sigma):
        fa = special.ndtr((a-mu)/sigma)
        fb = special.ndtr((b-mu)/sigma)
        return special.ndtri(q*(fb-fa) + fa)*sigma + mu 
開發者ID:jonathf,項目名稱:chaospy,代碼行數:6,代碼來源:trunc_normal.py

示例15: _ppf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import ndtri [as 別名]
def _ppf(self, q, C, Ci, loc):
        return (numpy.dot(C, special.ndtri(q)).T+loc.T).T 
開發者ID:jonathf,項目名稱:chaospy,代碼行數:4,代碼來源:mv_normal.py


注:本文中的scipy.special.ndtri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。