使用自动arima功能的最大滞后问题

发布于 2025-01-22 20:59:35 字数 1096 浏览 5 评论 0原文

我正在尝试使用Auto Arima功能进行不同产品进行逐步分析。我所有的产品都有从2019年1月到2021年12月(36个数据点)的每月数据。尽管如此,我仍在2021年6月之前使用培训设置,因此需要30分进行培训,然后进行6分进行测试。 有了我的几乎所有产品,我就可以执行Auto Arima分析而没有任何问题,但是对于其中一些产品,如果我设置M = 12(因为是每月的数据),我会遇到问题。 这是我正在使用的代码:

step_wise=auto_arima(y=train[train['CTN']=='HX9004/10']['Quantity Adjusted'],
X=train[train['CTN']=='HX9004/10']['Price'].values.reshape(1, -1).transpose(),
start_p=0,
start_q=0,
start_P=0,
start_Q=0,
seasonal=True,
m=12,
test='kpss',
trace=True, 
error_action='ignore', 
suppress_warnings=True, 
stepwise=False)

公式列车[train ['ctn'] =='HX9004/10'] ['数量调整后的']只是让我每月该特定产品的销售(CTN)。 以下是我在某些产品中遇到的错误:

ValueError: All lag values up to 'maxlag' produced singular matrices. Consider using a longer series, a different lag term or a different test.

以下是我在该功能中使用的数据的一些屏幕截图:

销售 价格

任何帮助都将不胜感激。我不想在不设置的情况下运行一些设置M = 12的产品。

谢谢!

I am trying to run an stepwise analysis using auto arima function for different products. All my products have monthly data from january 2019, till December 2021 (36 data points). Nevertheless, I am using a training set till June 2021, therefore 30 points for training and then 6 points for testing.
With almost all of my products I can perform the auto arima analysis without any problem, but for some of them I am having a problem if I set m=12 (because is monthly data).
Here is the code that I am using:

step_wise=auto_arima(y=train[train['CTN']=='HX9004/10']['Quantity Adjusted'],
X=train[train['CTN']=='HX9004/10']['Price'].values.reshape(1, -1).transpose(),
start_p=0,
start_q=0,
start_P=0,
start_Q=0,
seasonal=True,
m=12,
test='kpss',
trace=True, 
error_action='ignore', 
suppress_warnings=True, 
stepwise=False)

The formula train[train['CTN']=='HX9004/10']['Quantity Adjusted'] simply gives me the sales per month of that specific product (CTN).
Below is the error I am having with some of my products:

ValueError: All lag values up to 'maxlag' produced singular matrices. Consider using a longer series, a different lag term or a different test.

Here are some screenshot of the data I am using in that function:

Sales
Prices

Any help would be much appreciated. I wouldn't like to run some products setting m=12 and others without setting it.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如果没有你 2025-01-29 20:59:35

该问题似乎包含在用于确定季节性的测试类型中。默认情况下,ersional_test参数设置为“ OCSB”,并且可能会丢弃MaxLag错误。尝试将其更改为“ CH”,即

pensional_test ='ch'

The issue seems to be contained in the type of test used to determine seasonality. By default, the seasonal_test parameter is set to 'ocsb' and can throw the maxlag error. Try changing this to 'ch', i.e.

seasonal_test = 'ch'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文