.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_simulate_data.py: ============================= Simulate subject data ============================= In this example, we simulate data .. image:: /auto_examples/images/sphx_glr_plot_simulate_data_001.png :class: sphx-glr-single-img .. code-block:: python # Code source: Lucy Owen # License: MIT # load timecorr import timecorr as tc import seaborn as sns import matplotlib.pyplot as plt # simulate some data data, corrs = tc.simulate_data(datagen='block', return_corrs=True, set_random_seed=True, S=1, T=100, K=10, B=5) # calculate correlations - returned squareformed tc_vec_data = tc.timecorr(tc.simulate_data(), weights_function=tc.gaussian_weights, weights_params={'var': 5}, combine=tc.helpers.corrmean_combine) # convert from vector to matrix format tc_mat_data = tc.vec2mat(tc_vec_data) # plot the 3 correlation matrices different timepoints sns.heatmap(tc_mat_data[:, :, 48]) plt.show() plt.clf() sns.heatmap(tc_mat_data[:, :, 50]) plt.show() plt.clf() sns.heatmap(tc_mat_data[:, :, 52]) plt.show() plt.clf() **Total running time of the script:** ( 0 minutes 0.423 seconds) .. _sphx_glr_download_auto_examples_plot_simulate_data.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_simulate_data.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_simulate_data.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_