All functions

add_model_prediction()

Add model prediction to returnPrediction S3 object

add_weight_model()

Add a new weight model to the portfolioReturns S3 object

backtesting_portfolios()

This function is for backtesting portfolios given return predictions

backtesting_returns()

This function is used to use ML to predict the returns that will later be used for a trading strategy

calculate_errors()

Calculate errors between predictions and actual returns

convert_period_to_days()

Helper function to convert any time period to days

create_portfolios()

Create portfolioReturns S3 object

create_return_prediction()

Create returnPrediction S3 object

ensemble_weights()

Create weights based on various predictions, potentially using their errors with given constraints

find_largest_number()

Helper function to find largest number after a certain string

ols_pred()

ols function for return prediction

perf_met()

Helper function to create performance metrics for a given set of returns, weights, and actual data

plot(<portfolioReturns>)

Plotting method for portfolioReturns S3 objects

quantile_weights()

Create weights based on predictions with given constraints

retpred_map()

Return Prediction Mapping Function (Helper)

select_dates_by_offset()

Helper function to create a tibble of training/prediction start and end dates based on a rolling window with an offset

summary(<portfolioReturns>)

Define the summary method for 'portfolioReturns' class

summary(<returnPrediction>)

Summary method for returnPrediction S3 object

xgb_pred()

xgb function for return prediction