Esempio n. 1
0
S[0:3, 6:12] = 2
v, Sr = constructVAR(S, [0.0, 0.8, 0.8], [-0.1, 0.1], [0.0, 0.0])

#v, Sr = constructVAR2(S, [-0.2, 0.2], [0.0, 0.9, 0.9], 0.8)

#S = np.zeros(shape = (5, 10), dtype = np.int32)
#S[1:4, 0:2] = 1
#S[0:3, 6:9] = 2v, Sr = constructVAR(S, [0.0, 0.191, 0.120], [-0.1, 0.1], [0.00, 0.00], [0.01, 0.01])
ts = v.simulate(768)

gf = make_model_geofield(S, ts)
sgf = SurrGeoFieldAR()
sgf.copy_field(gf)
sgf.prepare_surrogates()
sgf.construct_surrogate_with_noise()
ts2 = sgf.surr_data()

plt.figure(figsize=(8, 8))
plt.imshow(S, interpolation='nearest')
plt.title('Structural matrix')

plt.figure()
plt.imshow(v.A, interpolation='nearest')
plt.colorbar()
plt.title('AR structural')

plt.figure()
plt.plot(ts)
plt.title('Simulated time series')

C = np.corrcoef(ts, None, rowvar=0)
Esempio n. 2
0
S[0:3, 6:12] = 2
v, Sr = constructVAR(S, [0.0, 0.8, 0.8], [-0.1, 0.1], [0.0, 0.0])

#v, Sr = constructVAR2(S, [-0.2, 0.2], [0.0, 0.9, 0.9], 0.8)

#S = np.zeros(shape = (5, 10), dtype = np.int32)
#S[1:4, 0:2] = 1
#S[0:3, 6:9] = 2v, Sr = constructVAR(S, [0.0, 0.191, 0.120], [-0.1, 0.1], [0.00, 0.00], [0.01, 0.01])
ts = v.simulate(768)

gf = make_model_geofield(S, ts)
sgf = SurrGeoFieldAR()
sgf.copy_field(gf)
sgf.prepare_surrogates()
sgf.construct_surrogate_with_noise()
ts2 = sgf.surr_data() 

plt.figure(figsize = (8, 8))
plt.imshow(S, interpolation = 'nearest')
plt.title('Structural matrix')

plt.figure()
plt.imshow(v.A, interpolation = 'nearest')
plt.colorbar()
plt.title('AR structural')

plt.figure()
plt.plot(ts)
plt.title('Simulated time series')

C = np.corrcoef(ts, None, rowvar = 0)