Table of Contents


File

find_group_node.m

Name

find_group_node

Synopsis

find_group_node - Finds the group where node j belongs to

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.

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

node
Name:
node
Description:

The node whose group (i.e. institution type) we want to find

Type:
integer
Range:
{1,...,+inf}
Dimensions:

scalar


groups
Name:
groups
Description:

A vector with node numbers that serve as delimiters between groups. E.g. group = [2 6] this means that there are 3 groups of nodes: Group 1 (e.g. hedge funds) nodes: 1,2 Group 2 (e.g. banks) nodes: 3,4,5,6 Group 3 (e.g. insurance firms) nodes: 7 until +inf.

Type:
integer
Range:
{1,...,+inf}
Dimensions:

Px1 matrix

  1. K represents the number of separations between groups. Groups = P + 1.

num_nodes
Name:
num_nodes
Description:

The number of nodes.

Type:
integer
Range:
{1,...,+inf}
Dimensions:

scalar


Outputs

begin_group
Name:
begin_group
Description:

The number of the node that begins a new group (i.e. institution type).

Type:
integer
Range:
{1,...,+inf}
Dimensions:

scalar


end_group
Name:
end_group
Description:

The number of the node that ends a new group (i.e. institution type).

Type:
integer
Range:
{1,...,+inf}
Dimensions:

scalar


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.']);




if node > num_nodes
    error('Index cannot exceed the number of nodes');
end

k = length(groups);
if node <=groups(1)
    begin_group = 1;
    end_group = groups(1);
elseif node > groups(k)
    begin_group = groups(k)+1;
    end_group = num_nodes;
else
    for i=1:k-1
        if node > groups(i) && node <= groups(i+1)
            begin_group = groups(i)+1;
            end_group = groups(i+1);
        end
    end

end

Examples

NOTE: Numbers used in the examples are arbitrary valid values.
They do not necessarily represent a realistic or plausible scenario.

 node = 2;
 groups = [2,4,9]; 
 num_nodes = 12;

 [begin_group, end_group] = find_group_node(node, groups, num_nodes);

References

Billio et al. (2010). Econometric measures of systemic risk in the finance and insurance sectors (No. w16223).National Bureau of Economic Research.

Bisias et al. (2012). A survey of systemic risk analytics (Working paper #0001). Washington, DC: Office of Financial Research, 65-69.