ARMA Model

3 minute read

ARMA Model

AR ๋ชจ๋ธ๊ณผ MA ๋ชจ๋ธ์€ ๊ฐ๊ฐ ์•„๋ž˜์™€ ๊ฐ™์€ ์ƒํ™ฉ์—์„œ ์‚ฌ์šฉํ–ˆ์—ˆ๋‹ค.

  • You would choose an AR model if you believe that โ€œprevious observations have a direct effect on the time seriesโ€.
  • You would choose an MA model if you believe that โ€œthe weighted sum of lagged errors have a direct effect on the time seriesโ€.

๊ทธ๋Ÿฌ๋‚˜ AR๊ณผ MA ๊ทธ ์–ด๋Š ๊ฒƒ๋„ ์„ธ์ƒ์˜ ๋ชจ๋“  ์‹œ๊ณ„์—ด์„ ๋ชจ๋ธ๋งํ•  ์ˆ˜ ์žˆ๋Š” ๊ฑด ์•„๋‹ˆ๋‹ค.

ARMA ๋ชจ๋ธ์€ AR ๋ชจ๋ธ๊ณผ MA ๋ชจ๋ธ์„ ๊ฒฐํ•ฉํ•œ ๋ชจ๋ธ์ด๋‹ค. ์ˆ˜์‹์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

Definition. ARMA Model

\[X(t) = \left( \phi_0 + \phi_1 X(t-1) + \cdots + \phi_p X(t-p) \right) + \left( \epsilon(t) + \theta_1 \epsilon(t-1) + \cdots + \theta_q \epsilon(t-q) \right)\]

where all $\epsilon(t)$ are white noise.

๋ณดํ†ต $\phi_0$๋Š” ์‹œ๊ณ„์—ด์˜ ํ‰๊ท  $\mu = E \left[ X(t) \right]$๋กœ ๋‘”๋‹ค.

Hyper-parameter๋Š” ๋ช‡๊ฐœ์˜ Lag์™€ ๋ช‡๊ฐœ์˜ Lagged Error๋ฅผ ์“ธ ๊ฒƒ์ธ์ง€์— ๋Œ€ํ•œ $p$์™€ $q$ ๊ฐ’์ด๋‹ค.

\[\text{ARMA}(p, q)\]

๋ผ๊ณ  ํ‘œํ˜„ํ•œ๋‹ค.

MA๋กœ ๋ชจ๋ธ๋งํ•˜๊ธฐ ์œ„ํ•ด์„  ์‹œ๊ณ„์—ด ๋ฐ์ดํ„ฐ๊ฐ€ โ€œ์ •์ƒ์„ฑโ€์„ ๊ฐ€์ ธ์•ผ ํ–ˆ๋‹ค. ๋”ฐ๋ผ์„œ ARMA ๋ชจ๋ธ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ โ€œ์ •์ƒ์„ฑโ€์ด ์žˆ๋Š” ์‹œ๊ณ„์—ด์„ ๋ชจ๋ธ๋งํ•˜๋Š”๋ฐ ์‚ฌ์šฉํ•œ๋‹ค.

ARIMA Model

๊ทธ๋Ÿผ ๋น„์ •์ƒ์„ฑ ์‹œ๊ณ„์—ด์—์„  ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ• ๊นŒ? ๋‹ต์€ ๊ฐ„๋‹จํ•˜๋‹ค. ๐Ÿ‘ <์ฐจ๋ถ„(Differencing)>์„ ํ•ด์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ •์ƒ์„ฑ ์‹œ๊ณ„์—ด๋กœ ๋ณ€ํ™˜ํ•ด์ฃผ๋ฉด ๋œ๋‹ค! ARIMA ๋ชจ๋ธ์„ ARMA ๋ชจ๋ธ์— $d$ํšŒ ์ฐจ๋ถ„์„ ์ˆ˜ํ–‰ํ•œ ๋ชจ๋ธ์ด๋‹ค!

์ด๋•Œ, ARIMA ๋ชจ๋ธ์—์„œ โ€œIโ€๋Š” ์ฐจ๋ถ„(Differencing)์˜ โ€œDโ€๊ฐ€ ์•„๋‹ˆ๋ผ โ€œIntegratedโ€์˜ โ€œIโ€์ด๋‹ค.

Definition. ARIMA Model

\[X'(t) = \left( \phi_0 + \phi_1 X'(t-1) + \cdots + \phi_p X'(t-p) \right) + \left( \epsilon(t) + \theta_1 \epsilon(t-1) + \cdots + \theta_q \epsilon(t-q) \right)\]

where all $\epsilon(t)$ are white noise.

$Xโ€™(t)$ means 1st differenced time series, $X^{(d)}(t)$ means $d$-order differenced time series.

๊ฒฐ๊ตญ, ARIMA๋Š” $d$๋ฒˆ ์ฐจ๋ถ„์œผ๋กœ ์ •์ƒ์„ฑ์„ ํ™•๋ณดํ•œ ์‹œ๊ณ„์—ด์— ARMA๋กœ ๋ชจ๋ธ๋งํ•œ ๊ฒƒ์— ๋ถˆ๊ณผํ•˜๋‹ค!

Hyper-parameter์— ๋ช‡๋ฒˆ ์ฐจ๋ถ„์„ ์ˆ˜ํ–‰ํ–ˆ๋Š”์ง€์— ๋Œ€ํ•œ $d$๊ฐ€ ์ถ”๊ฐ€๋˜์—ˆ๋‹ค.

\[\text{ARIMA}(p, d, q)\]

Example

goog200 ๋ฐ์ดํ„ฐ์— ๋Œ€ํ•ด $d = 0$์œผ๋กœ ๋‘๊ณ , $p$์™€ $q$๋ฅผ 0๋ถ€ํ„ฐ 2๊นŒ์ง€ ๋ณ€ํ™”์‹œํ‚จ ๊ฒฐ๊ณผ์ด๋‹ค. ์ƒ๊ฐ๋ณด๋‹ค Fitting์ด ์ž˜ ๋˜๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

์—ฌ๊ธฐ์„œ๋Š” ARIMA ๋ชจ๋ธ ์˜ˆ์ธก์˜ ๋Œ€๋žต์ ์ธ ๊ทธ๋ฆผ๋งŒ ๋ณด๊ณ , Hyper-parameter๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ๊ตฌ์ฒด์ ์ธ ๋ฐฉ๋ฒ•์€ ๋ณ„๋„์˜ ํฌ์ŠคํŠธ์—์„œ ๋‹ค๋ฃจ๋„๋ก ํ•˜๊ฒ ๋‹ค. ๐Ÿ‘

Reference