This function is for backtesting portfolios given return predictions

backtesting_portfolios(
  return_prediction_object,
  portfolio_object = NULL,
  pf_config,
  append = FALSE
)

Arguments

return_prediction_object

a returnPrediction S3 object

portfolio_object

a portfolio S3 object

pf_config

a list of configurations for the portfolio

append

boolean, whether to append the portfolio to the portfolio object

Value

a portfolio object suitable for furtehr processing with summary or plot

Examples

if (FALSE) {
pf_config <- list(predictions = c("ols_1","xgb_1","xgb_2"),
                 quantile_weight = list(pred_func="quantile_weights",
                 config1=list(quantiles = list(long = 0.20, short = 0.20),allow_short_sale = TRUE,
                 min_weight = -1,  max_weight = 1, b = 1),
                 config2=list(quantiles = list(long = 0.10, short = 0.10),allow_short_sale = TRUE,
                 min_weight = -1,  max_weight = 1, b = 1)))
}