[시계열분석-7]자기상관과 AR모델
『Disclaimer: 본 글은 대학원의 시계열분석 수업 및 시계열분석 서적에 관한 공부 내용을 정리하는 시리즈입니다.
본 내용은 필자가 전부 직접 요약하여 적은 개인 노트이며, 개인 공부 및 복습이 주목적일 뿐, 상업적 의도는 없습니다.
Source: Regression Modeling with Actuarial and Financial Applications by Edward W. Frees』
7-1. Autocorrelation
Autocorrelation식은 아래와 같다.
7-2. Autoregressive Models of Order One
과거의 모든 information은 most recent observation에 담겨 있다는 것을 가정한다. (Markov)
여기서 β0는 아무 fixed constant일 수 있지만, -1<β1<1 이어야만 AR(1) series {yt}가 stationary다.
만약 β1 = 1이면 모델은 RW 모델이 되고 nonstationary다.
만약 β1 = 0이면 모델은 WN 모델이 된다. 따라서 AR(1)은 RW, WN 모델의 일반화라고 봐도 된다.
어떤 데이터가 AR 모델이 적합함을 알려면
1) Control chart 등으로 stationarity를 체크
2) Adjacent realization들이 관련됨을 scatter plot 등으로 체크
3) Autocorrelation가 아래의 식을 충족함을 체크
위 식에서 처음 두 등호는 정의이고, 세번째는 stationarity에 의거한다.
위 식을 통해, AR 모델에서 autocorrelation은 lag가 increase함에 따라 geometric rate으로 줄어듬을 알 수 있다.
(실제 autocorrelation r값을 계산하여 이것이 0에 가까우면 WN이다)
실제 rk값이 0과 significantly 다른지 확인해보려면 아래의 근사를 사용한다.
Rule of thumb은 rk의 절대값이 2 x se(rk)를 넘으면 significantly nonzero라고 한다.
7-3. Estimation
Parameter를 estimate하는데는 method of conditional least squares를 사용한다.
이는 least squares estimates that best fit observation conditional on the previous observation이다.
그리고 AR(1)의 residual은,
Cross-sectional regression에서는 설명변수가 nonstochastic이므로 response와 error term의 variance가 갔다.
하지만 시계열 모델에서는 stochastic이므로, AR(1)의 경우
가 되어 response의 variance가 더 크다.
여기서 error variance의 estimate은,

이고 이 s2가 MSE다.
7-4. Prediction
그러면 forecast error는,
![]()

7-5. Box Jenkins Models
Autoregressive Integrated Moving Average(ARIMA) 모델은 더 일반화된 모델이다.
7-5-1. AR(p) Model
먼저, AR(1)를 더 일반화한 AR(p)다.
단, seasonality를 모델링할 때 intervening lag들은 포함하지 않는다.
AR(p)는 stationary stochastic process다.
* Backshift Notation
Backshift 혹은 backward-shift operator B는 Byt = yt-1로 정의된다.
이 operator는 linear하다.
Backshift operator를 사용해서 AR(p)를 표현하면,

따라서 Φ(x) = 0 식에는 p개의 complex root가 있다.
Stationarity를 위해서는 이 root들이 strictly outside of unit circle이어야만 한다.
(Root 중에 unit circle에 가까운게 있으면 model behavior가 불안정하다)
7-5-2. MA(q) Model
위 모델의 한가지 해석은, disturbance term이 true expected value of yt를 perturb한다는 것이다.
여기서 비롯된 것이 Moving Average Model of Order q, MA(q) 모델이다.
이 모델에서,
![]()
임을 알 수 있는데, 즉 memory를 length q로 limit하는 것이다.
AR(p) 모델과 달리 MA(q) 모델은 모든 finite value of 베타/세타에 대해 stationary다.
MA(q) 모델을 backshift notation을 사용하여 표현하면,
7-5-3. ARMA Model
AR과 MA모델을 합하면, ARMA(p, q) 모델, Autoregressive Moving Average Model of order p and q가 된다.
![]()
7-5-4. ARIMA Model
많은 application에서, stationary를 위해서는 differencing이 필요하다.
wt = (1 - B)yt = yt - yt-1는 yt를 한번 differencing하는 것이고, 일반화하면,

실전에서 d는 0, 1, 2 중에 하나고, 2이상이면 회의적으로 모델을 바라볼 필요가 있다.
이를 이용한 모델이 ARIMA(p, d, q) 모델, Autoregressive Integrated Moving Average Model이다.
![]()
7-5-5. Forecasting
여기서도 conditional expectation을 계산한다. 이제까지의 response realization으로 미래를 forecast한다.
t = T + l으로 두고 7-5-3 ARMA 모델식의 양변에 ET를 취하면,

그리고 yT+k의 값은 time T에 이미 known이므로,
특별한 케이스로, AR(1)는 이미 보았고, MA(1)는
l >= 2일 경우,
![]()
l = 1일 경우,
아무 ARIMA모델은 MA model로 표현할 수 있는데,
Ψ-coefficient representation이라고 하며,
즉 process의 current value는 current and previous disturbances의 linear combination으로 표현할 수 있다는 것이다.
AR(1) model의 경우,
8.6 예시 읽어보기
| Number | Title | Author | Date | Votes | Views |
| Notice |
[공지]Data Science 게시판의 운영에 관하여
Irealist
|
2020.05.18
|
Votes 0
|
Views 1966
|
Irealist | 2020.05.18 | 0 | 1966 |
| 37 |
[통계분석-3]Statistical Concepts(작성중)
Irealist
|
2020.08.23
|
Votes 0
|
Views 1578
|
Irealist | 2020.08.23 | 0 | 1578 |
| 36 |
[통계분석-2]Statistical Data
Irealist
|
2020.08.04
|
Votes 0
|
Views 1896
|
Irealist | 2020.08.04 | 0 | 1896 |
| 35 |
[통계분석-1]통계 분석 시리즈를 시작하며 / Introduction
Irealist
|
2020.08.04
|
Votes 0
|
Views 1739
|
Irealist | 2020.08.04 | 0 | 1739 |
| 34 |
[강화학습-14]Sutton 교과서 챕터 13: Policy Gradient Methods
Irealist
|
2020.06.21
|
Votes 0
|
Views 2411
|
Irealist | 2020.06.21 | 0 | 2411 |
| 33 |
[강화학습-13]Sutton 교과서 챕터 11: Off-policy Methods with Approximation
Irealist
|
2020.06.17
|
Votes 0
|
Views 1711
|
Irealist | 2020.06.17 | 0 | 1711 |
| 32 |
[강화학습-12]Sutton 교과서 챕터 10: On-policy Control with Approximation
Irealist
|
2020.06.17
|
Votes 0
|
Views 1577
|
Irealist | 2020.06.17 | 0 | 1577 |
| 31 |
[강화학습-11]Sutton 교과서 챕터 9: On-Policy Prediction with Approximation
Irealist
|
2020.06.15
|
Votes 0
|
Views 1901
|
Irealist | 2020.06.15 | 0 | 1901 |
| 30 |
[강화학습-10]Sutton 교과서 챕터 2: Multi-armed Bandits
Irealist
|
2020.06.04
|
Votes 0
|
Views 2138
|
Irealist | 2020.06.04 | 0 | 2138 |
| 29 |
[강화학습-9]Sutton 교과서 챕터 17.4: Designing Reward Signals
Irealist
|
2020.06.04
|
Votes 0
|
Views 1485
|
Irealist | 2020.06.04 | 0 | 1485 |
| 28 |
[강화학습-8]Sutton 교과서 챕터 12: Eligibility Traces
Irealist
|
2020.05.28
|
Votes 0
|
Views 3576
|
Irealist | 2020.05.28 | 0 | 3576 |
| 27 |
[강화학습-7]Sutton 교과서 챕터 7: n-step Bootstrapping
Irealist
|
2020.05.28
|
Votes 0
|
Views 2951
|
Irealist | 2020.05.28 | 0 | 2951 |
| 26 |
[강화학습-6]Sutton 교과서 챕터 8: Tabular Methods
Irealist
|
2020.05.27
|
Votes 0
|
Views 1388
|
Irealist | 2020.05.27 | 0 | 1388 |
| 25 |
[강화학습-5]Sutton 교과서 챕터 6: Temporal-Difference Learning
Irealist
|
2020.05.23
|
Votes 0
|
Views 1972
|
Irealist | 2020.05.23 | 0 | 1972 |
| 24 |
[강화학습-4]Sutton 교과서 챕터 5: Monte Carlo Methods
Irealist
|
2020.05.19
|
Votes 0
|
Views 2279
|
Irealist | 2020.05.19 | 0 | 2279 |
| 23 |
[강화학습-3]Sutton 교과서 챕터 4: Dynamic Programming
Irealist
|
2020.05.19
|
Votes 0
|
Views 1980
|
Irealist | 2020.05.19 | 0 | 1980 |