Table of Contents


File

turbulence.m

Name

turbulence

Synopsis

turbulence - calculates turbulence per period using mahalanobis distance and characterizes turbulent periods based on desired q-percentile distribution threshold based on Kritzman et al. (2010)

Introduction

NOTE: PART OF A SET OF 2 RELATED FILES:

Kritzman and Li (2010) define financial turbulence as a condition in which asset prices, given their historical patterns of behavior, behave in an uncharacteristic fashion, including extreme price moves, decoupling of correlated assets, and convergence of uncorrelated assets. They quantify turbulence via the Mahalanobis distance (see Merton (1937)), which measures the statistical unusualness of a set of returns given their historical pattern of behavior. Their measure is very general and can be applied across
asset classes for which time-series return data are available.

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

asset_returns
Name:
asset_returns
Description:

Time series returns for different asset classes.

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

TxK matrix

  1. Rows represent dates.
  2. Columns represent returns for each of K securities.

q
Name:
q
Description:

The percentile at which we define the lower bound for turbulence.
In the paper q = 0.75.

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

scalar


Outputs

threshold
Name:
threshold
Description:

The specific value at which we define the lower bound for turbulence.

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

scalar


turbulence_series
Name:
turbulence_series
Description:

Time series of turbulence values per period. Calculated for all periods. The turbulence values are used to sift out the turbulent periods from the non-turbulent periods.

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

Tx1 matrix

  1. Rows represent periods.

turbulent_periods
Name:
turbulent_periods
Description:

Indices specifying a subset of row numbers from turbulence_series that have turbulence values that exceed the threshold and are thus classified as turbulent.

Type:
integer
Range:
{1,...,T}
Dimensions:

Px1 matrix

  1. Rows have no specific meaning as this is a list.

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_days = size(asset_returns,1);
% Find the mean return and covariance of asset returns
mu = mean(asset_returns, 1)';
Sigma = cov(asset_returns);


turbulence_series = zeros(num_days,1);
% Calculate the turbulence for each period
for i=1:num_days
    y = asset_returns(i,:)';
    turbulence_series(i) = (y-mu)'*inv(Sigma)*(y-mu);
end

% Find the threshold that characterizes turbulence
threshold = prctile(turbulence_series,100*q);

% Find the turbulent periods
turbulent_periods = find(turbulence_series > threshold);

Examples

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

 asset_returns = ...
 [ 0.0595, 0.1211,-0.0806; 
  -0.1091, 0.0897,-0.0254; 
   0.0901, 0.0714,-0.0915; 
   0.1086, 0.0033,-0.1173;
   0.0614, 0.0151, 0.0291];

 q = .75;

 [turbulence_series, threshold, turbulent_periods] = ...
 turbulence(asset_returns, q);

References

Kritzman, M., & Li, Y. (2010). Skulls, financial turbulence, and risk management. Financial Analysts Journal, 66(5), 30-41.

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