Table of Contents


File

early_warning_signal.m

Name

early_warning_signal

Synopsis

early_warning_signal - Calculates some metrics of an indicator to be used as an early warning signal of costly asset price booms.

Introduction

Alessi and Detken (2009) use a signaling methodology to predict costly aggregate asset price boom/bust cycles. The performance of a host of real and financial variables as early warning indicators for costly aggregate asset price boom/bust cycles are examined, using data for 18 OECD countries between 1970 and 2007. A signaling approach is used to predict asset price booms that have relatively serious real economy consequences. The authors propose a loss function to rank the tested indicators given policymakers relative preferences with respect to missed crises and false alarms. The paper analyzes the suitability of various indicators as well as the relative performance of financial-versus-real, global-versus-domestic, and money- versus-credit-based-liquidity indicators.

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

indicator
Name:
indicator
Description:

The time series of a selected economic or financial indicator.

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

Tx1 matrix

  1. Rows represent dates.

booms
Name:
booms
Description:

A binary timeseries where 1 denotes a high cost boom/bust cycle. This cycle is defined as a boom followed by a three year period in which overall real GDP growth has been at least three percentage points lower than potential growth. Note: values are yes/no flags, represented as 1/0 values, respectively.

Type:
float
Range:
{0, 1}
Dimensions:

Tx1 matrix

  1. Rows represent dates.

theta
Name:
theta
Description:

Theta is the parameter revealing the policymakers relative risk aversion between Type-I and Type-II errors.

Type:
float
Range:
(0,1)
Dimensions:

scalar


percentile
Name:
percentile
Description:

The indicator distribution percentile that when exceeded, triggers a warning signal for a costly boom.

Type:
float
Range:
(0,1)
Dimensions:

scalar


num_periods
Name:
num_periods
Description:

Indicates the number of periods in advance for which the earning warning signal will be generated, e.g. data from t-6 will predict signal at t.

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

scalar


Outputs

true_pos
Name:
true_pos
Description:

The proportion of true positives of the warning signal.

Type:
integer
Range:
(0,1)
Dimensions:

scalar


true_neg
Name:
true_neg
Description:

The proportion of true negatives of the warning signal.

Type:
integer
Range:
(0,1)
Dimensions:

scalar


usefulness
Name:
usefulness
Description:

The usefulness of the indicator as defined by the extent that indicator produces a loss lower than min(theta, 1-theta] for a given theta.

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

scalar


dp
Name:
dp
Description:

The difference between the true positive probability and the costly boom occurrence probability.

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




n = length(indicator);

% First find the threshold when exceeded the indicator issues a signal
threshold = prctile(indicator,percentile*100);

% The values in the "confusion" matrix
A = 0;
B = 0;
C = 0;
D = 0;

for i=1:n-num_periods
    % If the indicator is greater than the threshold a signal is issued
    signal_issued = indicator(i) > threshold;
    % Find if there is an asset price costly boom in the next num_periods
    has_costly_boom = sum(booms(i+1:i+num_periods)) > 0

    if signal_issued
        if has_costly_boom
            A = A+1;
        else
            B=B+1;
        end
    else
        if has_costly_boom 
            C = C+1;
        else
            D = D+1;
        end
    end
end

true_pos = A/(A+B);
true_neg = D/(C+D);
L = theta *C/(A+C) + (1-theta)* B/(B+D);
usefulness = min(theta, 1-theta) - L;
dp = true_pos - (A+C)/(A+B+C+D);

Examples

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

 indicator = [.15 .50 .7 -.14 .10 .45 .64 .75 .7 .2 ...
              .15 .34 .86 .84 0.39 0.1 0.4 .45 .5 .5]';
 booms = [0 0 0 0 0 0 0 1 0 0 ...
          0 0 1 0 0 0 0 0 0 0]';

 num_periods = 3;
 percentile = .7;
 theta = .2;

 [true_pos true_neg usefulness dp] = early_warning_signal( ...
 indicator, booms, theta, percentile, num_periods);

References

Alessi, L., & Detken, C. (2009). 'Real time' early warning indicators for costly asset price boom/bust cycles: a role for global liquidity.

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