Esempio n. 1
0
def test_weibull_param_out_of_bounds(weibull_param_name):
    dist = WeibullDistribution()
    setattr(dist, weibull_param_name, ConstantParam(-np.inf))
    with pytest.raises(ValueError):
        dist.cdf([0, 100], [0, 100], (None, None, None))

    dist = WeibullDistribution()
    setattr(dist, weibull_param_name, ConstantParam(np.inf))
    with pytest.raises(ValueError):
        dist.cdf([0, 100], [0, 100], (None, None, None))
Esempio n. 2
0
def test_weibull_cdf(weibull_shape, weibull_loc, weibull_scale):
    x = np.linspace(0, 20)
    ref_cdf = sts.weibull_min.cdf(x, weibull_shape(None), weibull_loc(None),
                                  weibull_scale(None))
    dist = WeibullDistribution(weibull_shape, weibull_loc, weibull_scale)
    my_cdf = dist.cdf(x, x, (None, None, None))
    assert np.allclose(ref_cdf, my_cdf)