[R-SIG-Finance] Optimization Question

Brian G. Peterson brian at braverock.com
Wed Dec 31 13:27:27 CET 2008


Ian McDonald asked:
> I am interested in doing a portfolio optimization, but I need to impose
> non-linear, functional constraints (i.e Max Drawdown, or VaR, etc). I've
> looked into several of the optimization routines (nlminb, constrOptim and
> optim with SANN/L-BFGS-B) but it appears that all of them are geared to
> linear constraints. Other than using a penalty function method, is anyone
> aware of any other approaches available in  R?
>
> Thanks
> Ian McDonald
> Malbec Partners


Guy Yollin responded:
> Ian,
>
> An excellent technique for general purpose non-linear optimization is the
> differential evolution algorithm:
>
> http://www.icsi.berkeley.edu/~storn/code.html
>
> It has been implemented in the DEoptim package available on CRAN; the
> algorithm is very flexible and you could readily implement an maximum
> drawdown or VaR optimization strategy using DE.
>
> Back in February 2008, David Basterfield gave a webcast on the
> differential evolution algorithm with a number of non-linear portfolio
> optimization examples; it is still available on the Insightful website
> under events/finance:
>
>         http://www.insightful.com/
>
> Note, a number of papers have shown the superiority of
> conditional-value-at-risk (CVaR) to VaR as a risk metric.  The CVaR
> portfolio optimization can be framed as a linear programming problem and
> you could then use a linear programming package (e.g. lpSolve or linprog)
> to find mean-CVaR optimum portfolios.  The books Portfolio Construction
> and Risk Budgeting by Bernd Scherer and Introduction to Modern Portfolio
> Optimization by Bernd Scherer and Douglas Martin provides some details on
> this and other non-standard portfolio optimization techniques; although
> both these books include S+NuOPT examples, the key points are
> transferrable to R.
>
> Best,
>
> -- Guy

Guy raises some excellent points.  I think that one key here is that there
are typically other constraints on a large portfolio optimization problem,
not just the return/risk ratio.  In addition to weight constraints over
the portfolio generally, the investor may have additional restrictions on
style allocations, lockup periods on particular investments, etc.  As the
number of constraints rises, the availability and suitability of a
solution decreases.

To extend Guy's comments about CVaR or ES, it is superior for optimization
because it is a coherent risk measure under most circumstances,  some of
our work extended ES to include skewness and kurtosis using the Cornish
Fisher and Edgeworth expansions.  Those functions are available in R in
PerformanceAnalytics.

We've also done some work with non-linear optimization under constraints
using Rdonlp2 (non-free for commercial use) in R.  An exploratory example
of that work was published here:

http://library.witpress.com/pages/PaperInfo.asp?PaperID=18906

Another interesting point is how you arrive at predictions of the values
in question. VaR and its cousins are typically a one-step-ahead
prediction.  If you want to optimize over longer time frames than one
period, you need to predict parameters (mean, variance, skewness,
kurtosis) further into the future with some confidence.  This generally
becomes a multi-layered problem as you seek to find the best predictors of
your input parameters before finally applying it all to the portfolio
optimization algorithm.

I've generally found most published discussion of risk budgeting to be
dissatisfying because they skip over many of these nuances,  Hopefully
future work by this community (myself included!) can remedy some of those
oversights.

Regards,

    - Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list