[R-SIG-Finance] Portfolio Optimization with Non-linear Transaction Cost in RMetrics

Brian G. Peterson brian at braverock.com
Thu Apr 15 17:01:30 CEST 2010

On 04/15/2010 09:11 AM, thorsten schmidt wrote:
> Hi,
> Is there a way to perform portfolio optimization with Non-linear transaction
> cost in fPortfolio or any of the other RMetrics packages, or other packages?
> Thank you.

You haven't been very particular in describing your problem.

Please state it as a formal problem specification like:


I have a portfolio of <n> assets that all share<don't share> the same 
asset class, with <daily> periodicity and <common?> currency.

I wish to
- maximize total net wealth
- maximize exponentially weighted moving average daily return
- minimize Cornish-Fisher modified Expected Shortfall
- limit drawdowns to x%

subject to
- weight constraints on each asset

the thing I don't understand how to do is:
- my transaction costs are computed by a function that will add friction 
to the returns at different weights, based on position size, and I've 
written this function <provide code> to calculate the 'cost' of changing 

...and the R code I've tried that solves part of my problem is... 
(include reproducible example)  ... with the following errors or missing 
bits as I try to solve the part I don't know the answer to...


This will help others who may have solved problems similar to yours help 
you solve your problem.

Off the top of my head, the optimization packages specific to portfolio 
optimization in R are:
- fPortfolio
- PortfolioAnalytics
- lspm
- backtest (and it's cousin portfolio)

and of course there is the optimization task view for the field of 
optimization not limited to finance:


but I (and I suspect anybody else) can't actually answer your question 
because you didn't tell us enough about your problem.

Which optimization solver to use is very very particular to the 
specifics of your problem.

Please take the time to formulate your question in a way that makes it 
easy for the list to help you.  A well-formed question will also 
hopefully cut down on similar questions being asked in the future.

If, by chance, I've given you enough information to help you solve your 
problem, do us all a favor and post your solution (use demo or 
non-proprietary data, of course) so that others can benefit from what 
you find out.


   - Brian

Brian G. Peterson
Ph: 773-459-4973
IM: bgpbraverock

More information about the R-SIG-Finance mailing list