本文整理匯總了Python中statsmodels.tsa.arima_process.ArmaProcess.acovf方法的典型用法代碼示例。如果您正苦於以下問題:Python ArmaProcess.acovf方法的具體用法?Python ArmaProcess.acovf怎麽用?Python ArmaProcess.acovf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類statsmodels.tsa.arima_process.ArmaProcess
的用法示例。
在下文中一共展示了ArmaProcess.acovf方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_arma_acovf_persistent
# 需要導入模塊: from statsmodels.tsa.arima_process import ArmaProcess [as 別名]
# 或者: from statsmodels.tsa.arima_process.ArmaProcess import acovf [as 別名]
def test_arma_acovf_persistent():
# Test arma_acovf in case where there is a near-unit root.
# .999 is high enough to trigger the "while ir[-1] > 5*1e-5:" clause,
# but not high enough to trigger the "nobs_ir > 50000" clause.
ar = np.array([1, -.9995])
ma = np.array([1])
process = ArmaProcess(ar, ma)
res = process.acovf(10)
# Theoretical variance sig2 given by:
# sig2 = .9995**2 * sig2 + 1
sig2 = 1/(1-.9995**2)
corrs = .9995**np.arange(10)
expected = sig2*corrs
assert_equal(res.ndim, 1)
assert_allclose(res, expected, atol=1e-6)