当前位置: 首页>>代码示例>>Python>>正文


Python crv.SingleContinuousPSpace类代码示例

本文整理汇总了Python中crv.SingleContinuousPSpace的典型用法代码示例。如果您正苦于以下问题:Python SingleContinuousPSpace类的具体用法?Python SingleContinuousPSpace怎么用?Python SingleContinuousPSpace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SingleContinuousPSpace类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __new__

    def __new__(cls, rate, symbol=None):
        _value_check(rate > 0, "Rate must be positive.")

        x = symbol or SingleContinuousPSpace.create_symbol()
        pdf = rate * exp(-rate*x)
        obj = SingleContinuousPSpace.__new__(cls, x, pdf, set=Interval(0, oo))
        obj.rate = rate
        return obj
开发者ID:MichaelMayorov,项目名称:sympy,代码行数:8,代码来源:crv_types.py

示例2: __new__

    def __new__(cls, R, symbol=None):
        R = sympify(R)

        x = symbol or SingleContinuousPSpace.create_symbol()
        pdf = 2/(pi*R**2)*sqrt(R**2-x**2)

        obj = SingleContinuousPSpace.__new__(cls, x, pdf, set = Interval(-R, R))
        return obj
开发者ID:Enchanter12,项目名称:sympy,代码行数:8,代码来源:crv_types.py

示例3: __new__

    def __new__(cls, mean, std, symbol = None):

        x = symbol or SingleContinuousPSpace.create_symbol()
        pdf = exp(-(x-mean)**2 / (2*std**2)) / (sqrt(2*pi)*std)
        obj = SingleContinuousPSpace.__new__(cls, x, pdf)
        obj.mean = mean
        obj.std = std
        obj.variance = std**2
        return obj
开发者ID:dileepa123,项目名称:sympy,代码行数:9,代码来源:crv_types.py

示例4: compute_cdf

 def compute_cdf(self, expr, **kwargs):
     from sympy import Lambda, Min
     z = Dummy('z', real=True, bounded=True)
     result = SingleContinuousPSpace.compute_cdf(self, expr, **kwargs)
     result = result(z).subs({Min(z, self.right): z,
                              Min(z, self.left, self.right): self.left})
     return Lambda(z, result)
开发者ID:jenshnielsen,项目名称:sympy,代码行数:7,代码来源:crv_types.py

示例5: __new__

    def __new__(cls, name, mu, s):
        mu, s = sympify(mu), sympify(s)

        x = Symbol(name)
        pdf = exp(-(x - mu)/s)/(s*(1 + exp(-(x - mu)/s))**2)

        obj = SingleContinuousPSpace.__new__(cls, x, pdf)
        return obj
开发者ID:jenshnielsen,项目名称:sympy,代码行数:8,代码来源:crv_types.py


注:本文中的crv.SingleContinuousPSpace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。