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

비정상 확률과정

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

Type of Non-stationary Process

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

Random Walk

  • 확률과정
  • ϵ=white noise,α=intercept
  • 1) Wt=Wt1+ϵt: Pure Random Walk
  • 2) ST: Wt=α+Wt1+ϵt: Random Walk with Drift
  • 3) Wt=α+Wt1+βt+ϵt: Random Walk with Drift and Derministic Trend
  • cf) DT: Yt=α+βt+ϵt: Deterministic Trend

Transformation

1. A Random Walk with or without a drift

  • Differencing: Wt=WtWt1=ϵt or α+ϵt
  • Detrending:
    • Yt=α+βt+ϵtYt=
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()

pngpng

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

pngpng

reference

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