# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: 'Python 3.7.6 64-bit (''base'': conda)'
#     name: python3
# ---

# ## AR + MA models
#
# 1. 「AR」*Autoregression*，自回归模型；
#
# 2. 「MA」*Moving Average*，滑动平均模型；
#
# 3. 「ARMA」*Autoregressive Moving Average*，自回归滑动平均模型；
#
# 4. 「ARIMA」*Autoregressive Integrated Moving Average*，差分自回归移动平均模型；
#
# 5. 「SARIMA」*Seasonal Autoregressive Integrated Moving-Average*，季节性差分自回归移动平均模型；
#
# 6. 「SARIMAX」*Seasonal Autoregressive Integrated Moving-Average with Exogenous Regressors*，外生变量的季节性差分自回归移动平均模型；
#
# 7. 「VAR」*Vector Autoregression*，向量自回归模型；
#
# 8. 「VARMA」*Vector Autoregression Moving-Average*，向量自回归滑动平均模型；
#
# 9. 「VARMAX」*Vector Autoregression Moving-Average with Exogenous Regressors*，外生变量的向量自回归滑动平均模型；

# ## AR + MA

# AR example
from statsmodels.tsa.ar_model import AutoReg
from random import random
# contrived dataset
data = [x + random() for x in range(1, 100)]
# fit model
model = AutoReg(data, lags=1)
model_fit = model.fit()
# make prediction
yhat = model_fit.predict(len(data), len(data))
print(yhat)

StarcoderdataJupyterScriptsDedupFiltered