Skip to content
Prev 14196 / 15274 Next

random portfolios

The process you describe is pretty standard for an investment-committee 
driven process.

I'm going to suggest that you don't really want to change the 
constraints that often.  For example, box constraints should be as large 
as your overall investment mandate allows to give you the greatest 
possible room for allocations.  Sector or Factor constraints likewise 
should be as minimal as possible just to guarantee the degree of 
diversification described in your investment mandate.

The reason I'm suggesting this minimal constraint set is one of the 
reasons we wrote the random portfolio code in the first place.  To see 
what I mean, generate a set of unconstrained random portfolios (or e.g. 
only with a full-investment constraint).  Then generate sets of 
constrained random portfolios, adding your various constraint sets. 
Plot the different sets on the same risk/return scatter plot, using 
different colors for each set.  Note how small the feasible space 
becomes, very quickly.

This shrinkage of the feasible space has some good shrinkage 
properties...  moderate shrinkage actually decreases the possible impact 
of estimation error in the various inputs, a little.  Large amounts of 
shrinkage (overly restrictive constraints) will do the opposite, and 
magnify the negative out of sample impact of estimation error.

The academic literature mostly focuses on analytical solvers (e.g. 
quadratic, linear, etc) and simple constraint sets.  We've cited papers 
by Patrick Burns as well as papers on the simplex models in 
PortfolioAnalytics, but the literature is not vast.

Numerical solvers become important as the feasible space becomes 
non-smooth.  One of the things that can create a non-smooth feasible 
space is a complex, overlapping constraint set.

The rportfolios package proposed by Frederick Novomestky also seems to 
be an R-only implementation, at a glance relying on truncated random 
binomial vectors rather than truncated random uniform vectors.  I 
believe it will have similar performance characteristics to the 
Burns-style random sample portfolios, and it seems to support fewer 
constraint sets (no overlapping sector, group, or factor constraints 
that I see).  In any case, it generates matrices of weights that are 
likely compatible with the PortfolioAnalytics random or seed portfolio 
inputs.  So if it works for you, that's great.

You also discuss using rejection after generating the portfolios.  This 
is the method used internally by random.portfolios to reject individual 
weights if a constraint is violated.  I'll have to evaluate whether the 
truncdist package used by rportfolios could be more efficient than the 
runif that is used by the current code.  PortfolioAnalytics also allows 
portfolios to be penalized in the solver, so that more complex cases can 
be considered, or interactions between constraints and objectives.

To answer the question of whether Rcpp will help is somewhat complex. 
I'm confident that some of the nested loops in the generation code will 
be sped up by Rcpp.  It is possible that more efficient algorithms are 
available for constructing the weight vectors.  A reason that this 
hasn't been a huge priority though is that construction of the random 
portfolio matrix is usually not the time limiter in a large 
optimization: your objective function is.  I think it will be possible 
to improve the efficiency of this step, though it is unclear how much of 
an impact this should have in practice to a large and complicated 
numerically solved portfolio optimization problem.

Regards,

Brian
On 03/20/2017 07:06 PM, Kevin Dhingra wrote: