정상확률과정과 비정상확률과정 기초개념

2019-05-24

.

그림, 실습코드 등 학습자료 출처 : https://datascienceschool.net

1. Stationary process(정상확률과정)

1

2. 에르고딕 성질

2

3. Non-stationary process(비정상확률과정)

3

  • 비정상확률 예시
%matplotlib inline
%config InlineBackend.figure_format = 'retina'

df = sm.datasets.get_rdataset("CanPop", package="carData").data
df.plot(x="year", y="population")
plt.xlabel("year")
plt.ylabel("population")
plt.title("population of canada by time")
plt.show()

정상확률과정과 비정상확률과정 기초개념_7_0

4

%matplotlib inline
%config InlineBackend.figure_format = 'retina'

N = 500
t1 = 100
t2 = 400
t = np.arange(N)

np.random.seed(12)
y1 = np.insert(np.cumsum(sp.stats.norm.rvs(size=N-1)), 0, 0)
np.random.seed(18)
y2 = np.insert(np.cumsum(sp.stats.norm.rvs(size=N-1)), 0, 0)
np.random.seed(22)
y3 = np.insert(np.cumsum(sp.stats.norm.rvs(size=N-1)), 0, 0)
np.random.seed(24)
y4 = np.insert(np.cumsum(sp.stats.norm.rvs(size=N-1)), 0, 0)

plt.subplot(211)
plt.plot(t, y1)
plt.plot(t, y2)
plt.plot(t, y3)
plt.plot(t, y4)
plt.plot(t1, y1[t1], 'o', markersize=5)
plt.plot(t2, y1[t2], 'o', markersize=5)
plt.plot(t1, y2[t1], 'o', markersize=5)
plt.plot(t2, y2[t2], 'o', markersize=5)
plt.plot(t1, y3[t1], 'o', markersize=5)
plt.plot(t2, y3[t2], 'o', markersize=5)
plt.plot(t1, y4[t1], 'o', markersize=5)
plt.plot(t2, y4[t2], 'o', markersize=5)

plt.subplot(212)
plt.grid(False)
plt.plot(t, sp.stats.norm(t1, 0.08*t1).pdf(t))
plt.plot(t, sp.stats.norm(t2, 0.08*t2).pdf(t))

plt.show()

정상확률과정과 비정상확률과정 기초개념_9_0