บทนำสู่อนุกรมเวลาและ Stationarity

ARIMA Models ใน Python

James Fulton

Climate informatics researcher

แรงจูงใจ

อนุกรมเวลาอยู่รอบตัวเรา

  • วิทยาศาสตร์
  • เทคโนโลยี
  • ธุรกิจ
  • การเงิน
  • นโยบาย
ARIMA Models ใน Python

เนื้อหาของคอร์ส

สิ่งที่จะได้เรียนรู้

  • โครงสร้างของโมเดล ARIMA
  • การ Fit โมเดล ARIMA
  • การปรับแต่งโมเดล
  • การพยากรณ์
  • การคำนวณความไม่แน่นอนในการทำนาย
ARIMA Models ใน Python

การโหลดและพล็อตข้อมูล

import pandas as pd
import matplotlib as plt

df = pd.read_csv('time_series.csv', index_col='date', parse_dates=True)
date            values
2019-03-11    5.734193    
2019-03-12    6.288708    
2019-03-13    5.205788    
2019-03-14    3.176578
ARIMA Models ใน Python

Trend

fig, ax = plt.subplots()
df.plot(ax=ax)
plt.show()

ARIMA Models ใน Python

Seasonality

ARIMA Models ใน Python

Cyclicality

ARIMA Models ใน Python

White Noise

อนุกรม White Noise มีค่าที่ไม่สหสัมพันธ์กัน

  • หัว หัว หัว ก้อย หัว ก้อย ...
  • 0.1, -0.3, 0.8, 0.4, -0.5, 0.9, ...
ARIMA Models ใน Python

Stationarity

Stationary

  • Trend stationary: Trend เป็นศูนย์

Not stationary

ARIMA Models ใน Python

Stationarity

Stationary

  • Trend stationary: Trend เป็นศูนย์
  • Variance คงที่

Not stationary

ARIMA Models ใน Python

Stationarity

Stationary

  • Trend stationary: Trend เป็นศูนย์
  • Variance คงที่
  • Autocorrelation คงที่

Not stationary

ARIMA Models ใน Python

การแบ่งข้อมูล Train-Test

# Train data - all data up to the end of 2018
df_train = df.loc[:'2018']

# Test data - all data from 2019 onwards
df_test = df.loc['2019':]
ARIMA Models ใน Python

มาฝึกกันเถอะ!

ARIMA Models ใน Python

Preparing Video For Download...