1
$\begingroup$

I have the below function in Python. My objective is to back out the expected returns associated with certain portfolio weights given a series of assumptions.

From this I want to generate the expected returns I would get with a portfolio that has a number of constraints. My expectation is that I should get the same result from a function that is unconstrained and this one provided the weights I give both functions are within the same constraints and all other inputs are the same. But so far that isn't the case. Can anyone enlighten me on where I'm going wrong?

Constrained function (it isn't quite working):

def reverse_optimze_expected_return(weights, asset_covariance, weight_limits, risk_aversion):
    
    n_assets = len(weights)
    
    expected_return = cp.Variable(n_assets)
    
    objective = cp.Minimize(cp.quad_form(weights, asset_covariance))
    
    constraints = [
        cp.sum(weights) == 1,
        cp.quad_form(weights, asset_covariance) <= risk_aversion,
        ]
    
    for i in range(n_assets):
        constraints.append(weights[i] >= weight_limits[i][0] / 100)
        constraints.append(weights[i] <= weight_limits[i][1] / 100)
        
    problem = cp.Problem(objective, constraints)
    problem.solve()
    
    optimize_expected_returns = expected_return.value
    
    return optimize_expected_returns

Here is the unconstrained function:

def get_expected_return(weight, asset_covariance, risk_aversion):
    
    w = weight
    S = asset_covariance
    L = risk_aversion 
    
    return L * S @ w

weights are as follows [0.55, 0.45, 0.0]

asset_covariance is this matrix

enter image description here

risk_aversion is 3.1880326818259768

And weight_limits are [(42.5, 67.5), (32.5, 57.5), (0, 25)]

$\endgroup$
2
  • $\begingroup$ There is a closed form solution in the paper by Shumway, Szefler and Yuan 2009(?).For their approach they used excess returns over a benchmark bur you can set the benchmark to zero for your purpose. Then perhaps on a later stage add further constraints and see how your solution differs. Just an idea. $\endgroup$
    – T123
    Commented Apr 19 at 20:04
  • 1
    $\begingroup$ Would you be able to formulate your idea and approach in LaTeX notation, please? $\endgroup$ Commented Apr 23 at 13:06

1 Answer 1

1
$\begingroup$

This is not yet an answer, but too long for a comment. Let's start without the box constraints and solely impose $\sum_iw_i=1, i.e. w^T\mathbf{1}=1$:

$$ \begin{align} \max_w\quad & w^T\mathbf{\mu}-\frac{1}{2}\gamma w^T\mathbf{\Sigma} w\\ \mathrm{s.t.}\quad &w^T\mathbf{1}=1 \end{align} $$

After solving the Lagrangian, the solution is

$$ w^*(\gamma)=w_0+\frac{b}{\gamma}\left(w_M-w_0\right) $$

Canonically, $$ \begin{align} w_0\equiv\frac{\mathbf{\Sigma}^{-1}\mathbf{1}}{\mathbf{1}^T\mathbf{\Sigma}^{-1}\mathbf{1}}\equiv\frac{\mathbf{\Sigma}^{-1}\mathbf{1}}{a}\\ w_M\equiv\frac{\mathbf{\Sigma}^{-1}\mathbf{\mu}}{\mathbf{1}^T\mathbf{\Sigma}^{-1}\mathbf{\mu}}\equiv\frac{\mathbf{\Sigma}^{-1}\mathbf{\mu}}{b}\\ \end{align} $$

Given the observed $w^*,\gamma,\Sigma$, we can of course easily solve for $w_0$ and $a$, but we cannot solve for $\mathrm{\mu}$, as the following equation system (derived by reorganizing the eqn above) is underdetermined and cannot be solved for $\mu$ as the right hand side matrix is not invertible:

$$ \gamma\Sigma(w^*-w_0)=\left(\mathbf{I}-\frac{1}{a}\mathbf{1}\mathbf{1^T}\Sigma^{-1}\right)\mu $$

What we can say, though, is that $w_m-w_0$, and hence $\mathbf{\mu-1}$ (elementwise), scales with $w^*-w_0$, i.e.

$$ w_M-w_0\propto w^*-w_0 $$

Adding box constraints helps the solution a bit, but IMHO is not sufficient information to solve this problem. Thus, even the observation of a second investment decision $w(\gamma_2)$ does not add information, neither does knowledge of the portfolio's expected return $\mu_i=w(\gamma_i)^T\mathbf{\mu}$.

IMO, given box constraints, all you could do at this point is to trace out different levels of $\mu(b)$ as a function of $b$:

$$\mu(b)=\gamma\Sigma\left(w(\gamma)-w_0\right)+\frac{b}{a}\mathbf{1}$$.

As this is a linear equation in $b$, the set of feasible $\mu$ (and $b$) is compact and is traced out quite easily. Furthermore, as we are only adding levels of $\frac{b}{a}$, elementwise, the differences between the different elements in $\mu_i$ are always the same and equal to the true difference.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.