R/backtesting_portfolios.R
backtesting_portfolios.Rd
This function is for backtesting portfolios given return predictions
backtesting_portfolios(
return_prediction_object,
portfolio_object = NULL,
pf_config,
append = FALSE
)
a returnPrediction S3 object
a portfolio S3 object
a list of configurations for the portfolio
boolean, whether to append the portfolio to the portfolio object
a portfolio object suitable for furtehr processing with summary or plot
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)))
}