Exemplo n.º 1
0
def test_breakpoints_breakpoints_more_regressors(setup_predict,
                                                 expected_predict):
    db = DB[1]
    calc_breakpoints = brkpts(
        formula=setup_predict[db]["formula"],
        data=setup_predict[db]["data"],
        h=setup_predict[db]["h"],
    )[2]
    np.testing.assert_equal(calc_breakpoints,
                            expected_predict[db]["breakpoints"])
Exemplo n.º 2
0
def test_breakpoints_breakpoints_only_intercept(setup_predict,
                                                expected_predict):
    db = DB[0]
    calc_breakpoints = brkpts(
        formula=setup_predict[db]["formula"],
        data=setup_predict[db]["data"],
        h=setup_predict[db]["h"],
    )[2]
    np.testing.assert_equal(calc_breakpoints,
                            expected_predict[db]["breakpoints"])
Exemplo n.º 3
0
def test_bic_breakpoints_only_intercept(setup_predict, expected_predict):
    db = DB[0]
    calc_bic = brkpts(
        formula=setup_predict[db]["formula"],
        data=setup_predict[db]["data"],
        h=setup_predict[db]["h"],
    )[4]
    np.testing.assert_almost_equal(calc_bic,
                                   expected_predict[db]["bic"],
                                   decimal=4,
                                   verbose=True)
Exemplo n.º 4
0
def test_rss_breakpoints_more_regressors(setup_predict, expected_predict):
    db = DB[1]
    calc_rss = brkpts(
        formula=setup_predict[db]["formula"],
        data=setup_predict[db]["data"],
        h=setup_predict[db]["h"],
    )[3]
    np.testing.assert_almost_equal(calc_rss,
                                   expected_predict[db]["rss"],
                                   decimal=4,
                                   verbose=True)