DeepAR

Sungchul Kim·2022년 1월 11일
0
post-thumbnail

Summary

Probabilistic forecasting이란 과거 데이터의 분포를 통해, 미래의 probability distribution을 예측하는 방법이다. → demand forecasting에서 많이 사용됨.

본 연구에서는 Auto-regressive recurrent network model을 기반으로 한 probability model인 DeepAR을 제안함.

  • 시계열 데이터로부터 global model을 학습
  • 여러 도메인의 데이터에 대해서 좋은 결과를 산출

Contribution

  • Probabilistic forecasting model로 LSTM architecture사용
  • 제안한 모델을 가지고 여러 데이터셋에서 실험 및 검증

Goal

P(zi,t0:Tzi,1:t01,xi,1:T)=Πt=t0T(zi,tθ(hi,t,Θ))P(\mathcal{z}_{i,t_{0}:T}|\mathcal{z}_{i,1:t_{0}-1}, \mathcal{x}_{i,1:T}) = \Pi_{t=t_{0}}^{T} \ell(\mathcal{z}_{i,t}|\theta(h_{i, t}, \Theta))
  • 과거시점 zi,1:t01\mathcal{z}_{i,1:t_{0}-1}을 통해 미래시점의 zi,t0:T\mathcal{z}_{i,t_{0}:T}를 예측하는것 → zi,1:t01\mathcal{z}_{i,1:t{0}-1}로부터 zi,t0:T\mathcal{z}_{i,t{0}:T}의 probability를 예측

    • 1시간을 입력으로 받아 미래 30분 예측
    • Condition range : [1,t01][1, t_{0}-1][1,59][1, 59]
    • Prediction range : [t0,T][t_{0}, T][60,90][60, 90]

Method

Notation

Time step(특정 시점을 의미) : tt

Covariates(index, hour, weekday, month의 z-score값으로 이루어진 matrix) : xi,t\mathcal{x}_{i,t}

Target(특정 시점의 μ\mu를 의미) : zi,t\mathcal{z}_{i,t}

Output(특정 시점의 output을 의미) : hi,th_{i,t}

과거시점(Past) / condition range : [1,t01][1, t_{0}-1]

미래(Future) / prediction range : [t0, T][t_{0}, \ T]

Train

각각의 step을 tt, input의 covariate를 xi,t\mathcal{x}_{i,t}, target을 zi,t\mathcal{z}_{i,t}라 하자.

이전 시점의 target, 현재 시점의 covariates, 이전 시점의 output이 network를 → 현재 시점의 output

  • output : hi,t=h(hi,t1,zi,t1,xi,t,Θ)h_{i, t} = h(h_{i, t-1}, z_{i, t-1}, \mathcal{x}_{i, t}, \Theta)tt시점의 μ\mu, σ\sigma
  • (zi,tθi,t)=(zi,tθ(hi,t))\ell(z_{i, t}| \theta_{i,t}) = \ell(z_{i, t}| \theta(h_{i,t})) : output의 distribution으로부터 target(zi,t\mathcal{z}_{i,t})에 대해 likelihood를 구함

hi,0,hi,1 ... hi,t02h_{i, 0}, h_{i, 1} \ ...\ h_{i, t_{0}-2} 를 거쳐 최종적으로 얻은 hi,t01h_{i, t_{0}-1}decoder의 initial state로 사용한다.

→ Encoder의 initial state인 hi,0h_{i, 0}, zi,0z_{i, 0}은 0

Predict

prediction 과정은 아래와 같습니다.

현재 시점을 tt라 가정, t<t0t < t_{0}일때 zi,t\mathcal{z}_{i,t}

(predictionrange) : $t ≥ t{0}$ 일때, z^i,t(θi,t)\mathcal{\hat{z}}_{i,t} \sim \ell(\cdot|\theta_{i, t})

Prediction

학습할때 최종적으로 얻은 hi,t01h_{i, t_{0}-1}를 decoder의 initial state, zi,t01z_{i, t_{0}-1}도 동일.

즉, QΘ(zi,t0:Tzi,1:t01,xi,1:T)Q_{\Theta}(\mathcal{z}_{i,t_{0}:T}|\mathcal{z}_{i,1:t_{0}-1}, \mathcal{x}_{i,1:T})로 부터 z~i,t0:T\tilde z_{i, t_0:T}(prediction range의 target)를 sampling한다.
(Data는 real-value형태 이기 때문에, gaussian likelihood로부터 sampling)

Loss

Average-log-likelihood

Output(μ\mu, σ\sigma)의 분포를 통해 target에 대한 negative likelihood값의 평균을 계산 → negative likelihood의 평균을 낮추는 방향으로 학습을 진행함

Conclusion

  • DeepAR이 어떻게 동작하는지 정리
profile
김성철

0개의 댓글