import numpy as np import matplotlib.pyplot as plt A = np.array([[0.6, -0.8],[ 0.7, 0.6]]) eval, evec = np.linalg.eig(A) print(eval) print(abs(eval)) Sx = np.eye(2)*1600 Sw = np.eye(2) Sx11 = [] for i in range(100): Sx = A@Sx@A.T + Sw Sx11.append(Sx[0,0]) print(Sx) plt.figure(figsize=(8,4), dpi=100) plt.plot(Sx11) plt.show() x = 40*np.random.randn(2) x_hist = [] for t in range(400): x = A.dot(x) + np.random.randn(2) x_hist.append(x) plt.figure(figsize=(8,4), dpi=100) plt.plot(x_hist) plt.show() x_ss = np.array(x_hist).T[:,200:] print(np.cov(x_ss))