#--------------------------------------------------
Toolbox MSGranger, version 0.502, 24 July 2019
#--------------------------------------------------

#---------- Licence CC BY-NC
This code are freely provided for scientific non-profit use, by Sezen Cekic and Olivier Renaud from the MAD group, University of Geneva, Switzerland.
When using this code in publications please cite Cekic et al. (2019).

#---------- Set path
Add the whole directory in your path

#---------- Description content
MAIN code allows you to 
- Preprocess the data (with the preprocessing.m function)
- Estimate the optimal number of scales and model order (with the model_order_selection.m function)
- Estimate Multiscale Bayesian State Space model (with the MSBSSM.m function)
- Compute the total and scale specific statistic (with the GC_STATS.m function)
- Plot the results (with the plot_GC_STATS.m function)

#---------- Data
Working data are freely provided for scientific non-profit use, by the Functional Brain Mapping Laboratory of the University of Geneva, Switzerland (Plomp et al. (2014)).
Data are recorded from wistar rat with electrodes positioned on the cranium. 
Signals were referenced to an electrode placed above the cerebellum, online filtered 1-500 Hz, and digitized at 2 kHz.

#---------- Animal names and numbers
1. IC070523, electrodes 12,14 and 16 (see Plomp et al. (2014))


#---------- References
Cekic, S., Grandjean, D., & Renaud, O. (2019). Multiscale Bayesian state-space model for Granger causality analysis of brain signal. Journal of Applied Statistics, 46(1), 6684. https://doi.org/10.1080/02664763.2018.1455814
Plomp, G., Quairiaux, C., Michel, C. M., & Astolfi, L. (2014). The physiological plausibility of time-varying Granger-causal modeling: Normalization and weighting by spectral power. NeuroImage, 97, 206216. https://doi.org/10.1016/j.neuroimage.2014.04.016

