Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a portfolio of only four components using the mean-variance optimization (MVO). I am setting up my problem such that I want to maximize the expected returns with a fixed vol target. I am using a non-linear optimizer to solve this problem.

The problem I am facing is that when I set the non-linear constraint as : variance <= my vol target, the portfolio output seems to be unaffected by this constraint. I do have other constraints (linear and non-linear) that seem to affect the outcome but the fixed vol target constraint is ineffective. By ineffective I mean that if I set a vol target of 5% my portfolio is still generating a vol of 15%.

My questions are : 1) Is maximizing the return implicitly making the portfolio to attain a particular risk irrespective of any risk(vol target) constraints? 2) I am using nlopt C++ library to solve the optimization problem, if their is a possibility that I am not setting up the non-linear constraint correctly how do I debug this? and how do I know if my problem requires some kind of scaling?

Thank you in advance.

share|improve this question
It is likely an error that can only be evaluated by looking at the code. For instance, it could be that you programmed the non-linear constraint wrong, or it could be that your linear and non-linear constraints are inconsistent somehow. One piece of advice: start with a very simple optimization and gradually make it more complicated, verifying at each stage that you're getting sensible results. – John Aug 27 '14 at 19:37
Thank you. I did add the constraints one by one and see effects of all other except this one. The basic question is that is it possible to have a portfolio optimization that can maximize the returns and allow for a cap on the volatility? – kulksac Aug 28 '14 at 0:18
Yes, it is possible. Assuming you did the non-linear constraint correctly, it could be that with four assets it can't find an optimal portfolio with volatility that low. There are too many potential things it could be to say for sure. Some other tips, draw the efficient frontier (that way you can get a sense of the minimum risk and maximium return portfolios) or switch it around and minimize risk given return (and maybe also draw that frontier). – John Aug 28 '14 at 1:42
Yes I did try doing the minimize risk with a given return and I had a similar problem where my given return does not have any effect on the output. I haven't tried drawing the efficient frontier, I will do that next. Thanks! – kulksac Aug 28 '14 at 3:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.