Unless specific geographical region requirements apply, the base URL of Portfolio Optimizer is: https://api.portfoliooptimizer.io/.

The current version number of Portfolio Optimizer is v1.

Portfolio Optimizer can be used:

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $P_{t,i} \in \mathbb{R}^{+,*}$, the price of the asset $i$ at the time $t$, $i=1..n$, $t=1..T$

The arithmetic return $r_{t+1,i}$ of the asset $i$, $i=1..n$, over the period from the time $t$ to the time $t+1$, $t=1..T-1$, is defined as $$r_{t+1,i} = \frac{P_{t+1,i} - P_{t,i}}{P_{t,i}}$$

Let be:

The average arithmetic return $\overline{r}$ of the asset over the $T$ time periods is defined as the the arithmetic average of the arithmetic returns $r_1,...,r_T$, that is $$\overline{r} = \frac{1}{T} \sum_{t=1}^{T} r_t$$

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $r_i = (r_{1,i},...,r_{T,i}) \in \mathbb{R}^{T}$, the arithmetic return of the asset $i$, $i=1..n$ over each time period $t=1..T$
• $\overline{r} = \left ( \overline{r_1}, ..., \overline{r_n} \right ) \in \mathbb{R}^n$, the average arithmetic return of the assets $1..n$ over over the $T$ time periods

The asset covariance matrix $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$ is defined by: $$\Sigma_{i,j} = \frac{1}{T} \sum_{k=1}^T (r_{k,i} - \overline{r_i}) (r_{k,j} - \overline{r_j}), i=1..n, j=1..n$$

Alternatively, let be:

• $n$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset correlation matrix
• $\sigma_1,...,\sigma_n$, the asset standard deviations (i.e., volatilities)
• $\sigma_1^2,...,\sigma_n^2$, the asset variances

The asset covariance matrix $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$ is defined by: $$\Sigma_{i,j} = \sigma_i \sigma_j C_{i,j}, i=1..n, j=1..n$$

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $r_i = (r_{1,i},...,r_{T,i}) \in \mathbb{R}^{T}$, the arithmetic return of the asset $i$, $i=1..n$ over each time period $t=1..T$
• $\overline{r} = \left ( \overline{r_1}, ..., \overline{r_n} \right ) \in \mathbb{R}^n$, the average arithmetic return of the assets $1..n$ over the $T$ time periods
• $\lambda \in ]0,1[$ the decay factor

The exponentially weighted asset covariance matrix $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$ is defined by: $$\Sigma_{i,j} = \frac{1 - \lambda}{1 - \lambda^{T}} \sum_{k=0}^{T-1} \lambda^{k} (r_{T-k,i} - \overline{r_i}) (r_{T-k,j} - \overline{r_j}), i=1..n, j=1..n$$

Notes:

• The decay factor $\lambda$ determines the weights applied to the returns, as well as the effective amount of time periods used in computing the covariance matrix
• The decay factor $\lambda$ can also be defined in terms of the half-life $\tau$, which is the time taken by the weights to decay by $\frac{1}{2}$, through the relationship $$\tau = -\frac{\ln 2}{\ln \lambda} \Leftrightarrow \lambda = \left ( \frac{1}{2} \right )^{\frac{1}{\tau}}$$

Let $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$ be a matrix.

$\Sigma$ is an asset covariance matrix if and only if:

• $\Sigma$ is symmetric, i.e. $\Sigma {}^t = \Sigma$
• $\Sigma$ is positive semi-definite, i.e. $x {}^t \Sigma x \geqslant 0, \forall x \in\mathbb{R}^n$

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $r_i = (r_{1,i},...,r_{T,i}) \in \mathbb{R}^{T}$, the arithmetic return of the asset $i$, $i=1..n$ over each time period $t=1..T$
• $\overline{r} = \left ( \overline{r_1}, ..., \overline{r_n} \right ) \in \mathbb{R}^n$, the average arithmetic return of the assets $1..n$ over the $T$ time periods
• $\sigma_1,...,\sigma_n$, the asset standard deviations (i.e., volatilities)

The asset correlation matrix $C \in \mathcal{M}(\mathbb{R}^{n \times n})$ is defined by: $$C_{i,j} = \frac{1}{T} \sum_{k=1}^T \frac{(r_{k,i} - \overline{r_i}) (r_{k,j} - \overline{r_j})}{\sigma_i \sigma_j}, i=1..n, j=1..n$$

Alternatively, let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $\sigma_1,...,\sigma_n$, the asset standard deviations (i.e., volatilities)

The asset correlation matrix $C \in \mathcal{M}(\mathbb{R}^{n \times n})$ is defined by: $$C_{i,j} = \frac{\Sigma_{i,j}}{\sigma_i \sigma_j}, i=1..n, j=1..n$$

Let $C \in \mathcal{M}(\mathbb{R}^{n \times n})$ be a matrix.

$C$ is an asset correlation matrix if and only if:

• $C$ is symmetric, i.e. $C {}^t = C$
• $C$ is unit diagonal, i.e. $C_{i,i} = 1, i=1..n$
• $C$ is positive semi-definite, i.e. $x {}^t C x \geqslant 0, \forall x \in\mathbb{R}^n$

Let $n$ be the number of assets and $A \in \mathcal{M} \left( \mathbb{R}^{n \times n} \right)$ be an approximate asset correlation matrix (i.e., a matrix with no specific requirements)

Let be:

• $\delta \in [0,1]$
• $S_n^\delta = \{ X \in \mathcal{M} \left( \mathbb{R}^{n \times n} \right)$ such that $X {}^t = X$ and $\lambda_{min}(X) \geq \delta \}$
• $\mathcal{N}$ the optional (so, possibly empty) index set of the fixed off-diagonal elements of the approximate correlation matrix $A$
• $\mathcal{E}_n = \{ X \in \mathcal{M} \left( \mathbb{R}^{n \times n} \right)$ such that $X {}^t = X$ and $x_{ii} = 1, i = 1,...,n$ and $x_{ij}=a_{ij}$ for $(i,j) \in \mathcal{N} \}$

The nearest correlation matrix $C$ to the matrix $A$ is the solution of the problem: $$C = \operatorname{argmin} \left\Vert X - A \right\Vert_F \text{ s.t. } X \in S_n^\delta \cap \mathcal{E}_n$$

Notes:

• The algorithm used internally to solve the optimization problem above is an alternating projection algorithm, similar to the algorithm described in the reference, with $\delta$ taken of order $10^{-4}$ to ensure that the computed correlation matrix $C$ is positive definite.
• If the set $\mathcal{N}$ is not empty, the optimization problem above might not have any solution, which will typically manifest by a response time out of this endpoint.

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $P_{t,i} \in \mathbb{R}^{+,*}$, the price of the asset $i$ at the time $t$, $i=1..n$, $t=1..T$

• $n_p$, the number of portfolios to simulate
• $w_{p} \in [0,1]^{n}$, the vector of the initial portfolio weights of the $p$-th portfolio to simulate, $p=1..n_p$, with $\sum_{i=1}^{n} w_{p,i} = 1$
• $V_{t, p} \in \mathbb{R}^{+,*}$, the value of the $p$-th portfolio to simulate at the time $t$, $p=1..n_p$, $t=1..T$

Then, for $p=1..n_p$ and $t=1..T$ : $$V_{t, p} = V_{1, p} \sum_{i=1}^{n} w_{p,i} \frac{P_{t,i}}{P_{1,i}}$$

Notes:

• By convention, $V_{1, p} = 100, p = 1..n_p$

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $P_{t,i} \in \mathbb{R}^{+,*}$, the price of the asset $i$ at the time $t$, $i=1..n$, $t=1..T$

• $n_p$, the number of portfolios to simulate
• $w_{p} \in [0,1]^{n}$, the vector of the fixed portfolio weights of the $p$-th portfolio to simulate, $p=1..n_p$, with $\sum_{i=1}^{n} w_{p,i} = 1$
• $V_{t, p} \in \mathbb{R}^{+,*}$, the value of the $p$-th portfolio to simulate at the time $t$, $p=1..n_p$, $t=1..T$

Then, for $p=1..n_p$ and $t=2..T$ : $$V_{t, p} = V_{t-1, p} \sum_{i=1}^{n} w_{p,i} \frac{P_{t,i}}{P_{t-1,i}}$$

Notes:

• By convention, $V_{1, p} = 100, p = 1..n_p$

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $P_{t,i} \in \mathbb{R}^{+,*}$, the price of the asset $i$ at the time $t$, $i=1..n$, $t=1..T$

• $n_p$, the number of portfolios to simulate
• $V_{t, p} \in \mathbb{R}^{+,*}$, the value of the $p$-th portfolio to simulate at the time $t$, $p=1..n_p$, $t=1..T$

Then, for $p=1..n_p$ and $t=2..T$: $$V_{t, p} = V_{t-1, p} \sum_{i=1}^{n} w_{t-1,p,i} \frac{P_{t,i}}{P_{t-1,i}}$$

with $w_{t, p} \in [0,1]^{n}$ the vector of the $p$-th portfolio weights at the time $t$, $p=1..n_p$, $t=1..T$, generated at random and satisfying: $$\begin{cases} 0 \leqslant w_{t,p,i} \leqslant 1, i = 1..n \newline \sum_{i=1}^{n} w_{t,p,i} = 1 \end{cases}$$

Notes:

• By convention, $V_{1, p} = 100, p = 1..n_p$

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $n_p$, the number of portfolios
• $w_p \in [0,1]^{n}$, the vector of portfolio weights of the $p$-th portfolio, $p=1..n_p$

The arithmetic return of the $p$-th portfolio, $p=1..n_p$, is defined as: $$\mu {}^t w_p$$

Alternatively, let be:

• $n$, the number of assets
• $n_p$, the number of portfolios
• $T_p$, the number of time periods of the $p$-th portfolio, $p=1..n_p$
• $V_{t, p} \in \mathbb{R}^{+,*}$, the value of the $p$-th portfolio at the time $t$, $p=1..n_p$, $t=1..T_p$

The arithmetic return of the $p$-th portfolio, $p=1..n_p$, is defined as:$$\frac{V_{T_p,p} - V_{1,p}}{V_{1,p}}$$

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $n_p$, the number of portfolios
• $w_p \in [0,1]^{n}$, the vector of portfolio weights of the $p$-th portfolio, $p=1..n_p$

The volatility $\sigma_p$ of the $p$-th portfolio, $p=1..n_p$, is defined as: $$\sigma_p = \sqrt{ w_p {}^t \Sigma w_p}$$

Alternatively, let be:

• $n_p$, the number of portfolios
• $T_p$, the number of time periods of the $p$-th portfolio, $p=1..n_p$
• $r_p = (r_{p,1},...,r_{p,T_p-1}) \in \mathbb{R}^{T_p-1}$, the arithmetic returns of the portfolio $p$ associated to the $T_p$ time periods, $p=1..n_p$

The volatility $\sigma_p$ of the $p$-th portfolio, $p=1..n_p$, is defined as the standard deviation of the arithmetic returns $r_p$: $$\sigma_p = \sqrt{\frac{\sum_{t=1}^{T_p-1} (r_{p,t} - \overline{r_p})^2 }{T_p-1}}$$

With $\overline{r_p}$ the average arithmetic return of the $p$-th portfolio.

Notes:

• In line with the second reference, the volatility is defined through the standard deviation and not through the sample standard deviation.

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $r_f \in \mathbb{R}$, the value of the risk free rate
• $w \in [0,1]^{n}$, the vector of portfolio weights

The Sharpe ratio $SR$ of theportfolio is defined as: $$SR = \frac{ \mu{}^t w - r_f}{\sqrt{ w {}^t \Sigma w }}$$

Alternatively, let be:

• $r_f \in \mathbb{R}$, the value of the risk free rate
• $T$, the number of time periods
• $V_{t} \in \mathbb{R}^{+,*}$, the value of the portfolio at the time $t$, $t=1..T$
• $\overline{r}$, the average arithmetic return of the portfolio
• $\sigma_p$, the volatility of the portfolio

The Sharpe ratio $SR$ of the portfolio is defined as: $$SR = \frac{\overline{r} - r_f}{\sigma_p}$$

Let be:

• $n$, the number of assets
• $\sigma = (\sigma_1,...,\sigma_n)$ the vector of the assets volatilities
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $w \in [0,1]^{n}$, the vector of portfolio weights

The diversification ratio $DR$ of the portfolio is defined as: $$DR = \frac{ \sigma{}^t w}{\sqrt{ w {}^t \Sigma w }}$$

Alternatively, let be:

• $n$, the number of assets
• $T$, the number of time periods
• $P_{t,i} \in \mathbb{R}^{+,*}$, the price of the asset $i$ at the time $t$, $i=1..n$, $t=1..T$
• $V_{t} \in \mathbb{R}^{+,*}$, the value of the portfolio at the time $t$, $t=1..T$

The diversification ratio $DR$ of the portfolio is defined as: $$DR = \overline{DR} \; \rho_{P, \overline{P}}$$

, with

• $\overline{DR}$, the diversification ratio of the long-short most diversified portfolio computed over the universe of the $n$ assets using the covariance matrix of the assets arithmetic returns
• $\overline{P}_{t,i} \in \mathbb{R}^{+,*}$, the value of the long-short most diversified portfolio at the time $t$, $t=1..T$
• $\rho_{P, \overline{P}}$, the correlation between the arithmetic returns of the portfolio and the arithmetic returns of the long-short most diversified portfolio

Notes:

• The second formulation allows to compute the (realized) diversification ratio of a portfolio with unknown composition in terms of asset weights, but in this case, it might happen that the diversification ratio of the portfolio is lower than 1. If so, this either means that the portfolio is not long-only or that the portfolio is invested in other assets than the assets for which prices are provided.
• The second formulation makes the assumption that the portfolio and the long-short most diversified portfolio are constantly rebalanced to maintain their respective assets weights.

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $n_p$, the number of portfolios
• $w_p \in [0,1]^{n}$, the vector of portfolio weights of the $p$-th portfolio, $p=1..n_p$

The return contribution of the $i$-th asset to the return of the $p$-th portfolio, $i=1..n$ and $p=1..n_p$, is defined as: $$w_{p,i} \mu_i$$

• $n_k$, the optional number of groups of assets
• $\mathcal{N}_1,...,\mathcal{N}_{n_k}$ the optional $n_k$ groups of assets

The return contribution of the group of assets $\mathcal{N}_k$ to the return of the $p$-th portfolio, $k=1..n_k$ and $p=1..n_p$, is defined as: $$\sum_{j \in \mathcal{N}_k} w_{p,j} \mu_j$$

Notes:

• Return contribution analysis is also known as absolute return attribution analysis, because there is no reference to a benchmark
• In contribution analysis, a group of assets is also known as a segment, and is usually made of assets sharing common characteristics such as the asset class, the country, the industrial sector, etc.

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $n_p$, the number of portfolios
• $w_p \in [0,1]^{n}$, the vector of portfolio weights of the $p$-th portfolio, $p=1..n_p$

The risk contribution of the $i$-th asset to the risk of the $p$-th portfolio, $i=1..n$ and $p=1..n_p$, is defined as: $$w_{p,i} \frac{(\Sigma w_p)_i}{\sqrt{w_p {}^t \Sigma w_p}}$$

• $n_k$, the optional number of groups of assets
• $\mathcal{N}_1,...,\mathcal{N}_{n_k}$ the optional $n_k$ groups of assets

The risk contribution of the group of assets $\mathcal{N}_k$ to the risk of the $p$-th portfolio, $k=1..n_k$ and $p=1..n_p$, is defined as: $$\sum_{j \in \mathcal{N}_k} w_{p,j} \frac{(\Sigma w_p)_j}{\sqrt{w_p {}^t \Sigma w_p}}$$

Notes:

• The risk is defined in terms of standard deviation of the returns (i.e., volatility)
• In contribution analysis, a group of assets is also known as a segment, and is usually made of assets sharing common characteristics such as the asset class, the country, the industrial sector, etc.

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The continuous mean-variance efficient frontier is the (infinite) set of portfolios whose weights $w \in [0,1]^{n}$ satisfy: $$w = \operatorname{argmin} \frac{1}{2} w {}^t \Sigma w - \lambda \mu {}^t w \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$ with $\lambda$ a parameter varying in $[0, +\infty[$.

• $n_p$, the number of portfolios to compute on the mean-variance efficient frontier

The discretized mean-variance efficient frontier is the (finite) set of $n_p$ portfolios belonging to the continuous mean-variance efficient frontier with equally spaced arithmetic returns.

Notes:

• The parameter $1/\lambda$ is usually called the risk aversion parameter
• When no group weights constraints are present, and if numerically possible, the algorithm used internally to solve the linearly constrained quadratic optimization problem above is the Critical Line Method from Harry_Markowitz

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The continuous mean-variance minimum variance frontier is the (infinite) set of portfolios whose weights $w \in [0,1]^{n}$ satisfy: $$w = \operatorname{argmin} \frac{1}{2} w {}^t \Sigma w - \lambda \mu {}^t w \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$ with $\lambda$ a parameter varying in $]-\infty, +\infty[$.

• $n_p$, the number of portfolios to compute on the mean-variance minimum variance frontier

The discretized mean-variance minimum variance frontier is the (finite) set of $n_p$ portfolios belonging to the continuous mean-variance minimum variance frontier with equally spaced arithmetic returns.

Notes:

• The parameter $1/\lambda$ is usually called the risk aversion parameter
• When no group weights constraints are present, and if numerically possible, the algorithm used internally to solve the linearly constrained quadratic optimization problem above is the Critical Line Method from Harry_Markowitz

Let be:

• $n$, the number of assets
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure

• $n_p$, the number of portfolios to construct

The $p$ vectors of portfolio weights $w_p \in [0,1]^{n}$, $p=1..n_p$, are generated at random and satisfy: $$\begin{cases} l \leqslant w_p \leqslant u \newline w_{min} \leqslant \sum_{i=1}^{n} w_{p,i} \leqslant w_{max} \end{cases}$$

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $X \in \mathcal{R}^{n \times T}$, the matrix of the assets returns
• $r_b \in \mathbb{R}^{T}$, the returns of the benchmark
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The mimicking portfolio weights $w \in [0,1]^{n}$ satisfy: $$w = \operatorname{argmin} \frac{1}{T} \lVert w {}^t X - r_b \rVert_2^2 \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

Notes:

• The performance measure that is being minimized above is called the empirical tracking error
• The statistical technique used to construct the mimicking portfolio is called returns-based style analysis

Let be:

• $n$, the number of assets

The equal-weighted portfolio weights $w \in [0,1]^{n}$ satisfy: $$w_i = \frac{1}{n}, i=1..n$$

Let be:

• $n$, the number of assets
• $\sigma_1^2,...,\sigma_n^2$, the assets variances

The inverse variance-weighted portfolio weights $w \in [0,1]^{n}$ satisfy: $$w_i = \frac{1/\sigma_i^2}{\sum_{j=1}^{n} 1/\sigma_j^2}, i=1..n$$

Let be:

• $n$, the number of assets
• $\sigma_1,...,\sigma_n$, the assets volatilities

The inverse volatility-weighted portfolio weights $w \in [0,1]^{n}$ satisfy: $$w_i = \frac{1/\sigma_i}{\sum_{j=1}^{n} 1/\sigma_j}, i=1..n$$

Notes:

• The inverse volatility-weighted portfolio is also known as the naive-risk parity portfolio

Let be:

• $n$, the number of assets
• $mktcap_1,...,mktcap_n$ the assets market capitalizations

The market capitalization-weighted portfolio weights $w \in [0,1]^{n}$ satisfy: $$w_i = \frac{mktcap_i}{\sum_{j=1}^{n} mktcap_j}, i=1..n$$

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $r_f \in \mathbb{R}$, the value of the risk free rate

The equal Sharpe ratio contributions portfolio weights $w \in [0,1]^{n}$ satisfy:

• $\forall i,j$ such that $\mu_i - r_f > 0$ and $\mu_j - r_f > 0$ $$w_i \frac{\mu_i - r_f}{\sqrt{ w {}^t \Sigma w}} = w_j \frac{\mu_j - r_f}{\sqrt{ w {}^t \Sigma w}}$$
• $\forall i$ such that $\mu_i - r_f \leq 0$ $$w_i = 0$$

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The maximum return portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmax} w {}^t \mu \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

Notes:

• If some assets have identical returns, the maximum return portfolio will usually not be unique
• If some assets have identical returns, the maximum return portfolio will usually not be mean-variance efficient

To enforce mean-variance efficiency, the covariance matrix of the assets $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$ must be provided

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The minimum variance portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmin} w {}^t \Sigma w \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

Notes:

• If the asset covariance matrix is not positive definite, the minimum variance portfolio will usually not be unique
• If the asset covariance matrix is not positive definite, the minimum variance portfolio will usually not be mean-variance efficient

To enforce mean-variance efficiency, the arithmetic returns of the assets $\mu \in \mathbb{R}^{n}$ must be provided

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints

The equal risk contributions portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmin} \sqrt{ w {}^t \Sigma w} - \frac{\lambda}{n} \sum_{i=1}^{n} \ln(w_i) \newline \textrm{s.t. }l \leqslant w \leqslant u$$ with $\lambda \in \mathbb{R}^{+,*}$ a parameter to be determined such that $\sum_{i=1}^{n} w_i = 1$.

Notes:

• Such a $\lambda$ might not exist, in which case the optimization problem is not feasible and the vector $w$ is undefined
• The algorithm used internally to solve the optimization problem above is a cyclical coordinate descent algorithm, similar to the algorithm described in the reference

Let be:

• $n$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset correlation matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The maximum decorrelation portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmax} 1 - w {}^t C w \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $r_f \in \mathbb{R}$, the value of the risk free rate
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The maximum Sharpe ratio portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmax} \frac{w {}^t \mu - r_f }{\sqrt{ w {}^t \Sigma w}} \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

Notes:

• The value of the risk free rate $r_f$ is usually either taken as the interest rate on a riskless asset like cash or as the interest rate on borrowings
• The maximum Sharpe ratio portfolio is mean-variance efficient

Let be:

• $n$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset correlation matrix
• $\sigma_1,...,\sigma_n$, the assets volatilities

The minimum correlation portfolio is a portfolio where the assets are weighted proportionally to their average correlation with each other.

In more details:

• The correlation matrix of the assets $C$ is converted to an adjusted correlation matrix $C'$ that does not have negative values, penalizing high correlation and rewarding low correlation
• The assets that act as portfolio diversifiers are then initially weighted more heavily than the others, using the adjusted correlation matrix $C'$
• The initial weights are then normalized by the assets inverse volatilities $1/\sigma_i, i=1..n$, to ensure that each asset contributes to the same level of portfolio risk

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The most diversified portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmax} \frac{w {}^t \sigma }{\sqrt{ w {}^t \Sigma w}} \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

A mean-variance efficient portfolio is a portfolio whose weights $w^* \in [0,1]^{n}$ satisfy: $$\exists \lambda \in [0, +\infty[, w^* = \operatorname{argmin} \frac{1}{2} w {}^t \Sigma w - \lambda \mu {}^t w \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

The parameter $\lambda$ is usually called the risk tolerance parameter, and is determined by an additional constraint on the portfolio:

• A return constraint $r_c$, in which case $\lambda$, if it exists, is determined such that the portfolio has a return equal to $r_c$
• A volatility constraint $v_c \geq 0$, in which case $\lambda$, if it exists, is determined such that the portfolio has a volatility equal to $v_c$
• A risk tolerance constraint $\lambda_c \geq 0$, in which case $\lambda$ always exist and is equal to $\lambda_c$

Notes:

• The parameter $1/\lambda$ is usually called the risk aversion parameter
• When no group weights constraints are present, and if numerically possible, the algorithm used internally to solve the linearly constrained quadratic optimization problem above is the Critical Line Method from Harry_Markowitz

Let be:

• $n$, the number of assets
• $w_t \in [0,1]^{n}$, the desired portfolio weights, with $\sum_{i=1}^{n} w_{t,i} = 1$
• $TV$, the desired portfolio monetary value
• $P_1,...,P_n$, the prices of the assets $1,...,n$
• $nl_1,...,nl_n$, the number of shares by which to purchase the assets $1,...,n$
• $ml_1,...,ml_n$, the minimum number of shares to purchase for the assets $1,...,n$
• $mv_1,...,mv_n$, the minimum monetary amount to purchase for the assets $1,...,n$

The investable portfolio weights $w \in [0,1]^{n}$ closest to the desired portfolio weights $w_t$ satisfy: $$w = \operatorname{argmin} \frac{1}{2} \lVert w - w_t \rVert_2^2 \newline \textrm{s.t. } \begin{cases} \sum_{i=1}^{n} w_i \leq 1 \newline w_i = \frac{k_i nl_i P_i}{TV}, k_i \in \mathbb{N}, i=1,...,n \newline k_i \neq 0 \implies k_i nl_i \geq ml_i, i=1,...,n \newline k_i \neq 0 \implies k_i nl_i P_i \geq mv_i, i=1,...,n \end{cases}$$

Unfortunately, the above optimization problem is computationally intractable due to the integer constraints, so that it is only possible to compute an approximate solution.

Notes:

• In case the desired portfolio weights $w_t$ do not satisfy $\sum_{i=1}^{n} w_{t,i} = 1$, the optimization problem above is reformulated to try to best accommodate the situation
• In case at least one group of assets is present, the investable portfolio weights $w \in [0,1]^{n}$ satisfy a more complex optimization problem than above, additionally involving:
• An assets groups matrix that identifies the membership of each asset within each assets group
• The desired portfolio groups weights
• The desired portfolio maximum groups weights
• In case at least one group of assets is present and the desired asset weights, assets groups weights and maximum assets groups weights are incompatible, the optimization problem above is reformulated to try to best accommodate the situation

Let be:

• $T$, the number of time periods
• $r_b = (r_{b,1},...,r_{b,T}) \in \mathbb{R}^{T}$, the returns of the benchmark
• $n_p$, the number of portfolios
• $r_p = (r_{p,1},...,r_{p,T}) \in \mathbb{R}^{T}$, the returns of the portfolio $p$, $p=1..n_p$

The tracking error of the $p$-th portfolio, $p=1..n_p$, is defined as the volatility of the difference of the returns of the portfolio and of the returns of the benchmark over the $T$ time periods: $$\sqrt{\frac{\sum_{t=1}^{T} (r_{b,t} - r_{p,t})^2 }{T}}$$

Notes:

• The tracking error is sometimes defined differently, for example as the absolute difference in returns between a portfolio and a benchmark.

The definition above corresponds to the most commonly used definition.

Let be:

• $m$, the number of factors
• $T$, the number of time periods
• $X \in \mathcal{R}^{m \times T}$, the matrix of the factors returns

The returns $R_{res, i} \in \mathcal{R}^{T}$ of the residualized factor $i \in {1..m}$ are defined as: $$R_{res, i} {}^t = X_i - \alpha - \beta {}^t X_{-i}$$ where:

• $X_i$ represents the row $i$ of the matrix $X$
• $X_{-i}$ represents the matrix $X$ after removing the row $i$
• $(\alpha, \beta)$ is the unique solution of minimum euclidean norm of the linear least squares problem $$\operatorname{argmin_{(\alpha \in \mathcal{R}, \beta \in \mathcal{R}^{m})}} \lVert X_i - \alpha - \beta {}^t X_{-i} \rVert_2^2$$

Let be:

• $m$, the number of factors
• $T$, the number of time periods
• $X \in \mathcal{R}^{m \times T}$, the matrix of the factors returns
• $n_p$, the number of portfolios
• $r_p = (r_{p,1},...,r_{p,T}) \in \mathbb{R}^{T}$, the returns of the portfolio $p$, $p=1..n_p$

The exposures $\beta_p \in \mathcal{R}^{m}$ of the $p$-th portfolio to the $m$ factors, $p=1..n_p$, are defined as the unique solution of minimum euclidean norm of the linear least squares problem: $$\operatorname{argmin_{(\alpha_p \in \mathcal{R}, \beta_p \in \mathcal{R}^{m})}} \lVert r_p {}^t - \alpha_p - \beta_p {}^t X \rVert_2^2$$

Notes:

• $\alpha_p$ represents the portion of the portfolio $p$ returns that cannot be attributed to the portfolio exposure to the $m$ factors
• $\beta_{p}$ represents the magnitude of the portfolio $p$ exposure to the $m$ factors

Let be:

• $T$, the number of time periods
• $r_b = (r_{b,1},...,r_{b,T}) \in \mathbb{R}^{T}$, the returns of the benchmark
• $r_f = (r_{f,1},...,r_{f,T})\in \mathbb{R}^{T}$, the risk free returns
• $n_p$, the number of portfolios
• $r_p = (r_{p,1},...,r_{p,T}) \in \mathbb{R}^{T}$, the returns of the portfolio $p$, $p=1..n_p$

The Jensen's alpha $\alpha_p \in \mathbb{R}$ of the $p$-th portfolio, $p=1..n_p$, is defined as the intercept of the regression equation in the Capital Asset Pricing Model: $$r_{p,t} - r_{f,t} = \alpha_p + \beta_p (r_{b,t} - r_{f,t}) + \epsilon_t$$, with $t=1..T$

Notes:

• The Jensen's alpha $\alpha_p$ of the $p$-th portfolio corresponds to the excess return of the $p$-th portfolio adjusted for its systematic risk.

Let be:

• $T$, the number of time periods
• $r_b = (r_{b,1},...,r_{b,T}) \in \mathbb{R}^{T}$, the returns of the benchmark
• $r_f = (r_{f,1},...,r_{f,T})\in \mathbb{R}^{T}$, the risk free returns
• $n_p$, the number of portfolios
• $r_p = (r_{p,1},...,r_{p,T}) \in \mathbb{R}^{T}$, the returns of the portfolio $p$, $p=1..n_p$

The beta $\beta_p \in \mathbb{R}$ of the $p$-th portfolio, $p=1..n_p$, is defined as the slope of the regression equation in the Capital Asset Pricing Model: $$r_{p,t} - r_{f,t} = \alpha_p + \beta_p (r_{b,t} - r_{f,t}) + \epsilon_t$$, with $t=1..T$

Notes:

• The beta $\beta_p$ of the $p$-th portfolio corresponds to the systematic risk of the $p$-th portfolio.

Let be:

• $n$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset correlation matrix
• $C_T \in \mathcal{M}(\mathbb{R}^{n \times n})$ a target correlation matrix
• $\lambda \in [0,1]$ a real number

The correlation matrix $C_S$ defined by $$C_S = (1-\lambda) C_T + \lambda T$$ corresponds to the (linear) shrinkage of the matrix $C$ toward the matrix $C_T$ with parameter $\lambda$.

Notes:

• The matrices $C$ and $C_T$ are not required to be positive semi-definite, as the linear shrinkage operator is defined for any $n$ by $n$ matrix, but in this case, the matrix $C_S$ might not be positive semi-definite.
• The parameter $\lambda$ is usually called the shrinkage factor, or the shrinkage intensity, or the shrinkage constant.
• This endpoint provides 3 predefined target equicorrelation matrices $C_T$:
• The equicorrelation matrix made of 1, representing the maximum correlation matrix $$\begin{bmatrix} 1 & 1 & ... & 1 \\ 1 & 1 & ... & 1 \\ ... & ... & ... & ... \\ 1 & 1 & ... & 1 \end{bmatrix}$$
• The equicorrelation matrix made of 0, representing the minimum non-negative correlation matrix $$\begin{bmatrix} 1 & 0 & ... & 0 \\ 0 & 1 & ... & 0 \\ ... & ... & ... & ... \\ 0 & 0 & ... & 1 \end{bmatrix}$$
• The equicorrelation matrix made of $-\frac{1}{n-1}$, representing the minimum negative correlation matrix $$\begin{bmatrix} 1 & -\frac{1}{n-1} & ... & -\frac{1}{n-1} \\ -\frac{1}{n-1} & 1 & ... & -\frac{1}{n-1} \\ ... & ... & ... & ... \\ -\frac{1}{n-1} & -\frac{1}{n-1} & ... & 1 \end{bmatrix}$$

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure

The hierarchical risk parity portfolio is a portfolio blending graph theory and machine learning techniques where similar assets are first grouped together thanks to a hierarchical clustering algorithm and asset weights are then computed through a recursive top-down bisection of the resulting hierarchical tree.

Notes:

• The matrix $\Sigma$ is not required to be invertible, that is, positive definite.
• There are 4 possible choices for the hierarchical clustering algorithm, influencing the way the assets are grouped together:
• There are 2 possible choices for the order to impose on the hierarchical clustering tree leaves, also influencing the way the assets are grouped together:
• The management of minimum and maximum asset weights constraints is a proprietary adaptation of the method described in the second reference. The general idea is that constraints are enforced at the lowest possible level of the hierarchical tree.

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure

The hierarchical clustering-based risk parity portfolio is a portfolio building on the hierarchical risk parity portfolio, where similar assets are first grouped together thanks to an early stopped hierarchical clustering algorithm and asset weights are then computed through a recursive top-down division into two parts of the resulting hierarchical tree.

Notes:

• The matrix $\Sigma$ is not required to be invertible, that is, positive definite.
• Early stopping the hierarchical clustering algorithm produces a hierarchical tree cut at a certain height, with assets partitioned into clusters. The number of such clusters can either be provided or can be automatically computed thanks to the gap statistic method using as the null reference distribution the uniform distribution over the set of positive definite correlation matrices.
• There are 4 possible choices for the hierarchical clustering algorithm, influencing the way the assets are grouped together:
• There are 2 possible choices for the order to impose on the hierarchical clustering tree leaves, also influencing the way the assets are grouped together:
• There are 3 possible choices for the within cluster allocation method and for the across cluster allocation method:
• Equal weighting (default)
• Inverse volatility
• Inverse variance
Using Equal weighting for both cluster allocation methods corresponds to the Hierarchical Clustering-Based Asset Allocation (HCAA) of Thomas Raffinot.
• The management of minimum and maximum asset weights constraints is a proprietary adaptation of the method described in the fourth reference. The general idea is that constraints are enforced at the lowest possible level of the hierarchical tree.

Let be:

• $n$, the number of assets

A random correlation matrix is a matrix $C \in \mathcal{M}(\mathbb{R}^{n \times n})$ generated uniformly at random over the space of positive definite correlation matrices, which is defined as $$\mathcal{E}_n = \{ C \in \mathcal{M}(\mathbb{R}^{n \times n}) : C {}^t = C, C_{i,i} = 1, i=1..n, x {}^t C x > 0, \forall x \in\mathbb{R}^n \}$$

Notes:

• This endpoint uses a computationally more efficient algorithm than the one described in the reference.

Let be:

• $n \ge 2$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $\lambda_1 \ge \lambda_2 \ge ... \ge \lambda_n \ge 0$ the eigenvalues of the matrix $\Sigma$
• $\rho_1 \ge \rho_2 \ge ... \ge \rho_n \ge 0$ the standardized eigenvalues of the matrix $\Sigma$ defined by $\rho_i = \frac{\lambda_i}{\sum_{i=1}^{n} \lambda_i}$, $i=1..n$

The effective rank of the matrix $\Sigma$ is defined as $$\textrm{erank}(\Sigma) = e^{- \sum_{i=1}^{n} \rho_i \ln(\rho_i)}$$

Notes:

• In case of a null standardized eigenvalue, the convention taken is $0 ln(0) = 0$.

Let be:

• $n \ge 2$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset correlation matrix
• $\lambda_1 \ge \lambda_2 \ge ... \ge \lambda_n \ge 0$ the eigenvalues of the matrix $C$
• $\rho_1 \ge \rho_2 \ge ... \ge \rho_n \ge 0$ the standardized eigenvalues of the matrix $C$ defined by $\rho_i = \frac{\lambda_i}{\sum_{i=1}^{n} \lambda_i}$, $i=1..n$

The effective rank of the matrix $C$ is defined as $$\textrm{erank}(C) = e^{- \sum_{i=1}^{n} \rho_i \ln(\rho_i)}$$

Notes:

• In case of a null standardized eigenvalue, the convention taken is $0 ln(0) = 0$.

Let be:

• $n_p$, the number of portfolios
• $T_p$, the number of time periods of the $p$-th portfolio, $p=1..n_p$
• $r_p = (r_{p,1},...,r_{p,T_p-1}) \in \mathbb{R}^{T_p-1}$, the arithmetic returns of the portfolio $p$ associated to the $T_p$ time periods, $p=1..n_p$

The average arithmetic return $\overline{r_p}$ of the $p$-th portfolio, $p=1..n_p$, is defined as the arithmetic average of the arithmetic returns $r_p$: $$\overline{r_p} = \frac{\sum_{t=1}^{T_p-1} r_{p,t}}{T_p-1}$$

Let be:

• $n_p$, the number of portfolios
• $T_p$, the number of time periods of the $p$-th portfolio, $p=1..n_p$
• $V_{t, p} \in \mathbb{R}^{+,*}$, the value of the $p$-th portfolio at the time $t$, $p=1..n_p$, $t=1..T_p$

The Ulcer Index $UI_p$ of the $p$-th portfolio, $p=1..n_p$, is defined as: $$UI_p = \sqrt{\frac{\sum_{t=1}^{T_p} \left(100 * \left(\frac{V_{t, p}}{\max_{t'=1..t} V_{t', p}} - 1\right)\right)^2 }{T_p}}$$

Let be:

• $n_p$, the number of portfolios
• $T_p$, the number of time periods of the $p$-th portfolio, $p=1..n_p$
• $V_{t, p} \in \mathbb{R}^{+,*}$, the value of the $p$-th portfolio at the time $t$, $p=1..n_p$, $t=1..T_p$
• $r_f \in \mathbb{R}$, the value of the risk free rate
• $\overline{r_p}$, the average arithmetic return of the $p$-th portfolio, $p=1..n_p$
• $UI_p$, the Ulcer Index of the $p$-th portfolio, $p=1..n_p$

The Ulcer Performance Index $UPI_p$ of the $p$-th portfolio, $p=1..n_p$, is defined as: $$UPI_p = \frac {\overline{r_p} - r_f}{UI_p}$$

Notes:

• The Ulcer Performance Index is also called the Martin Index, the Martin Ratio or the Return-to-Ulcer Ratio

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $P_{t,i} \in \mathbb{R}^{+,*}$, the price of the asset $i$ at the time $t$, $i=1..n$, $t=0..T$
• $r_i = (r_{1,i},...,r_{T,i}) \in \mathbb{R}^{T}$, the arithmetic return of the asset $i$, $i=1..n$ over each time period $t=1..T$
• $\overline{r} = \left ( \overline{r_1}, ..., \overline{r_n} \right ) \in \mathbb{R}^n$, the average arithmetic return of the assets $1..n$ over the $T$ time periods
• $y_t = \left ( y_{t,1}, ..., y_{t,n} \right ) \in \mathbb{R}^n$ the vector of the $n$ assets uncompounded cumulative return up to the time period $t$, defined by $y_{t,i} = \sum_{k=1}^{t} r_{k,i}$, $i=1..n$, $t=1..T$
• $r_f \in \mathbb{R}$, the value of the risk free rate
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The maximum Ulcer Performance Index portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmax} \frac{w {}^t \overline{r} - r_f }{UI(w)} \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

With $UI(w)$ the Ulcer Index of the portfolio with returns $\langle w , y_t \rangle$, $t=1..T$, that is:

$$\text{UI}(w) =\sqrt{\frac{1}{T}\sum_{k=1}^{T} \left ( \max_{j = 1..k} \left ( \langle w , y_j \rangle \right ) - \langle w , y_k \rangle \right ) ^2}$$

Notes:

• The value of the risk free rate $r_f$ is usually either taken as the interest rate on a riskless asset like cash or as the interest rate on borrowings
• The Ulcer Performance Index is also called the Martin Index, the Martin Ratio or the Return-to-Ulcer Ratio

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $P_{t,i} \in \mathbb{R}^{+,*}$, the price of the asset $i$ at the time $t$, $i=1..n$, $t=0..T$
• $r_i = (r_{1,i},...,r_{T,i}) \in \mathbb{R}^{T}$, the arithmetic return of the asset $i$, $i=1..n$ over each time period $t=1..T$
• $\overline{r} = \left ( \overline{r_1}, ..., \overline{r_n} \right ) \in \mathbb{R}^n$, the average arithmetic return of the assets $1..n$ over the $T$ time periods
• $y_t = \left ( y_{t,1}, ..., y_{t,n} \right ) \in \mathbb{R}^n$ the vector of the $n$ assets uncompounded cumulative return up to the time period $t$, defined by $y_{t,i} = \sum_{k=1}^{t} r_{k,i}$, $i=1..n$, $t=1..T$
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The minimum Ulcer Index portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmin} UI(w) \newline \textrm{s.t. } \begin{cases} l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

With $UI(w)$ the Ulcer Index of the portfolio with returns $\langle w , y_t \rangle$, $t=1..T$, that is:

$$\text{UI}(w) =\sqrt{\frac{1}{T}\sum_{k=1}^{T} \left ( \max_{j = 1..k} \left ( \langle w , y_j \rangle \right ) - \langle w , y_k \rangle \right ) ^2}$$

Let be:

• $n_p$, the number of portfolios
• $T_p$, the number of time periods of the $p$-th portfolio, $p=1..n_p$
• $V_{t, p} \in \mathbb{R}^{+,*}$, the value of the $p$-th portfolio at the time $t$, $p=1..n_p$, $t=1..T_p$
• $r_p = (r_{p,1},...,r_{p,T_p-1}) \in \mathbb{R}^{T_p-1}$, the arithmetic returns of the portfolio $p$ associated to the $T_p$ time periods, $p=1..n_p$
• $l_p = -r_p \in \mathbb{R}^{T_p-1}$, the $p$-th portfolio losses, $p=1..n_p$
• $\alpha \in ]0,1[$, the confidence level

The conditional value at risk at a confidence level $\alpha$, $CVaR_{\alpha}$, of the $p$-th portfolio, $p=1..n_p$, is the average of the distribution of the $p$-th portfolio losses $l_p$ over all the losses larger than the value at risk with confidence level $\alpha$.

Notes:

• The conditional value at risk is also known as the expected shortfall or the expected tail loss.
• The conditional value at risk at a confidence level $\alpha$ answers to the following question: What is the expected loss incurred in the $\alpha$% worst cases of the portfolio?
• Typical values for $\alpha$ are 0.01 (= 1%) or 0.05 (= 5%).
• In the literature, the confidence level is also sometimes defined as $1 - \alpha$, in which case typical values for $1 - \alpha$ are 0.95 (= 95%) or 0.99 (= 99%).

Let be:

• $n_p$, the number of portfolios
• $T_p$, the number of time periods of the $p$-th portfolio, $p=1..n_p$
• $V_{t, p} \in \mathbb{R}^{+,*}$, the value of the $p$-th portfolio at the time $t$, $p=1..n_p$, $t=1..T_p$
• $r_p = (r_{p,1},...,r_{p,T_p-1}) \in \mathbb{R}^{T_p-1}$, the arithmetic returns of the portfolio $p$ associated to the $T_p$ time periods, $p=1..n_p$
• $l_p = -r_p \in \mathbb{R}^{T_p-1}$, the $p$-th portfolio losses, $p=1..n_p$
• $\alpha \in ]0,1[$, the confidence level

The value at risk at a confidence level $\alpha$, $VaR_{\alpha}$, of the $p$-th portfolio, $p=1..n_p$, is the $\alpha$-quantile of the distribution of the $p$-th portfolio losses $l_p$.

Notes:

• The value at risk at a confidence level $\alpha$ is equivalently defined as the maximum portfolio loss that will not be exceeded with probability $1-\alpha$.
• The value at risk at a confidence level $\alpha$ answers to the following question: What is the minimum loss incurred in the $\alpha$% worst cases of the portfolio?
• Typical values for $\alpha$ are 0.01 (= 1%) or 0.05 (= 5%).
• In the literature, the confidence level is sometimes defined as $1 - \alpha$, in which case typical values for $1 - \alpha$ are 0.95 (= 95%) or 0.99 (= 99%).

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The diversified maximum return portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmin} \sum_{i=1}^{n} w_i^2 \newline \textrm{s.t. } \begin{cases} \sqrt{ w {}^t \Sigma w} \leqslant \sigma^* (1 + \delta_{\sigma}) \newline \mu^* (1 - \delta_{\mu}) \leqslant w {}^t \mu \newline l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

where:

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $r_f \in \mathbb{R}$, the value of the risk free rate
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The diversified maximum Sharpe ratio portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmin} \sum_{i=1}^{n} w_i^2 \newline \textrm{s.t. } \begin{cases} \sqrt{ w {}^t \Sigma w} \leqslant \sigma^* (1 + \delta_{\sigma}) \newline \mu^* (1 - \delta_{\mu}) \leqslant w {}^t \mu \newline l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

where:

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The diversified minimum variance portfolio weights $w^* \in [0,1]^{n}$ satisfy: $$w^* = \operatorname{argmin} \sum_{i=1}^{n} w_i^2 \newline \textrm{s.t. } \begin{cases} \sqrt{ w {}^t \Sigma w} \leqslant \sigma^* (1 + \delta_{\sigma}) \newline \mu^* (1 - \delta_{\mu}) \leqslant w {}^t \mu \newline l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

where:

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The weights $w^* \in [0,1]^{n}$ of a diversified mean-variance efficient portfolio satisfy:

$$w^* = \operatorname{argmin} \sum_{i=1}^{n} w_i^2 \newline \textrm{s.t. } \begin{cases} \sqrt{ w {}^t \Sigma w} \leqslant \sigma^* (1 + \delta_{\sigma}) \newline \mu^* (1 - \delta_{\mu}) \leqslant w {}^t \mu \newline l \leqslant w \leqslant u \newline Gw \leqslant u_g \newline w_{min} \leqslant \sum_{i=1}^{n} w_i \leqslant w_{max} \end{cases}$$

where:

Let be:

• $n$, the number of assets
• $\mu_{T'} \in \mathbb{R}^{n}$, the vector of the average asset returns over a historical reference period $T'$
• $\Sigma_{T'} \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix over a historical reference period $T'$
• $r_T \in \mathbb{R}^{n}$, the vector of the asset returns over a period $T \ne T'$

The turbulence index $d_T$ of the assets over the period $T$ is defined as:

$$d_T = \frac{1}{n} (r_T - \mu_{T'}) {}^t \Sigma{_{T'}}^{-1} (r_T - \mu_{T'})$$

Notes:

• The turbulence index $d_T$ represents a statistical measure of financial turbulence based on the Mahalanobis distance, c.f. the first reference.
• The turbulence index $d_T$ is normalized by the number of assets $n$ so that its expected value is equal to 1, c.f. the second reference.
• The asset covariance matrix $\Sigma_{T'}$ is supposed to be invertible, that is, positive definite.

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $E_1,...,E_n$, the eigenvectors of $\Sigma$ ordered such that $\sigma_{E_1}^2 \geq ... \geq \sigma_{E_n}^2$, with $\sigma_{E_i}^2$ the variance of the eigenvector $E_i$, $i=1..n$
• $1\leq N \leq n$, the number of eigenvectors $E_1,...,E_N$ to retain in the computation of the absorption ratio

The absorption ratio $AR$ of the assets is defined as:

$$AR = \frac{\sum_{i=1}^N \sigma_{E_i}^2}{\sum_{i=1}^n \sigma_{E_i}^2}$$

Notes:

• The absorption ratio $AR$ is an indicator of financial risk, representing the fraction of the total variance of the assets explained (or absorbed, hence its name) by a finite set of eigenvectors, c.f. the first reference.
• The denominator of the absorption ratio $AR$ is also equal to $\sum_{i=1}^n \sigma_{A_i}^2$, with $\sigma_{A_i}^2$ the variance of the $i$-th asset, $i=1..n$, which is its usual definition.

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The subset resampling-based maximum return portfolio weights $w^* \in [0,1]^{n}$ are computed through the following procedure:

1. Determine the number of assets $n_S$ to include in each subset, with $2 \le n_S \le n$
2. Determine the number of subsets to generate $n_B$, with $1 \le n_B$
3. For $b = 1..n_B$ do
1. Generate uniformly at random without replacement a subset of $n_S$ assets from the original set of $n$ assets
2. Compute the weights $w_b^*$ of the maximum return portfolio associated to the generated subset of $n_S$ assets, taking into account the applicable constraints
4. Aggregate the $n_B$ portfolio weights $w_1^*,..,w_{n_B}^*$ by averaging them through the formula:
5. $$w^* = \frac{1}{n_B} \sum_{b=1}^{n_B} w_b^*$$

Notes:

• The subset resampling method as described above is actually the random subspace method, an ensemble learning technique, applied to mean-variance portfolio optimization.
• It is possible to generate all the subsets of the original set of $n$ assets containing $n_B$ assets; in this case, the subset generation procedure becomes non-random.
• In case too many subset optimization problems are infeasible, typically due to weight constraints, an error is returned by this endpoint; a threshold of 5% is enforced.
• It is possible to aggregate the $n_B$ portfolio $w_1^*,..,w_{n_B}^*$ by using a robust location estimator - the geometric median - instead of the average; this procedure is described in Peter Bühlmann, Bagging, Subagging and Bragging for Improving some Prediction Algorithms.

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $r_f \in \mathbb{R}$, the value of the risk free rate
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The subset resampling-based maximum Sharpe ratio portfolio weights $w^* \in [0,1]^{n}$ are computed through the following procedure:

1. Determine the number of assets $n_S$ to include in each subset, with $2 \le n_S \le n$
2. Determine the number of subsets to generate $n_B$, with $1 \le n_B$
3. For $b = 1..n_B$ do
1. Generate uniformly at random without replacement a subset of $n_S$ assets from the original set of $n$ assets
2. Compute the weights $w_b^*$ of the maximum Sharpe ratio portfolio associated to the generated subset of $n_S$ assets, taking into account the applicable constraints
4. Aggregate the $n_B$ portfolio weights $w_1^*,..,w_{n_B}^*$ by averaging them through the formula:
5. $$w^* = \frac{1}{n_B} \sum_{b=1}^{n_B} w_b^*$$

Notes:

• The subset resampling method as described above is actually the random subspace method, an ensemble learning technique, applied to mean-variance portfolio optimization.
• It is possible to generate all the subsets of the original set of $n$ assets containing $n_B$ assets; in this case, the subset generation procedure becomes non-random.
• In case too many subset optimization problems are infeasible, typically due to weight constraints, an error is returned by this endpoint; a threshold of 5% is enforced.
• It is possible to aggregate the $n_B$ portfolio $w_1^*,..,w_{n_B}^*$ by using a robust location estimator - the geometric median - instead of the average; this procedure is described in Peter Bühlmann, Bagging, Subagging and Bragging for Improving some Prediction Algorithms.

Let be:

• $n$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The subset resampling-based minimum variance portfolio weights $w^* \in [0,1]^{n}$ are computed through the following procedure:

1. Determine the number of assets $n_S$ to include in each subset, with $2 \le n_S \le n$
2. Determine the number of subsets to generate $n_B$, with $1 \le n_B$
3. For $b = 1..n_B$ do
1. Generate uniformly at random without replacement a subset of $n_S$ assets from the original set of $n$ assets
2. Compute the weights $w_b^*$ of the minimum variance portfolio associated to the generated subset of $n_S$ assets, taking into account the applicable constraints
4. Aggregate the $n_B$ portfolio weights $w_1^*,..,w_{n_B}^*$ by averaging them through the formula:
5. $$w^* = \frac{1}{n_B} \sum_{b=1}^{n_B} w_b^*$$

Notes:

• The subset resampling method as described above is actually the random subspace method, an ensemble learning technique, applied to mean-variance portfolio optimization.
• It is possible to generate all the subsets of the original set of $n$ assets containing $n_B$ assets; in this case, the subset generation procedure becomes non-random.
• In case too many subset optimization problems are infeasible, typically due to weight constraints, an error is returned by this endpoint; a threshold of 5% is enforced.
• It is possible to aggregate the $n_B$ portfolio $w_1^*,..,w_{n_B}^*$ by using a robust location estimator - the geometric median - instead of the average; this procedure is described in Peter Bühlmann, Bagging, Subagging and Bragging for Improving some Prediction Algorithms.

Let be:

• $n$, the number of assets
• $\mu \in \mathbb{R}^{n}$, the vector of the asset arithmetic returns
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• A return constraint $r_c$, a volatility constraint $v_c \geq 0$ or a risk tolerance constraint $\lambda_c \geq 0$
• $l \in [0,1]^{n}$, the optional minimum asset weights constraints
• $u \in [0,1]^{n}$, the optional maximum asset weights constraints
• $w_{min} \in [0,1]$, the optional minimum portfolio exposure
• $w_{max} \in [0,1]$, the optional maximal portfolio exposure
• $k$, the optional number of groups of assets
• $G \in \mathcal{M}(\mathbb{R}^{k \times n})$, the optional assets groups matrix defining $k$ group(s) of assets
• $u_g \in \mathbb{R}^{k}$, the optional maximum assets groups weights constraints

The weights $w^* \in [0,1]^{n}$ of a subset resampling-based mean-variance efficient portfolio are computed through the following procedure:

1. Determine the number of assets $n_S$ to include in each random subset of assets, with $2 \le n_S \le n$
2. Determine the number of random subsets of assets $n_B$ to generate, with $1 \le n_B$
3. For $b = 1..n_B$ do
1. Generate uniformly at random without replacement a subset of $n_S$ assets from the original set of $n$ assets
2. Compute the weights $w_b^*$ of a mean-variance efficient portfolio associated to the generated subset of $n_S$ assets, taking into account the applicable constraints
4. Combine the $n_B$ portfolio weights $w_1^*,..,w_{n_B}^*$ by averaging them through the formula:
5. $$w^* = \frac{1}{n_B} \sum_{b=1}^{n_B} w_b^*$$

Notes:

• The subset resampling method as described above is actually the random subspace method, an ensemble learning technique, applied to mean-variance portfolio optimization.
• It is possible to generate all the subsets of the original set of $n$ assets containing $n_B$ assets; in this case, the subset generation procedure becomes non-random.
• In case too many subset optimization problems are infeasible, typically due to return, volatility or weight constraints, an error is returned by this endpoint; a threshold of 5% is enforced.
• It is possible to combine the $n_B$ portfolio $w_1^*,..,w_{n_B}^*$ by using a robust location estimator - the geometric median - instead of the average; this procedure is described in Peter Bühlmann, Bagging, Subagging and Bragging for Improving some Prediction Algorithms.

Let be:

• $n$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset correlation matrix
• $\mathcal{B}$ the index set of a selected group of assets whose correlations are desired to be altered

The lower bounds $L \in \mathcal{M}(\mathbb{R}^{n \times n})$ and the upper bounds $U \in \mathcal{M}(\mathbb{R}^{n \times n})$ of the asset correlation matrix $C$ associated to the selected group of assets are correlation matrices containing respectively the lowest and the highest possible values among which the correlations of the selected group of assets can linearly vary together while keeping the correlations between all the other assets fixed and while ensuring that the resulting correlation matrix is a valid correlation matrix.

Notes:

• It is usually desired to alter the correlations for a selected group of assets in order to perform stress tests.

Let be:

• $n \ge 2$, the number of assets
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $\mathring{l} \in \mathcal{M}(\mathbb{R}^{n \times n})$, a matrix representing an invertible linear transformation such that $\mathring{l} \Sigma \mathring{l} {}^t$ is a diagonal matrix
• $n_p$, the number of portfolios
• $w_p \in \mathbb{R}^{n}$, the vector of portfolio weights of the $p$-th portfolio, $p=1..n_p$

The effective number of bets of the $p$-th portfolio, $p=1..n_p$, is defined as $$\mathcal{N}_{Ent,p} = e^{- \sum_{i=1}^{n} {d_p}_i \ln({d_p}_i)}$$, where $d_p \in [0,1]^{n}$ is the diversification distribution of the $p$-th portfolio defined as $$d_p = \frac{ \left( \left( \mathring{l} {}^t \right)^{-1} w_p \right) \circ \left( \mathring{l} \Sigma w_p \right) }{w_p {}^t \Sigma w_p}$$

Notes:

• The matrix $\mathring{l}$ it called a decorrelating torsion matrix.
• There are 2 possible choices for the computation of the matrix $\mathring{l}$:
• The minimum torsion transformation described in the reference, leading to the effective number of minimum torsion bets (default)
• The matrix of the principal components of the matrix $\Sigma$, leading to the effective number of principal components bets

Let be:

• $n$, the number of assets
• $\mathcal{H}_1,...,\mathcal{H}_{n}$, a theoretical hierarchical classification of the assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, an empirical asset correlation matrix

The theory-implied correlation matrix associated with a theoretical hierarchical classification of a universe of assets - like the MSCI Global Industry Classification Standard for stocks - and an empirical asset correlation matrix is computed thanks to a machine learning technique. Similar assets are first grouped together thanks to a hierarchical clustering algorithm constrained to match the hierarchical classification of the assets and theory-implied asset correlations are then derived from the resulting hierarchical tree.

Notes:

• The empirical asset correlation matrix $C$ does not need to be positive semi-definite.
• There are 4 possible choices for the hierarchical clustering algorithm, influencing the way the assets are grouped together:
• The computed theory-implied asset correlation matrix is not guaranteed to be positive semi-definite.

Let be:

• $n$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset correlation matrix
• $C_R \in \mathcal{M}(\mathbb{R}^{n \times n})$, a reference correlation matrix

The Euclidean distance $\mathcal{d}_F$ between the matrices $C$ and $C_R$ is defined as: $$\mathcal{d}_F \left( C, C_R \right) = \left\Vert C - C_R \right\Vert_F$$

The correlation matrix distance $\mathcal{d}_{corr}$ between the matrices $C$ and $C_R$ is defined as: $$\mathcal{d}_{corr}\left( C, C_R \right) = 1 - \frac{< C, C_R>}{\left\Vert C \right\Vert_F \left\Vert C_R \right\Vert_F }$$

The Bures distance $\mathcal{d}_{Bures}$ between the matrices $C$ and $C_R$ is defined as: $$\mathcal{d}_{Bures}^2\left( C, C_R \right) = \mathrm{tr} \left( C \right) + \mathrm{tr} \left( C_R \right) -2 \mathrm{tr} \left( C^{\frac{1}{2}} C_R C^{\frac{1}{2}} \right)^{\frac{1}{2}}$$

Notes:

• The matrices $C$ and $C_R$ are not required to be positive semi-definite for the distances $\mathcal{d}_F$ and $\mathcal{d}_{corr}$, as these distances are defined for any $n$ by $n$ matrix.

Let be:

• $n$, the number of assets
• $T$, the number of time periods
• $r_{t,i}, i=1..n, t=1..T$, the return (arithmetic,...) of the asset $i$ over each time period $t$

A bootstrap simulation of the original $n$ asset returns over $T'$ time periods is defined as the sampling with replacement of $T'$ cross-sectional returns from the returns $r_{t,i}, i=1..n, t=1..T$ using one of the bootstrap methods described in the references.

Notes:

• There are 3 possible choices for the bootstrap method:
• IID bootstrap
• Circular block bootstrap
• Stationary block bootstrap (default)
• The IID bootstrap is theoretically applicable to independent data only, and does not require the selection of any additional parameter
• The circular block bootstrap is theoretically applicable to dependent data, and requires the selection of an integer block length $b \geq 2$
• The stationary block bootstrap is theoretically applicable to dependent data, and requires the selection of an average block length $\bar{b} \geq 1$ corresponding to the inverse probability of the geometric distribution associated with the bootstrap method internals
• The default value for the parameter $b$ of the circular block bootstrap is the same as in the R package tseries, that is, the integer part of $3.15 n^{\frac{1}{3}}$
• The default value for the parameter $\bar{b}$ of the stationary block bootstrap is the same as in the R package tseries, that is, $\frac{1}{3.15 n^{\frac{1}{3}}}$

Let be:

• $V_t \in \mathbb{R}^{+,*}$, the value of the portfolio at time $t$, $t=1..T+1$
• $r_t \in \mathbb{R}, t=1..T$, the arithmetic returns of the portfolio over each time period
• $1 - \alpha \in ]0,1[$, the confidence level, in percentage

Then, if $SR^* \in \mathbb{R}$ is a benchmark Sharpe ratio, the minimum track record length $MinTRL(SR^*)$ of the portfolio is defined as the (floating point) number of arithmetic returns $T^*$ that are required to ensure that the probabilistic Sharpe ratio of the portfolio $PSR(SR^*)$ is greater than or equal to $(1 - \alpha)$%, that is $$MinTRL(SR^*) = T^* \textrm{ such that } PSR(SR^*) \geq 1 - \alpha$$

Alternatively, if $B_t \in \mathbb{R}^{+,*}$ is the value of a benchmark at time $t$, $t=1..T+1$, the minimum track record length $MinTRL(B)$ of the portfolio is defined as the (floating point) number of arithmetic returns $T^*$ that are required to ensure that $PSR(B)$ is greater than or equal to $(1 - \alpha)$%, that is $$MinTRL(B) = T^* \textrm{ such that } PSR(B) \geq 1 - \alpha$$

Notes:

• The minimum track record length is not guaranteed to exist.
• The minimum track record length might be less than $T$, which means that the current number of observed arithmetic returns is already sufficient to ensure that the probabilistic Sharpe ratio of the portfolio is greater than or equal to $(1 - \alpha)$%.

Let be:

• $V_t \in \mathbb{R}^{+,*}$, the value of the portfolio at time $t$, $t=1..T+1$
• $r_t \in \mathbb{R}, t=1..T$, the arithmetic returns of the portfolio over each time period
• $\kappa \in \mathbb{R}$, the skewness of the arithmetic returns $r_1,...,r_T$
• $\gamma \in \mathbb{R}$, the kurtosis of the arithmetic returns $r_1,...,r_T$
• $SR \in \mathbb{R}$, the Sharpe ratio of the portfolio

Then, if $SR^* \in \mathbb{R}$ is a benchmark Sharpe ratio, the probabilistic Sharpe ratio $PSR(SR^*)$ of the portfolio is defined as the probability that $SR$, considered as a statistical estimator subject to estimation error, is greater than or equal to $SR^*$, with formula $$PSR(SR^*) = \Phi\left( \frac{SR - SR^*}{ \sqrt{\frac{1 - \kappa SR + (\gamma - 1) \frac{SR^2}{4}}{T}} } \right )$$

Alternatively, if $B_t \in \mathbb{R}^{+,*}$ is the value of a benchmark at time $t$, $t=1..T+1$, the probabilistic Sharpe ratio $PSR(B)$ of the portfolio is defined as the probability that $SR$, considered as a statistical estimator subject to estimation error, is greater than or equal to the Sharpe ratio of the benchmark $SR_B \in \mathbb{R}$, also considered as a statistical estimator subject to estimation error, with formula $$PSR(B) = \Phi\left( \frac{SR - SR_B}{ \sqrt{\frac{1 - \kappa SR + (\gamma - 1) \frac{SR^2}{4} + 1 - \kappa_B SR_B + (\gamma_B - 1) \frac{SR_B^2}{4} + ...}{T} } } \right )$$, where $\kappa_B \in \mathbb{R}$ is the skewness of the arithmetic returns of the benchmark, $\gamma_B \in \mathbb{R}$ is the kurtosis of the arithmetic returns of the benchmark and $...$ depends on the multivariate central moments of the arithmetic returns of the portfolio and of the benchmark as described in the first reference.

In both cases, $\Phi$ is the cumulative distribution function of the standard normal distribution.

Let be:

• $V_t \in \mathbb{R}^{+,*}, t=1..T+1$, the value of the portfolio at time $t$
• $r_t \in \mathbb{R}, t=1..T$, the arithmetic returns of the portfolio over each time period
• $\gamma \in \mathbb{R}$, the kurtosis of the arithmetic returns $r_1,...,r_T$
• $SR \in \mathbb{R}$, the Sharpe ratio of the portfolio

The Sharpe ratio adjusted for small sample bias of the portfolio is defined as $\frac{SR}{\left( 1 + \frac{1}{4} \frac{\gamma - 1}{T} \right)}$.

Let be:

• $V_t \in \mathbb{R}^{+,*}, t=1..T+1$, the value of the portfolio at time $t$
• $r_t \in \mathbb{R}, t=1..T$, the arithmetic returns of the portfolio over each time period
• $\kappa \in \mathbb{R}$, the skewness of the arithmetic returns $r_1,...,r_T$
• $\gamma \in \mathbb{R}$, the kurtosis of the arithmetic returns $r_1,...,r_T$
• $SR \in \mathbb{R}$, the Sharpe ratio of the portfolio
• $1 - \alpha \in ]0,1[$, the confidence level, in percentage

A confidence interval at a confidence level $(1 - \alpha)$% for the Sharpe ratio of a portfolio, considered as a statistical estimator subject to estimation error, is a real interval whose values are not statistically significantly different from $SR$ at a confidence level $(1 - \alpha)$%.

Notes:

• There are 3 possible choices for the type of confidence interval:
• A two-sided confidence interval (default), with formula $$\left[ SR - z_{1-\frac{\alpha}{2}} SE(SR), SR + z_{1-\frac{\alpha}{2}} SE(SR) \right]$$
• An upper one-sided confidence interval, with formula $$\left] -\infty, SR + z_{1-\alpha} SE(SR) \right]$$
• A lower one-sided confidence interval, with formula $$\left[SR - z_{1-\alpha} SE(SR) , +\infty \right[$$

where $SE(SR)$ is defined by $$SE(SR) = \sqrt{\frac{1 - \kappa SR + (\gamma - 1) \frac{SR^2}{4}}{T}}$$

Let be:

• $n$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, an empirical asset correlation matrix, determined using $T$ observations per asset
• $q$, the aspect ratio of $C$ defined by $q = \frac{n}{T}$

The denoised asset correlation matrix is computed by altering the empirical asset correlation matrix $C$ using one of the methods described in the references.

Notes:

• There is 1 possible choice for the denoising method:
• The eigenvalues clipping method, which consists in first finding the Marchenko-Pastur eigenvalue density that best matches the eigenvalue density of $C$ and then in replacing all the eigenvalues of $C$ below the upper edge of the Marchenko-Pastur eigenvalue density, which are considered to represent eigenvalues associated to noise, by their average.

Let be:

• $n$, the number of assets
• $C \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset correlation matrix
• $\mathcal{N} \subset \mathcal{M}(\mathbb{R}^{n \times n})$, the set of equicorrelation matrices

The informativeness of $C$ is defined as its normalized distance - belonging to the interval $[0,1]$ - to the set of equicorrelation matrices $\mathcal{N}$, c.f. the first reference.

Notes:

• There are 3 possible choices for the distance metric, with 3 associated values for the informativeness:
• The Euclidean distance, with $$\textrm{informativeness}(\textup{C}) = \frac{1}{n} \min_{N \in \mathcal{N}} \mathcal{d}_F \left( C, N \right)$$
• The correlation matrix distance, with $$\textrm{informativeness}(\textup{C}) = \min_{N \in \mathcal{N}} \mathcal{d}_{corr} \left( C, N \right)$$
• The Bures distance, with $$\textrm{informativeness}(\textup{C}) = \frac{1}{2n} \min_{N \in \mathcal{N}} \mathcal{d}_{Bures}^2 \left( C, N \right)$$
• The matrix $C$ is not required to be positive semi-definite for the Euclidean and correlation matrix distance.

Let be:

• $n$, the number of assets
• $\sigma_1,...,\sigma_n$, the assets volatilities

The equal volatility-weighted portfolio weights $w \in [0,1]^{n}$ satisfy: $$w_i = \frac{\sigma_i}{\sum_{j=1}^{n} \sigma_j}, i=1..n$$

Let be:

• $n$, the number of assets
• $\sigma = (\sigma_1,...,\sigma_n)$ the vector of the assets volatilities
• $\Sigma \in \mathcal{M}(\mathbb{R}^{n \times n})$, the asset covariance matrix
• $w \in [0,1]^{n}$, the vector of portfolio weights
• $\sigma_p$, the volatility of the portfolio

The correlation spectrum of the portfolio is defined as the vector $\rho(w) \in [-1,1]^{n}$ with components $$\rho(w)_i = \frac{ \left( \Sigma{} w \right)_i }{\sigma_p \sigma_i}$$

Alternatively, let be:

• $n$, the number of assets
• $T$, the number of time periods
• $P_{t,i} \in \mathbb{R}^{+,*}$, the price of the asset $i$ at the time $t$, $i=1..n$, $t=1..T$
• $V_{t} \in \mathbb{R}^{+,*}$, the value of the portfolio at the time $t$, $t=1..T$

The correlation spectrum of the portfolio is defined as the vector $\rho(w) \in [-1,1]^{n}$ with components $$\rho(w)_i = \rho_{p,i}$$

, with $\rho_{p,i} \in [-1,1]$ the correlation of the arithmetic returns of the portfolio with the arithmetic returns of the asset $i, i=1..n$.