I am trying to do this portfolio optimization for a one-month investment between S&P 500 as a risky asset and one risk-free asset:

enter image description here

Assume that I have a power utility function, a risk-free rate interpolated for one month, and an option implied distribution function of next month returns. To find the two alpha as optimal weights of my portfolio, I need to know the return of the risky asset, i.e. $r_{t+1}$. What should I use for it?
And when I want to maximize the utility, I should take it as a constant in the $dF(r_{t+1})$? i.e. $dF$ is a constant number that will not play any role in the maximization problem?


2 Answers 2


Your question is very confusing. But let's take it by parts:

  1. You say you have power utility so your utility is: $\frac{W_{t+1}^{1-\gamma}}{1-\gamma}$
  2. You have a risk-free rate number
  3. You have an option implied distribution for stock returns so that should give you a two vectors one with returns $r_{t+1}$ and another with probabilities $dF(r_{t+1}$).
  4. Given the non parametric nature of the problem (as you have a distribution of returns) you need to solve the problem numerically. Bellow a dummy example using matlab. Where I assume a risk-free, a gamma, a distribution for returns.
  5. The result for that calibration is to allocate 0.62 to the risky asset and the remaining to the risk free.
gamma = 10;
rf = 0.02;
ret = -0.02:0.01:0.07; %10 possible returns between -0.02 and 0.07
prob = 1/size(ret,2)*ones(size(ret,2),1); %Same probabilities each

% Now the maximization problem 

alpha = (0.00:0.01:1.0)'; %grid for alpha

ExpUtility = zeros(size(alpha,1),1);
for i=1:size(prob,1)

   ExpUtility = ExpUtility + prob(i)*(((1+alpha*ret(i) + (1-alpha)*rf)).^(1-gamma))/(1-gamma);


[maximum, index] = max(ExpUtility);

  • $\begingroup$ Thanks for this precise answer; I understand the problem better now. But there is still a problem. Your example takes the probabilities as given. When we have a nonparametric distribution function f(r), the probability of each return (as a point) to happen is zero (because distribution is continues). So I can't have a 'prob' vector like you. How should I tackle this problem? I think we should take integral of distribution instead of the sum you use here, but I don't know exactly how. $\endgroup$
    – Novic
    May 5, 2018 at 20:39
  • $\begingroup$ If you have a functional form for $dF(r_{t+1}$ with which you can take a derivative then you can solve the problem using first order conditions. You should have it. You either have a vector of for $dF(r_{t+1}$ and corresponding probabilities or a functional form. $\endgroup$
    – phdstudent
    May 5, 2018 at 20:42

I wrote this code in R which I think is better for a continuous distribution function.

Utility <- function(r_t)    (-1/ARA) *  exp( (1 + a_t*r_t + (1-a_t) * r_f) * (-ARA) )

 MaxiProb <- function(r_t)  Utility(r_t) * realPDF(r_t)

 alpha <- seq(-1,2 , 0.01)
 ExpUtility <- rep(0 , length(alpha))

     for (i in seq_along(alpha)) {
      a_t <- alpha[i]
  ExpUtility[i] <- integral(MaxiProb , -Inf , Inf )  

First I define the utility function and the product of utility and PDF to find $U(r_{t+1}) dF({t+1})$. Then I define alpha and expected utility which is negative exponacial, and I calculate the integral for each alpha to find the possible expected utilites. Then I can find the alpha which gives the largest expected utility here:


Of course, the code is not reproducible since the PDF is not available here, but it gives an understanding of what am I talking about.


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.