• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python pyflux.t函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了t函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:7,代码来源:gas_llev_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:7,代码来源:gasreg_tests_t.py


示例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])
开发者ID:RJT1990,项目名称:pyflux,代码行数:7,代码来源:gas_llev_tests_t.py


示例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])
开发者ID:RJT1990,项目名称:pyflux,代码行数:7,代码来源:gas_tests_t.py


示例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])
开发者ID:RJT1990,项目名称:pyflux,代码行数:7,代码来源:gasreg_tests_t.py


示例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]
开发者ID:RJT1990,项目名称:pyflux,代码行数:7,代码来源:gasx_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:8,代码来源:gasreg_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:8,代码来源:gasreg_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:8,代码来源:gasreg_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:8,代码来源:gas_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:8,代码来源:gas_llev_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:8,代码来源:gas_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:8,代码来源:gas_llev_tests_t.py


示例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
开发者ID:RJT1990,项目名称:pyflux,代码行数:8,代码来源:gasx_tests_t.py


示例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)
开发者ID:RJT1990,项目名称:pyflux,代码行数:9,代码来源:gas_llev_tests_t.py


示例16: test2_sample_model

def test2_sample_model():
    """
    Tests sampling function
    """
    model = pf.GASReg(formula="y ~ x1 + x2", 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))
开发者ID:RJT1990,项目名称:pyflux,代码行数:9,代码来源:gasreg_tests_t.py


示例17: test2_sample_model

def test2_sample_model():
    """
    Tests sampling function
    """
    model = pf.GASX(formula="y ~ x1 + x2", data=data, ar=1, sc=1, 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
开发者ID:RJT1990,项目名称:pyflux,代码行数:9,代码来源:gasx_tests_t.py


示例18: test_predict_nonconstant

def test_predict_nonconstant():
    """
    We should not really have predictions that are constant (should be some difference)...
    This captures bugs with the predict function not iterating forward
    """
    model = pf.GASX(formula="y ~ x1", data=data, ar=1, sc=1, family=pf.t())
    x = model.fit()
    predictions = model.predict(h=10, oos_data=data_oos, intervals=False)
    assert not np.all(predictions.values == predictions.values[0])
开发者ID:RJT1990,项目名称:pyflux,代码行数:9,代码来源:gasx_tests_t.py


示例19: test_normal_predict_nans

def test_normal_predict_nans():
    """
    Tests that the predictions are not NaNs
    """
    model = pf.GASReg(formula="y ~ x1", data=data, family=pf.t())
    x = model.fit()
    x.summary()
    assert(len(model.predict(h=5, oos_data=data_oos).values[np.isnan(model.predict(h=5, 
        oos_data=data_oos).values)]) == 0)
开发者ID:RJT1990,项目名称:pyflux,代码行数:9,代码来源:gasreg_tests_t.py


示例20: test_t_predict_is_intervals_mh

def test_t_predict_is_intervals_mh():
    """
    Tests prediction intervals are ordered correctly
    """
    model = pf.GASLLEV(data=data, family=pf.t())
    x = model.fit('M-H', nsims=400)
    predictions = model.predict_is(h=10, intervals=True)
    assert(np.all(predictions['99% Prediction Interval'].values > predictions['95% Prediction Interval'].values))
    assert(np.all(predictions['95% Prediction Interval'].values > predictions['5% Prediction Interval'].values))
    assert(np.all(predictions['5% Prediction Interval'].values > predictions['1% Prediction Interval'].values))
开发者ID:RJT1990,项目名称:pyflux,代码行数:10,代码来源:gas_llev_tests_t.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyfmi.load_fmu函数代码示例发布时间:2022-05-25
下一篇:
Python pyflakes.checkPath函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap