hi
I might be reading this wrong, but there's a bug in the tutorial: it does not run new simulations for each value of G, but rather, it changes the G and continues the same simulation. Your code appears to be correct, configuring a new simulator for each.
Perhaps you could introduce this bug in your code and see fi the plot looks similar to the tutorial.
Why would there be a bug in the tutorial? It appears the original script used multiprocessing to run multiple G values, which would fork the process effectively copying the first simulation object and running it from the start. But this is a (very) precarious
approach: better to configure a new simulator for each value of G.
cheers,
Marmaduke
Hello everyone,
I've been grappling with a non-TVB implementation of the Reduced Wong-Wang model in Python, but due to unsatisfactory results, I decided to switch to TVB.
However, my results differ from those in the tutorial. Specifically, I did not observe the expected drop in correlation values as the G parameter exceeds the optimal working point, and the optimal point itself appears to shift towards higher values. I've
rerun the entire process several times, so I doubt the model's stochasticity is the cause.
I would greatly appreciate any insights into potential missteps or misunderstandings on my part.
def compute_fc_matrix (bold_timeseries):
return np.corrcoef(bold_timeseries)
def comparisonFC(fc_matrix, fc_matrix2):
fc_matrix=np.arctanh(fc_matrix)
fc_matrix2=np.arctanh(fc_matrix2)
return np.corrcoef(np.array([fc_matrix[np.triu_indices_from(fc_matrix, k=1)], fc_matrix2[np.triu_indices_from(fc_matrix2, k=1)]]))[0,1]
def simulated_BOLD (G):
conn = Connectivity.from_file('/Users/szymontyras/Downloads/PAT02T1_TVB.zip')
conn.configure()
sim = simulator.Simulator(
model=models.ReducedWongWang(),
connectivity=conn,
coupling=coupling.Linear(),
integrator=integrators.HeunStochastic(dt=1, noise=noise.Additive(nsig=np.array([1e-5]))),
monitors=[monitors.Bold(period=2100)]
).configure()
sim.coupling.a = G
bold_data = []
for (bold_time, bold_signal), in sim(simulation_length=420000):
bold_data.append(bold_signal[:, :, 0])
BOLD = np.array(bold_data)
BOLD = BOLD.squeeze()
BOLD=BOLD.T
return BOLD
Thank you all once again, and I apologize for any inconvenience my query may cause. Best regards,
Szymon Tyras
--
You received this message because you are subscribed to the Google Groups "TVB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
tvb-users+...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tvb-users/ae6564b9-0de1-4616-a0fc-25e0463c7066n%40googlegroups.com.