Granger_Cause_1
GRANGER_CAUSE_1 is a Granger Causality Test that accepts missing data, permits fixed or variable lag models and permits Lag 0 for the Y model as well. It also tries to account for multiple comparisons in the F test
when using variable lag models ( models in which the lag chosen is based on the lowest BIC score).
This code is based on Granger_cause by Chandler.
The null hypothesis is that the y does not Granger Cause x.
A user specifies the two series, x and y, along with
the significance level and the maximum number of lags
to be considered.
The function chooses the optimal lag length for x and y based
on the Bayesian Information Criterion ( if using variable lag lengths).
The function produces the F-statistic for the Granger Causality Test
along with the corresponding critical value.
We reject the null hypothesis that y does not Granger Cause x
if the F-statistic is greater than the critical value.
Type help granger_cause_1 to learn more.
Cite As
robert (2026). Granger_Cause_1 (https://www.mathworks.com/matlabcentral/fileexchange/59390-granger_cause_1), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- AI and Statistics > Statistics and Machine Learning Toolbox >
- Sciences > Neuroscience > Human Brain Mapping > EEG/MEG/ECoG >
Tags
Acknowledgements
Inspired by: Granger Causality Test
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.7.0.0 | added files to run granger cause , showing various ways to create output |
||
| 1.6.0.0 | Notes cleaned up, fixed erroat that required max_x_lags > max_y_lags |
||
| 1.5.0.0 | cleanup of notes, added DEBUG switch , fixed bug that required that max_x_lag > max_y_lag |
||
| 1.0.0.0 | fixed description typos |
