statsmodels.tsa.deterministic.TimeTrend

class statsmodels.tsa.deterministic.TimeTrend(constant=True, order=0)[source]

常数和时间趋势确定项

Parameters:
constantbool

指示是否应包含常量的标志。

orderint

一个非负整数,包含要包含的幂次(1, 2, …, 阶数)。

Attributes:
constant

指示包含常量的标志

is_dummy

指示生成的值是否为虚拟变量的标志

order

时间趋势的阶数

示例

>>> from statsmodels.datasets import sunspots
>>> from statsmodels.tsa.deterministic import TimeTrend
>>> data = sunspots.load_pandas().data
>>> trend_gen = TimeTrend(True, 3)
>>> trend_gen.in_sample(data.index)

方法

from_string(趋势)

从字符串描述创建一个时间趋势。

in_sample(index)

生成用于样本内拟合的确定性趋势。

out_of_sample(steps, index[, forecast_index])

为样本外预测生成确定性趋势

属性

constant

指示包含常量的标志

is_dummy

指示生成的值是否为虚拟变量的标志

order

时间趋势的阶数


Last update: Oct 16, 2024