backtestSummary {portfolioBacktest} | R Documentation |
Summary of portfolio backtest
Description
Summarize the results from a portfolio backtest.
Usage
backtestSummary(
bt,
portfolio_indexes = NA,
portfolio_names = NA,
summary_fun = median,
show_benchmark = TRUE
)
Arguments
bt |
Backtest results as produced by the function |
portfolio_indexes |
Numerical vector of portfolio indexes whose performance will be summarized,
e.g., |
portfolio_names |
String vector of portfolio names whose performance will be summarized,
e.g., |
summary_fun |
Summary function to be employed (e.g., |
show_benchmark |
Logical value indicating whether to include benchmarks in the summary (default is |
Value
List with the following elements:
performance_summary |
Performance criteria:
|
error_message |
Error messages generated by each portfolio function over each dataset. Useful for debugging purposes. |
Author(s)
Rui Zhou and Daniel P. Palomar
Examples
library(portfolioBacktest)
data(dataset10) # load dataset
# define your own portfolio function
EWP_portfolio <- function(dataset, ...) {
N <- ncol(dataset$adjusted)
return(rep(1/N, N))
}
# do backtest
bt <- portfolioBacktest(list("EWP" = EWP_portfolio), dataset10)
# show the summary
bt_sum <- backtestSummary(bt)
names(bt_sum)
bt_sum$performance_summary