Co Metrics

Co Metrics, sometimes referred to as contribution metrics, provides a suite of co-movement based statistics where the record/transacation-wise linkage between primary and component are maintained for the analysis. This allows for Value at Risk, Tail Value at Risk and Windowed statistics of a primary risk source to be broken down by its contributing components and allows for the linear relation statistics, covariance and correlation, to be computed between any two risk sources.

Distribution Co Metrics API Reference

Refer to metrics for information on how to construct probability windows, how to deal with negative/positive loss values, and to learn about how Graphene handles other special cases.

Methodology

Computing co metrics requires that the chosen component YLT(s) are arranged sorted trial order of the primary YLT. Computing the statistical measures for any given probability window is straightforward once the component is ordered according to the primary distribution.

Take the following 4-trial YLTs for example:

Trial

Sorted Primary YLT

Component YLT (primary order)

3

400

100

1

200

50

2

100

150

4

50

20

A special case occurs when the primary YLT contains non-unique values that span across one or both of the boundaries of the desired window.

In the example below we demonstrate the case where the lower boundary for the in 1 in 2 return period could have two possible results:

Trial

Sorted Primary YLT

Component YLT (primary order)

3

400

100

1

200

50

2

200

150

4

50

20

In the table above, trials 1 and 2 both have a value of 200 in the primary YLT. This leads to a situation where the trial to be included from the component is ambiguous. Only including one trial will cause the component value to change. The metric is unstable as each trial is equally relevant as the 1 in 2 return period value for the primary.

To ensure co metrics are stable and represent the expected value of each statistic, a weighted version of each statistic is computed, such that the weights for non-unique values on boundaries are adjusted to account for the possibility of their inclusion. The methodology is described below more formally.

Weighted Means (computing component statistics)

Assumptions

  • The component YLT is sorted on the primary YLT

  • The selected rows of the Compenent YLT are consecutive in this sort order

  • Accordingly, the subset of the component YLT includes all values that correspond with duplicates in the primary YLT.

Computing Weights

Each entry in the component YLT \(\vec{x}\) is given a weight. The weights are defined as:

\[\begin{split}\begin{eqnarray*} w_i &=& \Pr(x_i)/n \\ \Pr(x_i) &=& m_i/k_i \\ \end{eqnarray*}\end{split}\]
where
  • \(n\) is the number of entries in \(\vec{x}\)

  • \(x_i\) is the ith entry of \(\vec{x}\)

  • \(m_i\) is the number of selected entries in \(\vec{x}\) with primary key equaling that of \(x_i\)

  • \(k_i\) is the total number of entries in \(\vec{x}\) with primary key equaling that of \(x_i\)

(Observe that \(\Pr(x_i)\) is either 0 or 1 for most entries unless entry \(x_i\) straddles a boundary with some matching rows (matching by primary key) selected and some unselected.)

Co-min

\[ \begin{align}\begin{aligned}\begin{split}\text{Selected component YLT values:} \\ \vec{x}\end{split}\\\begin{split}\text{Selected primary YLT values:} \\ \vec{y}\end{split}\\\begin{split}\text{Component weights:} \\ \vec{w}\end{split}\end{aligned}\end{align} \]

The co-min is the weighted mean of all component values which correspond to the minimum value found in the primary.

\[CoMin(\vec{x},\vec{y}; \vec{w}) = \frac{\sum^{n}_{i=1}\{w_ix_i | y_i = \min(\vec{y})\}}{\sum^n_i\{w_i| y_i = \min(\vec{y})\}}\]

Co-max

The co-max is the weighted mean of all components which corresponds to the maximum value found in the primary.

\[CoMax(\vec{x},\vec{y}; \vec{w}) = \frac{\sum^{n}_{i=1}\{w_ix_i | y_i = \max(\vec{y})\}}{\sum^n_i\{w_i| y_i = \max(\vec{y})\}}\]

Co-mean

The co-mean (or CoTVaR) is the weighted mean of the vector including the duplicates.

\[CoMean(\vec{x},\vec{y}; \vec{w}) = \sum^{n}_{i=1}w_ix_i\]

Covariance

The covariance is the weighted covariances of the x and y including duplicates.

\[cov(\textbf{x},\textbf{y}; \textbf{w}) = \frac{\sum^{n}_{i=1}w_i(x_i - \bar{x})(y_i - \bar{y})}{\sum^n_i{w_i}}\]

Correlation

\[\begin{split}cor(\textbf{x},\textbf{y}; \textbf{w}) = \frac{cov(\textbf{x},\textbf{y}; \textbf{w})}{\sigma^w_x\sigma^w_y} \\ where: \begin{align} \\ \sigma^w_x = \sqrt{\frac{\sum^{n}_{i=1}w_i(x_i - \bar{x})^2}{\sum^n_i{w_i}}} \\ \sigma^w_y = \sqrt{\frac{\sum^{n}_{i=1}w_i(y_i - \bar{y})^2}{\sum^n_i{w_i}}} \\ \end{align}\end{split}\]