A question about the time series visulization on TVB-GUI and Python 3

39 views
Skip to first unread message

Yile Wang

unread,
Jun 2, 2020, 2:33:31 AM6/2/20
to TVB Users
Dear TVBer,

When I am using TVB package on Python 3 to plot time series data, I found that the results are not exactly same with the results I generated from the time series visualizer of TVB GUI.. Why this happened? I am using https://nbviewer.jupyter.org/url/docs.thevirtualbrain.org/demos/exploring_longer_time_series.ipynb this demo to simulate my raw_recording on Python 3. How to generate an exactly same time series graph showing on TVB-GUI by using Python 3? I have attached a file which contains the comparison between results generated from Python and TVB-GUI separately named diff.jpg. I used red circles to highlight the different parts between them; Also, I attached my codes and parameters I set on TVB-GUI on this post for reference. Thank you!

Best,

Yile


codes.png
parameters_TVB-GUI.png
diff.jpg

WOODMAN Michael

unread,
Jun 2, 2020, 3:26:47 AM6/2/20
to tvb-...@googlegroups.com

hi Yile,


This could simply be random initial conditions changing the phase relation of the two bursters.  You can look through the demos to see how to see the random seed, which allows you to reproduce the simulation exactly.


cheers,


Marmaduke Woodman, TVB Engineer, INS AMU; +33 7 67 77 84 72


From: tvb-...@googlegroups.com <tvb-...@googlegroups.com> on behalf of Yile Wang <ylww...@gmail.com>
Sent: Tuesday, June 2, 2020 8:33:30 AM
To: TVB Users
Subject: [TVB] A question about the time series visulization on TVB-GUI and Python 3
 
--
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/f44431f7-f3fa-47de-b339-4fdfd2940947%40googlegroups.com.

Yile Wang

unread,
Jun 2, 2020, 2:56:10 PM6/2/20
to TVB Users
Dear Dr. Marmaduke Woodman,

Thanks so much for the reply! Based your suggestion, I read some docs and added lines of codes in my script:

my_rng = np.random.RandomState(seed=42); #define random seed number

heunint = intergrators.HeunStochastic(dt=xxxxx, noise=noise.Additive(nsig=np.array([xxxxx]), ntau=0.0, random_stream=my_rng)) #giving the random seed to intergrators here

sim.initial_conditions = np.zeros((81920, 6, 16, 3)) #giving a specific initial condition. The number 81920: how many data points I generated in 1000 ms simulation; The number 6: variables of interests; The number 16: how many brain regions; The number 3: modes.

However, when I ran my script, I found that I still cannot reproduce the simulation. The graph is worse... Am I using a wrong way to set the number of random seed and initial condition on my simulation? How should I revise my codes here?

Looking forward to your comment and suggestion! Thank you~

Best Regards,

Yile
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-...@googlegroups.com.

WOODMAN Michael

unread,
Jun 25, 2020, 10:48:32 AM6/25/20
to tvb-...@googlegroups.com

hi


I would guess the intial conditions you have provided are a bit too long.  You can start by creating a simulation without specifying the intial conditions and then take a look at the history size.  In general though, I would recommend avoiding it, since a dependence on specific initial conditions for the model with time delays is relatively advanced topic.


cheers,


Marmaduke Woodman, TVB Engineer, INS AMU; +33 7 67 77 84 72

Sent: Tuesday, June 2, 2020 8:56:10 PM
To: TVB Users
Subject: Re: [TVB] A question about the time series visulization on TVB-GUI and Python 3
 
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/9c64b924-0e01-49c1-87fd-ee3b8dc37e11%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages