Equilibrium expected returns: private API
PortfolioOptimisers.equilibrium_mu — Function
equilibrium_mu(l::Number, sigma::MatNum, w::Option{<:VecNum})Compute equilibrium expected returns from a risk aversion parameter, a covariance block, and equilibrium weights.
This function is the one place in the library that computes $\lambda \mathbf{\Sigma} \boldsymbol{w}$ and its equal-weight fallback. EquilibriumExpectedReturns, FactorBlackLittermanPrior and AugmentedBlackLittermanPrior all call it, so the three share one fallback and one length check.
The result is an excess return. Reverse optimisation implies a risk premium, so the result holds no risk-free rate. For this reason the two Black-Litterman priors add the rate to the result of this function with apply_rf. They add it only when they call this function. A mean that they take from a wrapped prior estimator is a total return already.
sigma is a covariance block, which can be rectangular. Its columns are the assets of the weights, so w must have the length size(sigma, 2). A square covariance matrix gives the equilibrium returns of the assets. A rectangular block gives one equilibrium return for each of its rows. FactorBlackLittermanPrior passes a factors × assets block, and gets a prior mean of the factors from asset weights. AugmentedBlackLittermanPrior puts the asset covariance matrix on top of that block, and gets the assets and the factors in one vector.
Mathematical definition
\[\begin{align} \hat{\boldsymbol{\mu}}_{\text{eq}} &= \lambda \, \mathbf{\Sigma} \, \boldsymbol{w}\,. \end{align}\]
Where:
- $\lambda$: The risk aversion parameter.
- $\mathbf{\Sigma}$: The $M \times N$ covariance block.
- $\boldsymbol{w}$: The $N \times 1$ equilibrium portfolio weights.
Algorithm
- When
wisnothing, read the asset countNfromsize(sigma, 2), and build the equal-weight vectorfill(inv(N), N). - When
wis a vector, check thatlength(w)equalssize(sigma, 2). - Apply the expression above to
l,sigmaand the weights of step 1 or step 2. The result ismu.
Arguments
l: The risk aversion parameter.sigma: The covariance block. Its columns are the assets.w: The equilibrium weights, ornothingfor equal weights.
Validation
- If
wis a vector,length(w) == size(sigma, 2).
Returns
mu::VecNum: The equilibrium expected returns, a vector of lengthsize(sigma, 1).
Related