本文整理汇总了Python中pyflux.t函数的典型用法代码示例。如果您正苦于以下问题:Python t函数的具体用法?Python t怎么用?Python t使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了t函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_t_predict_is_length
def test_t_predict_is_length():
"""
Tests that the prediction IS dataframe length is equal to the number of steps h
"""
model = pf.GASLLEV(data=data, family=pf.t())
x = model.fit()
assert(model.predict_is(h=5).shape[0] == 5)
示例2: test2_normal_predict_is_length
def test2_normal_predict_is_length():
"""
Tests that the length of the predict IS dataframe is equal to no of steps h
"""
model = pf.GASReg(formula="y ~ x1 + x2", data=data, family=pf.t())
x = model.fit()
assert(model.predict_is(h=5).shape[0] == 5)
示例3: test_t_bbvi_mini_batch_elbo
def test_t_bbvi_mini_batch_elbo():
"""
Tests that the ELBO increases
"""
model = pf.GASLLEV(data=data, family=pf.t())
x = model.fit('BBVI',iterations=100, mini_batch=32, record_elbo=True, map_start=False)
assert(x.elbo_records[-1]>x.elbo_records[0])
示例4: test_t_bbvi_elbo
def test_t_bbvi_elbo():
"""
Tests that the ELBO increases
"""
model = pf.GAS(data=data, ar=1, sc=1, family=pf.t())
x = model.fit('BBVI',iterations=100, record_elbo=True)
assert(x.elbo_records[-1]>x.elbo_records[0])
示例5: test_normal_bbvi_mini_batch_elbo
def test_normal_bbvi_mini_batch_elbo():
"""
Tests that the ELBO increases
"""
model = pf.GASReg(formula="y ~ x1 + x2", data=data, family=pf.t())
x = model.fit('BBVI',iterations=100, mini_batch=32, record_elbo=True)
assert(x.elbo_records[-1]>x.elbo_records[0])
示例6: test2_bbvi_mini_batch_elbo
def test2_bbvi_mini_batch_elbo():
"""
Tests that the ELBO increases
"""
model = pf.GASX(formula="y ~ x1 + x2", data=data, ar=1, sc=1, family=pf.t())
x = model.fit("BBVI", iterations=500, mini_batch=32, record_elbo=True, map_start=False)
assert x.elbo_records[-1] > x.elbo_records[0]
示例7: test2_ppc
def test2_ppc():
"""
Tests PPC value
"""
model = pf.GASReg(formula="y ~ x1 + x2", data=data, family=pf.t())
x = model.fit('BBVI', iterations=100)
p_value = model.ppc()
assert(0.0 <= p_value <= 1.0)
示例8: test2_normal_predict_is_nans
def test2_normal_predict_is_nans():
"""
Tests that the predictions in-sample are not NaNs
"""
model = pf.GASReg(formula="y ~ x1 + x2", data=data, family=pf.t())
x = model.fit()
x.summary()
assert(len(model.predict_is(h=5).values[np.isnan(model.predict_is(h=5).values)]) == 0)
示例9: test_normal_predict_length
def test_normal_predict_length():
"""
Tests that the length of the predict dataframe is equal to no of steps h
"""
model = pf.GASReg(formula="y ~ x1", data=data, family=pf.t())
x = model.fit()
x.summary()
assert(model.predict(h=5, oos_data=data_oos).shape[0] == 5)
示例10: test_t_predict_length
def test_t_predict_length():
"""
Tests that the prediction dataframe length is equal to the number of steps h
"""
model = pf.GAS(data=data, ar=2, sc=2, family=pf.t())
x = model.fit()
x.summary()
assert(model.predict(h=5).shape[0] == 5)
示例11: test_t_ppc
def test_t_ppc():
"""
Tests PPC value
"""
model = pf.GASLLEV(data=data, family=pf.t())
x = model.fit('BBVI', iterations=100)
p_value = model.ppc()
assert(0.0 <= p_value <= 1.0)
示例12: test_t_predict_nans
def test_t_predict_nans():
"""
Tests that the predictions are not nans
"""
model = pf.GAS(data=data, ar=2, sc=2, family=pf.t())
x = model.fit()
x.summary()
assert(len(model.predict(h=5).values[np.isnan(model.predict(h=5).values)]) == 0)
示例13: test_t_predict_is_nans
def test_t_predict_is_nans():
"""
Tests that the in-sample predictions are not nans
"""
model = pf.GASLLEV(data=data, family=pf.t())
x = model.fit()
x.summary()
assert(len(model.predict_is(h=5).values[np.isnan(model.predict_is(h=5).values)]) == 0)
示例14: test2_ppc
def test2_ppc():
"""
Tests PPC value
"""
model = pf.GASX(formula="y ~ x1 + x2", data=data, ar=1, sc=1, family=pf.t())
x = model.fit("BBVI", iterations=100)
p_value = model.ppc()
assert 0.0 <= p_value <= 1.0
示例15: test_t_sample_model
def test_t_sample_model():
"""
Tests sampling function
"""
model = pf.GASLLEV(data=data, family=pf.t())
x = model.fit('BBVI', iterations=100)
sample = model.sample(nsims=100)
assert(sample.shape[0]==100)
assert(sample.shape[1]==len(data)-1)