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, position_limit constraints,
or leverage exposure constraints are violated. The logic from
`randomize_portfolio`

is heavily utilized here with extensions to
handle more complex constraints.
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_box` |
numeric or named vector specifying minimum weight box constraints |

`max_box` |
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 |

`leverage` |
maximum leverage exposure where leverage is defined as |

`weight_seq` |
vector of seed sequence of weights |

`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)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.