Compare commits

..

No commits in common. "3ec98be7cce8e19372bc81390afb03b72c0e2490" and "52e8638a1092384172ae20924bd073d6ffb83855" have entirely different histories.

View File

@ -31,11 +31,9 @@ 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)
@ -81,9 +79,9 @@ def cal_time_series(data, forecast_num=3) -> None:
# 绘制时序图
data.plot()
# 存储图片
plt.savefig('1.png')
plt.show()
plt.savefig('时序图.png')
# 绘制自相关图
plot_acf(data).show()
plot_acf(data).savefig('自相关图.png')
@ -137,8 +135,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)