statsmodels.tsa.stattools.breakvar_heteroskedasticity_test¶
-
statsmodels.tsa.stattools.breakvar_heteroskedasticity_test(resid, subset_length=
0.3333333333333333, alternative='two-sided', use_f=True)[source]¶ 残差的异方差性检验
测试样本的第一个子集中的平方和是否与样本的最后一个子集中的平方和显著不同。类似于Goldfeld-Quandt检验。原假设是没有异方差性。
- Parameters:¶
- residarray_like
时间序列模型的残差。 形状为1维(nobs,)或2维(nobs, nvars)。
- subset_length{
int,float} 要测试的子集的长度(h在下面的注释中)。 如果是一个在0 < subset_length < 1之间的浮点数,它将被解释为分数。 默认是1/3。
- alternative
str, ‘increasing’, ‘decreasing’ or ‘two-sided’ 这指定了p值计算的替代方法。默认是双侧的。
- use_fbool,
optional 是否与渐近分布(卡方分布)或近似小样本分布(F分布)进行比较。默认值为True(即默认情况下与F分布进行比较)。
- Returns:¶
注释
原假设是没有异方差性。这意味着根据所选的备择假设,含义有所不同:
- Increasing: Null hypothesis is that the variance is not increasing
在整个样本中;后期子样本的平方和不大于早期子样本的平方和。
- Decreasing: Null hypothesis is that the variance is not decreasing
在整个样本中;早期子样本中的平方和不大于后期子样本中的平方和。
- Two-sided: Null hypothesis is that the variance is not changing
在整个样本中。既要求早期子样本的平方和不大于后期子样本的平方和且后期子样本的平方和不大于早期子样本的平方和。
对于 \(h = [T/3]\),检验统计量为:
\[H(h) = \sum_{t=T-h+1}^T \tilde v_t^2 \Bigg / \sum_{t=1}^{h} \tilde v_t^2\]这个统计量可以与 \(F(h,h)\) 分布进行检验。 或者,\(h H(h)\) 渐近地服从 \(\chi_h^2\) 分布;可以通过传递 use_f=False 作为参数来应用这第二个检验。
参见[1]的第5.4节,了解上述公式和讨论,以及更多细节。
参考文献
[1]哈维, 安德鲁 C. 1990. 预测, 结构时间序列 模型和卡尔曼滤波器. 剑桥大学出版社.
Last update:
Oct 16, 2024