.. 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_calculate_dynamic_correlations.py: ============================= Calculate dynamic correlations ============================= In this example, we calculate dynamic correlations .. code-block:: default # Code source: Lucy Owen # License: MIT # load timecorr and other packages import timecorr as tc import numpy as np S = 1 T = 1000 K = 10 B = 5 # define your weights parameters width = 100 laplace = {'name': 'Laplace', 'weights': tc.laplace_weights, 'params': {'scale': width}} # calculate the dynamic correlation of the two datasets subs_data_2 = tc.simulate_data(datagen='ramping', return_corrs=False, set_random_seed=1, S=S, T=T, K=K, B=B) subs_data_1 = tc.simulate_data(datagen='ramping', return_corrs=False, set_random_seed=2, S=S, T=T, K=K, B=B) wcorred_data = tc.wcorr(np.array(subs_data_1), np.array(subs_data_2), weights=laplace['weights'](T)) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_calculate_dynamic_correlations.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: calculate_dynamic_correlations.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: calculate_dynamic_correlations.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_