Table of Contents


File

stress_scenario_selection.m

Name

stress_scenario_selection

Synopsis

stress_scenario_selection - Calculates the worst forecast error of a given country's AR model and uses this as its stress scenario.

Introduction

NOTE: PART OF A SET OF 2 RELATED FILES:

Alfaro and Drehmann (2009) propose a macroeconomic stress test using a simple AR model of GDP growth which is assumed to depend only on its past behavior. The reason the authors focus on GDP is they observe that domestic macroeconomic conditions as measured by GDP growth typically weaken ahead of banking crises. Furthermore, output drops substantially in nearly all of the observed crises once stress emerges. Their approach to stress testing uses this as a starting point to construct GDP scenarios, independently of whether falls in output truly reflect or cause crises. Their guiding principle in creating their GDP shocks is that stress scenarios should be severe yet plausible.

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

gdp_growth_series
Name:
gdp_growth_series
Description:

Tx1 matrix indicates quarterly real GDP growth data (per country in paper).

Type:
float
Range:
(-inf,+inf)
Dimensions:

Tx1 matrix

  1. Rows represent quarters (dates are ascending).

Outputs

forecast_error
Name:
forecast_error
Description:

The most negative forecast error (amount by which predicted_gdp_growth exceeds realized gdp growth).

Type:
float
Range:
(-inf,+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.']);




num_periods = length(gdp_growth_series);
max_order = 2;

% Find the AR model that minimizes the BIC score
[regressor_coefficients order] = fit_ar_model(gdp_growth_series, max_order)

% Find the most negative forecast error of the selected model
forecast_errors = zeros(num_periods-order,1);
for i=order+1:num_periods
    realized_gdp_growth = gdp_growth_series(i);
    predicted_gdp_growth = regressor_coefficients'*[1;gdp_growth_series( ... 
    i-1:-1:i-order)];

    forecast_errors(i-1) = realized_gdp_growth - predicted_gdp_growth; 
end

forecast_error = min(forecast_errors);

Examples

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

 gdp_growth_series = [5.3, 3.4, -1.1, 2.3, 2.3, 4.8, 3.3, 4.5]';

 forecast_error = stress_scenario_selection(gdp_growth_series);

References

Alfaro, R., & Drehmann, M. (2009). Macro stress tests and crises: what can we learn?. BIS Quarterly Review.

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