Pengenalan model ARIMA

Model ARIMA di Python

James Fulton

Climate informatics researcher

Rekap deret waktu nonstasioner

Model ARIMA di Python

Rekap deret waktu nonstasioner

Model ARIMA di Python

Peramalan deret waktu yang dibedakan

Model ARIMA di Python

Merekonstruksi deret waktu asli setelah pembedaan

diff_forecast = results.get_forecast(steps=10).predicted_mean

from numpy import cumsum
mean_forecast = cumsum(diff_forecast)
Model ARIMA di Python

Merekonstruksi deret waktu asli setelah pembedaan

diff_forecast = results.get_forecast(steps=10).predicted_mean

from numpy import cumsum
mean_forecast = cumsum(diff_forecast) + df.iloc[-1,0]
Model ARIMA di Python

Merekonstruksi deret waktu asli setelah pembedaan

Model ARIMA di Python

Model ARIMA

 

  • Ambil selisih
  • Fit model ARMA
  • Integrasikan peramalan

Bisakah kita menghindari pekerjaan sebanyak ini?

Bisa!

ARIMA - Autoregressive Integrated Moving Average

Model ARIMA di Python

Menggunakan model ARIMA

from statsmodels.tsa.arima.model import ARIMA

model = ARIMA(df, order=(p,d,q))
  • p - jumlah lag autoregresif
  • d - orde pembedaan
  • q - jumlah lag moving average

ARIMA$(p,0,q)$ = ARMA$(p,q)$

Model ARIMA di Python

Menggunakan model ARIMA

# Create model
model = ARIMA(df, order=(2,1,1))

# Fit model model.fit()
# Make forecast mean_forecast = results.get_forecast(steps=10).predicted_mean
Model ARIMA di Python

Menggunakan model ARIMA

# Make forecast
mean_forecast = results.get_forecast(steps=steps).predicted_mean

Model ARIMA di Python

Menentukan orde pembedaan

adf = adfuller(df.iloc[:,0])
print('ADF Statistic:', adf[0])
print('p-value:', adf[1])
ADF Statistic: -2.674
p-value: 0.0784
adf = adfuller(df.diff().dropna().iloc[:,0])
print('ADF Statistic:', adf[0])
print('p-value:', adf[1])
ADF Statistic: -4.978
p-value: 2.44e-05
Model ARIMA di Python

Menentukan orde pembedaan

model = ARIMA(df, order=(p,1,q))
Model ARIMA di Python

Ayo berlatih!

Model ARIMA di Python

Preparing Video For Download...