(python)pmdarima.auto_arima(pyramid.auto_arima) 不会自动使用 d 和 D args

(python)pmdarima.auto_arima(pyramid.auto_arima) won't use d and D args automatically

我手动制作了20个模型,发现每个模型应该使用d=1D=1,但是auto_arima 永远不要使用 difference args(甚至一个模型根本没有 dD,并且所有试验都像 (1,0,1) x (0, 0, 1, 52). 我通过设置 trace=True).

检查了它

我想要 auto_arima 进行参数网格搜索 pdq=(0~3, 0~1, 0~3)PDQs=(0~3, 0~1, 0~3, 52).

我将参数设置如下:

    start_p=0,
    start_q=0,
    max_p=3,
    max_d=1,
    max_q=3,
    start_P=0,
    D=None,
    start_Q=0,
    max_P=2,
    max_D=1,
    max_Q=2,
    max_order=10,
    m=52,
    seasonal=True,
    stationary=False,
    information_criterion='aic',
    alpha=0.05,
    test='kpss',
    seasonal_test='ocsb',
    stepwise=True,
    n_jobs=-1,
    start_params=None,
    trend=None,
    method=None,
    transparams=True,
    maxiter=None,
    n_fits=100,
    with_intercept=True,

如何让 auto_arima 进行我想做的网格搜索?

关于 pmdarima 及其对 auto_arima 的实施,您应该了解几件事。我现在正在玩这个,所以我会尽量回答你的问题。

  1. 网格搜索auto_arima的实现使用逐步算法来识别最优参数。它是您上面的参数中的 stepwise,默认情况下设置为 True。在 API 中写着:

    The stepwise algorithm can be significantly faster than fitting all hyper-parameter combinations and is less likely to over-fit the model.

    如果要进行网格搜索,则必须将此参数设置为False

  2. 差分参数:当你尝试这个选项(stepwise=False)时,它应该尝试除两个参数之外的所有组合 - dD。那是因为它们是估计的,不包含在参数搜索中。在问题中列出的参数中,您有两个测试 - testseasonal_test。这些方法分别用于 dD 的 select 值。

    我建议您阅读 Understanding p, d and q 上的文档。您可以更好地了解它们如何处理差分参数估计。

    您也可以尝试直接测试这些方法(只需更改测试值):

from pmdarima.arima.utils import ndiffs
ndiffs(y, test='kpss')

我不知道如何在网格搜索中测试 d 参数,我认为 Python 和 R 实现都做相同或相似的估计。因此,您可以自己和 运行 auto_arima 手动设置差分参数并在网格搜索上休息。否则它将自动为 dD 设置 select 值。问题是 - 当那些自动测试说出不同的东西时,你怎么知道每个模型应该使用 d=1D=1