File
systemic_risk_exposures.m
Name
systemic_risk_exposures
Synopsis
systemic_risk_exposures - Performs multiple stress tests to determine which counterparty has the greatest exposures for each of N "important" institutions.
Introduction
In Duffies (2011) proposal, a regulator would collect and analyze information concerning the exposures of N important institutions to M defined stress scenarios. For each stress scenario, an important institution would report its gain or loss, in total, and with respect to its contractual positions with each of the entities for which its exposure, for that scenario, is among the K greatest in magnitude relative to all counterparties. Those counterparties would be identified, stress by stress. The N significant entities would be those identified by the Financial Stability Board.
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.']);
%
% Parameters:
% exposures The exposures of the important institutions under different
% stress tests (gains or losses). An n-p-m matrix. There are m stress
% tests and n important institutions. For each test for each important
% insitution there are exposures to p companies.
num_important_institutions = size(exposures,1);
num_stress_tests = size(exposures,3);
res = zeros(num_important_institutions, k, num_stress_tests);
for test = 1:num_stress_tests
for institution = 1:num_important_institutions
[sorted, index] = sort(exposures(institution,:,test));
res(institution,:,test) = index(1:k);
end
end
Examples
NOTE: Numbers used in the examples are arbitrary valid values.
They do not necessarily represent a realistic or plausible scenario.
exposures(:,:,1) = ...
[ 0205, 5100, 0438;
-0914,-0243, 1051;
0121, 0221, 0401 ];
exposures(:,:,2) = ...
[ 9005, 0420, 4380;
1436, 2430, 5100;
1219, 0022, 0401 ];
k=1;
res = systemic_risk_exposures(exposures,k);
References