Description Usage Arguments Details Value Author(s) See Also
Generate random portfolios using the 'sample', 'simplex', or 'grid' method. See details.
1 2 | random_portfolios_v2(portfolio, permutations = 100,
rp_method = "sample", eliminate = TRUE, ...)
|
portfolio |
an object of class 'portfolio'
specifying the constraints for the optimization, see
|
permutations |
integer: number of unique constrained random portfolios to generate |
... |
any other passthru parameters |
rp_method |
method to generate random portfolios. Currently "sample", "simplex", or "grid". See Details. |
eliminate |
TRUE/FALSE, eliminate portfolios that do not satisfy constraints |
Random portfolios can be generate using one of three methods.
sample: The 'sample' method to generate random portfolios is based on an idea pioneerd by Pat Burns. This is the most flexible method, but also the slowest, and can generate portfolios to satisfy leverage, box, group, and position limit constraints.
simplex: The 'simplex' method to generate random
portfolios is based on a paper by W. T. Shaw. 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. Values for
min_sum
and max_sum
of the leverage
constraint 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.
grid: The
'grid' method to generate random portfolios is based on
the gridSearch
function in package 'NMOF'. The
grid search method only satisfies the min
and
max
box constraints. The min_sum
and
max_sum
leverage constraints will likely be
violated and the weights in the random portfolios should
be normalized. Normalization may cause the box
constraints to be violated and will be penalized in
constrained_objective
.
The constraint types checked are leverage, box, group,
and position limit. Any portfolio that does not satisfy
all these constraints will be eliminated. This function
is particularly sensitive to min_sum
and
max_sum
leverage constraints. For the sample
method, there should be some "wiggle room" between
min_sum
and max_sum
in order to generate a
sufficient number of feasible portfolios. For example,
min_sum=0.99
and max_sum=1.01
is
recommended instead of min_sum=1
and
max_sum=1
. If min_sum=1
and
max_sum=1
, the number of feasible portfolios may
be 1/3 or less depending on the other constraints.
matrix of random portfolio weights
Peter Carl, Brian G. Peterson, Ross Bennett
portfolio.spec
, objective
,
rp_sample
, rp_simplex
,
rp_grid
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.