def plotSequenceForRotatingState3D(degPerStep, Sigma, stationaryDim=0, T=1000):
A = makeA_3DRotationMatrix(degPerStep, stationaryDim)
Sigma = Sigma * np.eye(3)
assert Sigma.shape == (3, 3)
X = np.zeros((T, 3))
X[0, :] = [1, 1, 1]
for t in xrange(1, T):
X[t] = np.random.multivariate_normal(np.dot(A, X[t - 1]), Sigma)
ax = Axes3D(pylab.figure())
pylab.plot(X[:, 0], X[:, 1], X[:, 2], '.')
pylab.axis('equal')
评论列表
文章目录