We generate data from a synthetic $d \times T$-dimensional Gaussian probabilistic model.
In [8]:
In [23]:
d = 400
T = 100
x = zeros((d,T))
y = zeros((d,T))
a = 0.5
tauPsi = 1.
tauRho = 1.
tauPhi = 10.
Q = zeros((2*d,2*d))
# First x
Q[0,0] = tauPsi + tauRho + tauPhi
Q[0,1] = -tauPsi
Q[0,d] = -tauPhi
Q[d,0] = -tauPhi
# Last x
Q[d-1,d-1] = tauPsi + tauRho + tauPhi
Q[d-1,d-2] = -tauPsi
Q[d-1,2*d-1] = -tauPhi
Q[2*d-1,d-1] = -tauPhi
for i in range(d)[1:d-1]:
Q[i,i] = 2*tauPsi + tauRho + tauPhi
Q[i,i-1] = -tauPsi
Q[i,i+1] = -tauPsi
Q[i,i+d] = -tauPhi
Q[i+d,i] = -tauPhi
for i in range(d):
Q[i+d,i+d] = tauPhi
P = inv(Q)
xExtended = random.multivariate_normal(zeros(2*d), P)
x[:,0] = xExtended[:d]
y[:,0] = xExtended[d:]
for t in arange(1,T):
print t
temp = r_[x[:,t-1],zeros(d)]
mu = tauRho*a*dot(P,temp)
xExtended = random.multivariate_normal(mu, P)
x[:,t] = xExtended[:d]
y[:,t] = xExtended[d:]
savetxt('simulatedData/d'+str(d)+'tauPhi'+str(tauPhi)+'y.txt', y)
savetxt('simulatedData/d'+str(d)+'tauPhi'+str(tauPhi)+'P.txt',P)
In [11]:
In [13]:
In [98]:
imshow(abs(x-y))
colorbar()
Out[98]:
In [47]:
In [48]:
In [81]:
In [6]:
test1 = arange(3)
test2 = arange(5,9)
In [7]:
r_[test1,test2]
Out[7]:
In [16]:
test = array([i+1.5 for i in range(10)])
In [14]:
test = zeros(5)
In [17]:
test
Out[17]:
In [ ]: