当前位置: 首页>>代码示例>>Python>>正文


Python pyflux.t函数代码示例

本文整理汇总了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)
开发者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


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