当前位置: 首页>>代码示例>>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;未经允许,请勿转载。