This function generates random portfolios based on the method outlined in the Shaw paper. Need to add reference.
rp_simplex(portfolio, permutations, fev = 0:5)
a matrix of random portfolio weights
an object of class 'portfolio' specifying the constraints for the optimization, see portfolio.spec
integer: number of unique constrained random portfolios to generate
scalar or vector for FEV biasing
The simplex method is useful to generate random portfolios with the full investment constraint where the sum of the weights is equal to 1 and min box constraints with no upper bound on max constraints. Values for min_sum and max_sum will be ignored, the sum of weights will equal 1. All other constraints such as group and position limit constraints will be handled by elimination. If the constraints are very restrictive, this may result in very few feasible portfolios remaining.
The random portfolios are created by first generating a set of uniform random numbers. $$U \sim [0, 1]$$ The portfolio weights are then transformed to satisfy the min of the box constraints. $$w_{i} = min_{i} + (1 - \sum_{j=1}^{N} min_{j}) \frac{log(U_{i}^{q}}{\sum_{k=1}^{N}log(U_{k}^{q}}$$
fev
controls the Face-Edge-Vertex (FEV) biasing where $$q=2^{fev}$$
As q
approaches infinity, the set of weights will be concentrated in a
single asset. To sample the interior and exterior, fev
can be passed
in as a vector. The number of portfolios, permutations
, and the
length of fev
affect how the random portfolios are generated. For
example, if permutations=10000
and fev=0:4
, 2000 portfolios will
be generated for each value of fev
.