Description Usage Arguments Value Author(s)
This function uses a block of code from
randomize_portfolio
to transform the weight
vector if either the weight_sum (leverage) constraints,
box constraints, group constraints, or position_limit
constraints are violated. The resulting weights vector
might be quite different from the original weights
vector.
1 2 3 4 |
w |
weights vector to be transformed |
min_sum |
minimum sum of all asset weights, default 0.99 |
max_sum |
maximum sum of all asset weights, default 1.01 |
min |
numeric or named vector specifying minimum weight box constraints |
max |
numeric or named vector specifying maximum weight box constraints |
groups |
vector specifying the groups of the assets |
cLO |
numeric or vector specifying minimum weight group constraints |
cUP |
numeric or vector specifying minimum weight group constraints |
max_pos |
maximum assets with non-zero weights |
group_pos |
vector specifying maximum number assets with non-zero weights per group |
max_pos_long |
maximum number of assets with long (i.e. buy) positions |
max_pos_short |
maximum number of assets with short (i.e. sell) positions |
max_permutations |
integer: maximum number of iterations to try for a valid portfolio, default 200 |
named weighting vector
Peter Carl, Brian G. Peterson, Ross Bennett (based on an idea by Pat Burns)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.