3.0

3.0 | 4 ratings Rate this file 63 Downloads (last 30 days) File Size: 2.31 KB File ID: #25467

Granger Causality Test

by Chandler

 

01 Oct 2009 (Updated 18 Mar 2010)

Conducts a Granger Causality test using the Bayesian Information Criterion to select lag length

| Watch this File

File Information
Description

GRANGER_CAUSE is a Granger Causality Test. 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. 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 to learn more.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
02 Oct 2009 Luna Bella

I like how the author uses the Bayesian Information criterion to select the lag length which is a consistent model selection criterion

20 Feb 2010 William Gruner

This appears to calculate the same x and y lags regardless of the actual lags present between the two vectors. In addition, the F statistic generated by the function only appears valid for specific (small) lags. The test I used involved a simple pair of sinusoids phase-shifted to various degrees with and without a small amount of Gaussian noise.

18 Mar 2010 Chandler

William, there was a small error in the selection of the lag lengths using the BIC. It should be fixed as of 03/18/2010

05 Aug 2011 Wolfgang

Dear Chandler, I have gratefully downloaded your script. How would it be possible to also include a stationarity check into the routine or would you recommend to check stationarity of the series beforehand? Many thanks, Wolfgang

04 Feb 2012 LangS

This function uses Matlab function "regress" which assumes a constant term(intercept) in the linear regression and therefore violates Granger causality definition(See Granger's original paper, Econometrica 37:3 424-438, 1969).

I applied this function on two random numbers series (10 time points, lag = 2) and repeated 1000 times (every time the two series are different), and set the alpha value as 0.05. Among the 1000 tests, 400 were found to have "Granger causality"! So I think the result is not reliable.

Please login to add a comment or rating.
Updates
20 Oct 2009

A correction was made in the calculation of the critical value from the F-distribution

18 Mar 2010

There was an error in selecting the lag length for the BIC. It is now fixed. I would like to thank Mads for pointing out the bug.

18 Mar 2010

There was an error in the calculation of the lengths of the BIC. It is now fixed. I would like to thank Mads for pointing out the bug.

Tag Activity for this File
Tag Applied By Date/Time
statistics Chandler 02 Oct 2009 11:28:50
finance Chandler 02 Oct 2009 11:28:50
granger causality Chandler 02 Oct 2009 11:28:50
granger causality test Chandler 02 Oct 2009 11:28:50
time series analysis Chandler 02 Oct 2009 11:28:50
granger causality Mohammad 20 Oct 2009 16:46:06
time series analysis Mohammad 20 Oct 2009 16:46:16
granger causality michel 26 Oct 2010 15:32:25
granger causality pantaudek 28 Apr 2011 16:07:47
granger causality test Maksym Tokariev 30 Aug 2011 10:03:02

Contact us at files@mathworks.com