Compare commits

..

2 Commits

Author SHA1 Message Date
workpc
3ec98be7cc Merge branch 'main' of https://gitea.jayhgq.cn/liurui/PriceForecast 2025-04-10 09:57:21 +08:00
workpc
a22a59c39c arima图保存 2025-04-10 08:58:42 +08:00

View File

@ -31,9 +31,11 @@ def Model_checking(model) -> None:
qqplot(model.resid, line="q", fit=True)
plt.title("Q-Q图")
plt.show()
plt.savefig('QQ图.png')
# 绘制直方图
plt.hist(model.resid, bins=50)
plt.show()
plt.savefig('直方图.png')
# 进行Jarque-Bera检验:判断数据是否符合总体正态分布
jb_test = sm.stats.stattools.jarque_bera(model.resid)
@ -79,8 +81,8 @@ def cal_time_series(data, forecast_num=3) -> None:
# 绘制时序图
data.plot()
# 存储图片
plt.savefig('1.png')
plt.show()
plt.savefig('时序图.png')
# 绘制自相关图
plot_acf(data).show()
@ -135,8 +137,8 @@ def cal_time_series(data, forecast_num=3) -> None:
diff_data.plot(color='orange', title='残差图')
model.resid.plot(figsize=(10, 3))
plt.title("残差图")
plt.savefig('2.png')
plt.show()
plt.savefig('残差图.png')
# 模型检查
Model_checking(model)