コード例 #1
0
def test_exponential_model_update():
    model = ExponentialModel(shape=0.001, rate=0.001)
    data = np.array([0.4692680, 3.0101214, 1.3167456, 0.9129425, 0.1696248])

    model.update(data)

    assert model.n_samples_ == 5
コード例 #2
0
def test_poisson_ab_check_models():
    modelA = PoissonModel(shape=25, rate=1000)
    modelB = ExponentialModel(shape=25, rate=1000)

    with raises(TypeError):
        PoissonABTest(modelA=modelA, modelB=modelB)
コード例 #3
0
def test_exponential_mv_check_model_input():
    modelA = ExponentialModel(shape=25, rate=1000)
    modelB = ExponentialModel(shape=25, rate=1000)

    with raises(TypeError):
        ExponentialMVTest(models=[modelA, modelB])
コード例 #4
0
def test_exponential_model_mean_var():
    model = ExponentialModel(shape=0.001, rate=0.001)

    assert np.isnan(model.ppmean())
    assert np.isnan(model.ppvar())
コード例 #5
0
def test_exponential_model_stats():
    model = ExponentialModel(shape=25, rate=1000)

    assert model.ppmean() == approx(41.66666666)
    assert model.ppvar() == approx(1887.077294)
コード例 #6
0
def test_exponential_model_pppdf_x():
    model = ExponentialModel(shape=25, rate=1000)

    assert model.pppdf([-1, 0, 20,
                        100]) == approx([0, 0.025, 0.0149394821, 0.0020976363])