File
linear_granger_causality.m
Name
linear_granger_causality
Synopsis
linear_granger causality - calculates the significance (p-value) of the Granger causal effect of institution 1 (input_institution_returns) on institution two (output_institution_returns) beyond that of institution two's own historical values, based on Billio et al. (2010).
Introduction
NOTE: PART OF A SET OF 8 RELATED FILES:
To investigate the dynamic propagation of systemic risk, the authors measure the direction of the relationship between institutions using Granger causality. Specifically, the authors analyze the pairwise Granger causalities between the t and t + 1 monthly returns of the 4 indexes; they say that X Granger-causes Y if c1 has a p-value of less than 5%; similarly, they say that Y Granger-causes X if the p-value of b1 is less than 5%. They adjust for autocorrelation and heteroskedasticity in computing the p-value.
The above Granger-causality analysis can be undertaken at the static level, i.e., over a given period, find the causal relationships or at the dynamic level, where the analysis is run at 36-month rolling windows and for each window, the dynamic causality index (DCI) is calculated as:
DCIt = number of causal relationships in window / total possible number of causal relationships.
License
=============================================================================
Copyright 2011, Dimitrios Bisias, Andrew W. Lo, and Stavros Valavanis
COPYRIGHT STATUS: This work was funded in whole or in part by the Office of
Financial Research under U.S. Government contract TOSOFR-11-C-0001, and is,
therefore, subject to the following license: The Government is granted for
itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
worldwide license to reproduce, prepare derivative works,
distribute copies to the public, perform and display the work.
All other rights are reserved by the copyright owner.
THIS SOFTWARE IS PROVIDED "AS IS". YOU ARE USING THIS SOFTWARE AT YOUR OWN RISK. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS, OR THE UNITED STATES GOVERNMENT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================
Inputs
Outputs
Code
% Run warning message
warning('OFRwp0001:UntestedCode', ...
['This version of the source code is very preliminary, ' ...
'and has not been thoroughly tested. Users should not rely on ' ...
'these calculations.']);
num_periods = size(input_institution_returns,1);
% Form the response in the regression equation
y = output_institution_returns(2:num_periods,1);
% Form the regressors
X = [output_institution_returns(1:num_periods-1) input_institution_returns( ...
1:num_periods-1)];
% Truncation lag fraction for the HAC is chosen .1
[betas, V_hat] = hac_regression(y,X,0.1);
p_value_robust = 1 - normcdf(betas(2)/sqrt(V_hat(2,2)/(num_periods-1)));
% a check for the usual estimator
residuals = y - X*betas;
s_squared = residuals'*residuals/(num_periods-3);
C = inv(X'*X);
t_stat = betas(2)/sqrt(s_squared*C(2,2));
p_value = 1-normcdf(t_stat);
Examples
NOTE: Numbers used in the examples are arbitrary valid values.
They do not necessarily represent a realistic or plausible scenario.
input_institution_returns = [ -0.0402,-0.0221, 0.0410, 0.0457, 0.0464]';
output_institution_returns = [ -0.1015,-0.0215, 0.0469,-0.0105, 0.0649]';
[p_value_robust p_value] = linear_granger_causality( ...
input_institution_returns, output_institution_returns)
References