[시계열] 비정상 확률과정(2)

비정상 확률과정

  • 평균수준이 시간대에 따라 다름
    • -> 결정적Deterministic 추세: regression
    • -> 확률적Stochastic 추세: 차분 & ADF
  • 추세Trend 지님
    • -> 결정적 계절추세: regression
    • -> 확률적 계절추세: 계절 차분
  • 계절성Seasonality 지님
  • 분산 변함

Type of Non-stationary Process

  • $E[y_t] \neq 0$ and change with time: 평균수준이
  • $Var[y_t]$ change with time -> Ranom Walk

Random Walk

  • 확률과정
  • $\epsilon = \text{white noise}, \alpha = intercept$
  • 1) $W_t = W_{t-1} + \epsilon_t$: Pure Random Walk
  • 2) ST: $W_t = \alpha + W_{t-1}+\epsilon_t$: Random Walk with Drift
  • 3) $W_t = \alpha + W_{t-1} + \beta t + \epsilon_t$: Random Walk with Drift and Derministic Trend
  • cf) DT: $Y_t = \alpha + \beta t + \epsilon_t$: Deterministic Trend

Transformation

1. A Random Walk with or without a drift

  • Differencing: $\nabla W_t = W_t - W_{t-1}=\epsilon_t$ or $\alpha + \epsilon_t$
  • Detrending:
    • $Y_t = \alpha + \beta t + \epsilon_t \rightarrow \nabla Y_t=$
1
2
3
4
import statsmodels.api as sm
df = sm.datasets.get_rdataset("CanPop", package="carData").data
df.plot(x='year', y='population')
plt.show()

png

1
2
3
# df = df.set_index('year')
df_diff1 = df - df.shift()
df_diff1.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f8892339390>

png

reference

< !-- add by yurixu 替换Google的jquery并且添加判断逻辑 -->