R/weight_functions.R
quantile_weights.Rd
Create weights based on predictions with given constraints
quantile_weights(return_predictions, errors, constraints = NULL)
tibble of stock_id, date, and various predictions
tibble of stock_id, date, and various errors
list of constraints for the weights. possible values are:
quantiles: list with long and short quantiles (default: median portfolios)
allow_short_sale: logical, if TRUE, allow short sales (default: FALSE)
max_weight: numeric, maximum weight for a single stock (default: 0.1)
min_weight: numeric, minimum weight for a single stock (default: -0.1)
b: numeric, in case of allow_short_sale=TRUE this is the max weight sum in both legs, in case of allow_short_sale=FALSE this is the max weight sum in long leg
tibble with stock_id, date, and weight