Excel Lab
  • Excel Lab
  • Release Notes
  • Getting Started
    • Installing Excel Lab
      • Step 1: Download Files
      • Step 2: Register Libraries
      • Step 3: Activate Add-in
      • Step 4: Verify Installation
  • Functions
    • General
      • ISMATRIXPSD
      • MATRIX
      • XLABHELP
      • XLABINFO
      • XLABLICENSE
      • RESETPASSWORD
    • Return Models
      • CAPM
      • DESMOOTHRETURNS
      • IMPLIEDRETURNS
      • MLERETURNS
    • Risk Models
      • ANNUALIZERISK
      • EWMA
      • HISTORICALRISK
      • MLERISK
      • PORTFOLIORISK
      • TURBULENTRISK
      • QUIETRISK
    • Optimization
      • MVO
      • MTO
      • MVT
      • MVFRONTIER
      • MTFRONTIER
      • ISORETURN
    • Simulation
      • MCNORM
      • BOOTSTRAP
    • Exposure to Loss
      • LOSSPR
      • OMEGARATIO
      • SORTINORATIO
      • TAILRATIO
      • VALUEATRISK
      • MAXDD
    • Regression Analysis
      • FACTORANALYSIS
      • PSR
    • Scenario Analysis
      • MAHALANOBIS
      • SCENARIOPR
      • IMPLIEDSCENARIO
  • Frequently Asked Questions
    • Common Issues
    • FAQ
  • Further Reading
  • Windham's Research Insights
  • Watch Our Educational Videos
Powered by GitBook
On this page
  • Description
  • Syntax
  • Input(s)
  • Output(s)
  • Example
  1. Functions
  2. Scenario Analysis

MAHALANOBIS

Compute the Mahalanobis Distance on your empirical data set.

Description

The Mahalanobis function measures the distances of the cross-sectional point estimates from its empirical distribution. This is a multi-dimensional generalization tool in statistics. It is unitless, scale-invariant, and accounts for the correlation relationships within the data set.

For a given dataset,XXX, the Mahalanobis distance,DDD, is given by

Dt=(Xt−μ)Σ−1(Xt−μ)′D_t=(X_t-\mu) \Sigma^{-1}(X_t-\mu)'Dt​=(Xt​−μ)Σ−1(Xt​−μ)′
Dt=Mahalanobis distance for cross-section tXt=vector of asset returns for period tμ=sample average of historical asset returnsΣ=sample covariance matrix of asset returnsD_t=\text{Mahalanobis distance for cross-section } t\newline X_t=\text{vector of asset returns for period } t\newline \mu=\text{sample average of historical asset returns}\newline \Sigma=\text{sample covariance matrix of asset returns}Dt​=Mahalanobis distance for cross-section tXt​=vector of asset returns for period tμ=sample average of historical asset returnsΣ=sample covariance matrix of asset returns

Syntax

The following describes the function signature for use in Microsoft Excel's formula bar.

=MAHALANOBIS(X, mu, covariance)

Input(s)

Argument
Description

X

Matrix of time series returns (or values).

mu

Optional. Vector of means to measure the distance from. If the argument is not specified, it defaults to the sample average of the X.

covariance

Optional. Covariance matrix, specify a covariance matrix to normalize the distances. If the argument is not specified, it defaults to the sample covariance matrix of X.

Output(s)

Vector of Mahalanobis distance values for the corresponding data, XXX. Vector will have the same length as XXX.

Example

PreviousScenario AnalysisNextSCENARIOPR

Last updated 3 years ago

71KB
TURBULENTRISK.xlsx
Example Workbook