计算此统计测试时无法理解问题

发布于 2025-02-12 19:19:57 字数 1068 浏览 1 评论 0原文

ljung_box_results = sm.stats.acorr_ljungbox(arima_fit1.resid)
fig, ax = plt.subplots(1, figsize=(10, 6))
sns.scatterplot(x=range(len(ljung_box_results)), y=ljung_box_results.iloc [:, 1], ax=ax)
ax.axhline(0.05, ls='--', color='red')
ax.set(title=f"Ljung-Box test results (after modeling {ticker8} stock prices)", xlabel='Lags', ylabel='p-value')

我遇到的错误是:

AttributeError                            Traceback (most recent call last)
/var/folders/1l/x64tmr_d4yg4qr9l0kcplqdm0000gn/T/ipykernel_17122/3984955723.py in <module>
      3 ljung_box_results = sm.stats.acorr_ljungbox(arima_fit1.resid)
      4 fig, ax = plt.subplots(1, figsize=(10, 6))
----> 5 sns.scatterplot(x=range(len(ljung_box_results)), y=ljung_box_results.iloc [:, 1], ax=ax)
      6 ax.axhline(0.05, ls='--', color='red')
      7 ax.set(title=f"Ljung-Box test results (after modeling {ticker8} stock prices)", xlabel='Lags', ylabel='p-value')

AttributeError: 'tuple' object has no attribute 'iloc'
ljung_box_results = sm.stats.acorr_ljungbox(arima_fit1.resid)
fig, ax = plt.subplots(1, figsize=(10, 6))
sns.scatterplot(x=range(len(ljung_box_results)), y=ljung_box_results.iloc [:, 1], ax=ax)
ax.axhline(0.05, ls='--', color='red')
ax.set(title=f"Ljung-Box test results (after modeling {ticker8} stock prices)", xlabel='Lags', ylabel='p-value')

The error I'm getting is:

AttributeError                            Traceback (most recent call last)
/var/folders/1l/x64tmr_d4yg4qr9l0kcplqdm0000gn/T/ipykernel_17122/3984955723.py in <module>
      3 ljung_box_results = sm.stats.acorr_ljungbox(arima_fit1.resid)
      4 fig, ax = plt.subplots(1, figsize=(10, 6))
----> 5 sns.scatterplot(x=range(len(ljung_box_results)), y=ljung_box_results.iloc [:, 1], ax=ax)
      6 ax.axhline(0.05, ls='--', color='red')
      7 ax.set(title=f"Ljung-Box test results (after modeling {ticker8} stock prices)", xlabel='Lags', ylabel='p-value')

AttributeError: 'tuple' object has no attribute 'iloc'

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文