<p>Here's how you would account for risk aversion.</p>

<p>First of all, I think this problem is usually set up using weights as the variables (see here <a href="http://www.math.ku.dk/~rolf/CT_FinOpt.pdf" rel="nofollow">http://www.math.ku.dk/~rolf/CT_FinOpt.pdf</a>, page 141). If you want to use dollar weights, you will have to transform the result.</p>

<p>The optimization problem is:</p>

<p>$$ \max_w \quad  w'\mu −\frac{\gamma}{2} w'\Sigma w$$ </p>

<p>Weights add up to 1:</p>

<p>$$ w'e = 1 $$</p>

<p>Where you have $N$ assets, $w$ and $\mu$ are $N\times1$ vectors, and $\Sigma$ is an $N\times N$ matrix. $e$ is an $N\times1$ vector of ones.</p>

<p>The Lagrangian for the problem is:</p>

<p>$$ \max_w \quad  w'\mu −\frac{\gamma}{2} w'\Sigma w + \lambda (w'e - 1)$$ </p>

<p>To optimize, we take the gradient of the objective function, and set each element equal to zero. So we will have an $N\times 1$ vector equation:</p>

<p>$$0 = \mu - \gamma \Sigma w + \lambda e$$</p>

<p>This can be solved for $w$:</p>

<p>$$w = \left(\gamma \Sigma\right)^{-1} \left(\mu + \lambda e\right)$$</p>

<p>Plugging this back into the constraint, we get:</p>

<p>$$ \left(\left(\gamma \Sigma\right)^{-1} \left(\mu + \lambda e\right)\right)'e = 1$$</p>

<p>The transpose reverses the order of the terms, and has no effect on the symmetric $\Sigma^{-1}$ matrix:</p>

<p>$$ \left(\left(\mu' + \lambda e'\right)\frac{\Sigma^{-1}}{\gamma} \right)e = 1$$</p>

<p>This can be simplified to:</p>

<p>$$ \mu' \Sigma^{-1} e + \lambda e' \Sigma^{-1} e = \gamma$$</p>

<p>Solving for $\lambda$, we get</p>

<p>$$ \lambda = \frac{\gamma - \mu' \Sigma^{-1} e}{e'\Sigma^{-1} e} $$</p>

<p>So the overall formula for the weights is:</p>

<p>$$w = \left(\gamma\Sigma\right)^{-1} \left(\mu + \frac{\gamma - \mu' \Sigma^{-1} e}{e'\Sigma^{-1} e} e\right)$$</p>

CC BY-SA 3.0
2015-10-07T00:38:12.207Z
2015-10-07T00:38:12.207Z
Tom P
<p>I want to calculate the classic mean variance portfolio (Markowitz) with a risk aversion parameter $\gamma$. 
I have the following problem where I want to maximize:</p>

<blockquote>
  <p>$max(x_t) \ \ x_t^T\mu_t - \frac{\gamma}{2}x_t^T\Sigma_tx_t$</p>
</blockquote>

<p>Where $\mu$ = mean </p>

<p>$x_t$ = portfolio at time $t$</p>

<p>$\Sigma$ = sample covariance matrix</p>

<p>w(t) is the vector of relative weights in the portfolio, calculated as follows: </p>

<p>$w_t=\frac{x_t}{1_N^Tx_t}$</p>

<p>1_N is a vector of ones (N elements)</p>

<p>My concern is that in the literature I have seen only solution for the above maximization problem where the risk aversion parameter drops out:</p>

<p>$w_t=\frac{\Sigma_t^{-1}\mu_t}{1_N\Sigma_t^{-1}\mu_t}$</p>

<p>I'm wondering at which point do we account for the risk aversion parameter during the optimization?</p>

CC BY-SA 3.0
2015-10-06T19:48:52.967Z
I don't know why it is not possible to edit the question. Could you please put the sign $ in order to convert your equations in LateX form ?Not possible to read them easily for the moment.
optimal control
CC BY-SA 3.0
2015-10-06T19:53:01.120Z
sorry about that. It is now done!
tyr
CC BY-SA 3.0
2015-10-06T20:10:53.373Z
I know that there exists a literature about ambiguity etc on these topics but as I am far of this literature, let me know about some stuff about your question.
as you are making an optimization, what is your budget constraint ? also where do you use the parameter $w_{t}$ ?
optimal control
CC BY-SA 3.0
2015-10-06T20:29:45.173Z
hi. THanks a lot for your help. I added a couple of more details, I hope it will be easier to understand. (you can refer to Demiguel et al: Optimal Versus Naive Diversification How inefficient is the 1/N portfolio strategy)
Regarding the budget constraint, I am not so sure, I think there is the usual constraint applies here too that the sum of weights should add up to 1.
tyr
<optimization><portfolio-theory>
Calculating mean variance portfolio with risk aversion parameter
tyr
# Calculating mean variance portfolio with risk aversion parameter

(Asked by: username_0 on 2015-10-06)

I want to calculate the classic mean variance portfolio (Markowitz) with a risk aversion parameter $\gamma$.
I have the following problem where I want to maximize:

> $max(x\_t) \ \ x\_t^T\mu\_t - \frac{\gamma}{2}x\_t^T\Sigma\_tx\_t$

Where $\mu$ = mean

$x\_t$ = portfolio at time $t$

$\Sigma$ = sample covariance matrix

w(t) is the vector of relative weights in the portfolio, calculated as follows:

$w\_t=\frac{x\_t}{1\_N^Tx\_t}$

1\_N is a vector of ones (N elements)

My concern is that in the literature I have seen only solution for the above maximization problem where the risk aversion parameter drops out:

$w\_t=\frac{\Sigma\_t^{-1}\mu\_t}{1\_N\Sigma\_t^{-1}\mu\_t}$

I'm wondering at which point do we account for the risk aversion parameter during the optimization?

**Tags:** optimization, portfolio-theory

> **Comments:**
> **username_1**: I don't know why it is not possible to edit the question. Could you please put the sign $ in order to convert your equations in LateX form ?Not possible to read them easily for the moment.  
> **username_0**: sorry about that. It is now done!  
> **username_1**: I know that there exists a literature about ambiguity etc on these topics but as I am far of this literature, let me know about some stuff about your question. as you are making an optimization, what is your budget constraint ? also where do you use the parameter $w_{t}$ ?  
> **username_0**: hi. THanks a lot for your help. I added a couple of more details, I hope it will be easier to understand. (you can refer to Demiguel et al: username_1 Versus Naive Diversification How inefficient is the 1/N portfolio strategy) Regarding the budget constraint, I am not so sure, I think there is the usual constraint applies here too that the sum of weights should add up to 1.  

---

## 1 answers

### Answer by username_2 on 2015-10-07. Score: 2

Here's how you would account for risk aversion.

First of all, I think this problem is usually set up using weights as the variables (see here <http://www.math.ku.dk/~rolf/CT_FinOpt.pdf>, page 141). If you want to use dollar weights, you will have to transform the result.

The optimization problem is:

$$ \max\_w \quad w'\mu −\frac{\gamma}{2} w'\Sigma w$$

Weights add up to 1:

$$ w'e = 1 $$

Where you have $N$ assets, $w$ and $\mu$ are $N\times1$ vectors, and $\Sigma$ is an $N\times N$ matrix. $e$ is an $N\times1$ vector of ones.

The Lagrangian for the problem is:

$$ \max\_w \quad w'\mu −\frac{\gamma}{2} w'\Sigma w + \lambda (w'e - 1)$$

To optimize, we take the gradient of the objective function, and set each element equal to zero. So we will have an $N\times 1$ vector equation:

$$0 = \mu - \gamma \Sigma w + \lambda e$$

This can be solved for $w$:

$$w = \left(\gamma \Sigma\right)^{-1} \left(\mu + \lambda e\right)$$

Plugging this back into the constraint, we get:

$$ \left(\left(\gamma \Sigma\right)^{-1} \left(\mu + \lambda e\right)\right)'e = 1$$

The transpose reverses the order of the terms, and has no effect on the symmetric $\Sigma^{-1}$ matrix:

$$ \left(\left(\mu' + \lambda e'\right)\frac{\Sigma^{-1}}{\gamma} \right)e = 1$$

This can be simplified to:

$$ \mu' \Sigma^{-1} e + \lambda e' \Sigma^{-1} e = \gamma$$

Solving for $\lambda$, we get

$$ \lambda = \frac{\gamma - \mu' \Sigma^{-1} e}{e'\Sigma^{-1} e} $$

So the overall formula for the weights is:

$$w = \left(\gamma\Sigma\right)^{-1} \left(\mu + \frac{\gamma - \mu' \Sigma^{-1} e}{e'\Sigma^{-1} e} e\right)$$


---

