728x90
Definition
moving average (=rolling average or running average)
- 데이터 포인트를 분석하기 위한
- 전체 데이터 집합에서 연속적인 부분 집합들의 평균을 계산하는
- 통계적 방법이다.
MA 중에서도 EMA는
- 최근의 데이터에 더 큰 가중치를 주고
- 오래된 데이터일수록 지수적으로(exponentially) 감소하는 가중치를 적용하여
- 계산하는 이동 평균 임.
주의: EMA는 Auto-regressive model임.
The EMA y for a series x may be calculated recursively:
yt={x1,t=1β⋅xt+(1−β)⋅yt−1,t>1={x1,t=1(1−α)⋅xt+α⋅yt−1,t>1
Where:
- xt is the value at a time t.(시간 간격) ← 즉, 가장 최근 데이터.
- yt is the value of the EMA at any time t. ← t 에서의 EMA
- The coefficient β represents the degree of weighting decrease between 0 and 1.
- α(=1−β) is called a smoothing constant between 0 and 1. (DL등에선 0.9 수준)
- A higher β discounts older observations faster. → 즉, β가 낮을수록 (α가 높을수록), EMA곡선이 smooth해짐.
- 일반적으로 β=21+N (or α=1−21+N=N−11+N)을 취하는데(전자를 주로 취함),
- 여기서 N은 Simple Moving Average 등을 계산할 때의 span, 즉, EMA를 계산할 때 사용하는 subset의 크기로 간주.
- As a rule of thumb, EMA는 최근 1β=11−α개의 sample에 대한 평균 (=averaging over window of 11−α samples)으로 보기도 함.
이름의 유래
Exponentially Weighted Moving Average는
MA에서 특정 데이터의 영향(weight)이 Exponentially decay가 되는 데에서 이름이 유래됨. :
- EMA는 이 전의 값(위 식의 yt−1 )에 비례(1−β)하여
- 현재의 EMA에 영향을 주기 때문에 Exponential decay가 됨.
이름과 다르게
EMA는
MA 모델이 아닌
AR모델에 해당함.
Mathematical Proof of EMA's Exponential Decay: A Differential Equation Approach
Yt+1−Yt=−βYtY′=−βYdYdt=−βY∫1YdY=∫−βdtlnY+C1=−βt+C2lnY=−βt+C3Y=e−βt+C3Y=eC3e−βtY=Ae−βt
위 식에서
- β가 0 보다 작을 경우(앞에 -기호때문에), exponential growth
- β가 0 일 경우, constant
- β가 0 보다 클 경우, exponential decay임.
참고로 C1,C2,C3는 적분 상수(integration constants)이며, A=eC3는 초기 조건에 의해 결정되는 상수임.
- C3=C2−C1
- A=eC3
반응형
'... > Math' 카테고리의 다른 글
[Math] Extremum Point, Inflection Point, Saddle Point, Convex and Concave. (0) | 2025.01.05 |
---|---|
[Math] Binomial Theorem (이항정리) (0) | 2025.01.04 |
[Math] Basis (0) | 2024.10.28 |
[Math] Inner Product (or Hermitian Inner Product, 내적) (5) | 2024.10.28 |
[Statistics] Tail, Head, and Distribution (w/ Moment) (0) | 2024.09.26 |