Reverse-Engineering Mean-Variance Returns for Target Portfolio Weights
Summary
This discussion examines how to infer expected returns that produce chosen portfolio weights under mean-variance optimization when the covariance matrix, risk aversion, and one asset’s expected return are known. It explains that directly applying the unconstrained inverse covariance formula does not preserve a target portfolio after one return is overwritten, because that changes the optimization inputs and the formula does not impose weights summing to one.
The proposed approach uses the fully invested portfolio condition and the relationship between the target weights and expected returns. With one return fixed, the discussion solves for a scalar adjustment and then recovers the remaining returns; an example reports the resulting three expected returns. It also describes an alternative of solving for the unknown assets’ excess returns. The derivations rely on the stated optimization setup and known inputs, so assumptions such as a fully invested portfolio and consistent definitions of benchmark weights matter. The initial code alone is not a valid circularity check when it uses unconstrained mean-variance weights.
Key ideas
- Changing one expected return after reverse optimization generally changes the resulting optimal weights.
- Unconstrained mean-variance weights do not automatically sum to one.
- A fully invested portfolio condition supplies a constraint used to infer the unknown returns.
- With one expected return fixed, a scalar adjustment can be solved before recovering the full return vector.
Tags
Full text
# Reverse Optimization: finding the returns that satisfy specific weights given one known return
# Reverse Optimization: finding the returns that satisfy specific weights given one known return
Here is the premise: I have a three asset portfolio, I know the assets covariance, the client's risk aversion and the expected return of one of the assets. I also have a desired set of weights.
So, 1) how do I find the expected returns for the two assets I don't know that gives me my desired set of weights and 2) if I reverse the function can I get the desired weights back i.e. test the results?
Here's my Python code:
```
import numpy as np
# Define the function
def get_weight(expected_return, asset_covariance, risk_aversion):
ER = expected_return
S = asset_covariance
L = risk_aversion
return np.linalg.inv(L * S) @ ER
# Given data
risk_aversion = 1.0 # example value for L
cov_matrix = np.array([[0.01, 0.002, 0.001], [0.002, 0.03, 0.004], [0.001, 0.004, 0.02]])
# example covariance matrix
# Desired weights
desired_weights = np.array([0, 0.55, 0.45])
# Solve for expected returns
expected_returns = risk_aversion * cov_matrix @ desired_weights
expected_returns[0] = 0.009 # given return
# Calculate weights using the original function
calculated_weights = get_weight(expected_returns, cov_matrix, risk_aversion)
# Output the results
expected_returns, calculated_weights
```
Here's the output I get. You clearly see it's not circular. I expect the weights array to be 0.00,0.55,0.45. I can understand some rounding but the result is quite a bit off.
Where am I going wrong? Please reference Python in your comments if you can.
## Answer by John (score 1)
https://quant.stackexchange.com/a/79557
OP takes Black-Litterman reverse optimization expected returns, overrides one of the values with a different expected return, and finds that the resulting portfolio didn't match the original one. This is not surprising.
The answer referenced by @KaiSqDst is nearly sufficient to give an analytic solution (this is very close to a repeat of that question).
That answer (at least when I am viewing it) has the formula
$$ \gamma\Sigma(w^*-w_0)=\left(\mathbf{I}-\frac{1}{a}\mathbf{1}\mathbf{1^T}\Sigma^{-1}\right)\mu $$
and correctly notes that the problem is underdetermined and you cannot invert the right hand side matrix. However, it is possible, especially for a simple problem like this but perhaps not in the general case, to take a subset of the matrix and solve that. For your purpose, this would be to exclude the first asset that is assumed to have an expected return of 0.009. This would be like solving for the excess returns of the other assets. From the excess returns, you would add back 0.009 to each to get actual returns. The result is a 0.009 for asset 1, 0.09275 for asset 2, and 0.05725 for asset 3.
When double-checking the results, you need to make sure to assume the weights sum to 1. It isn't "circular" with unconstrained mean-variance.
## Answer by Kermittfrog (score 0)
https://quant.stackexchange.com/a/79560
Referencing the original answer to the general problem and the definitions wherein, we remember the optimal investment decision which we can rewrite as:
$$ \begin{align} w^*&=w_0+\frac{b}{\gamma}\left(w_M-w_0\right)\\ \Rightarrow \gamma \Sigma \left(w^*-w_0\right)&=\mu-\frac{b}{a}\mathbf{1} \end{align} $$ We do know all elements of the vector on the lhs and we know one element of $\mu$, say $\mu_1$. Hence, we can trivially solve:
$$ \begin{align} \left(\gamma \Sigma \left(w^*-w_0\right)\right)_{(1)}&=\mu_1-\frac{b}{a}\\ \Rightarrow b&=a\mu_1 - a\left(\gamma \Sigma \left(w^*-w_0\right)\right)_{(1)} \end{align} $$
Given knowledge of $b$, we obtain:
$$ \mu=\gamma\Sigma\left(w^*-w_0\right)+\frac{b}{a}\mathbf{1} $$Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.