backtest_universal_portfolio: Backtests the universal portfolio algorithm

Description Usage Arguments Details Value

View source: R/backtest_strategy.R

Description

Backtests using Cover's 1991 universal portfolio algorithm, estimated with samples of portfolios.

Usage

1
2
3
4
5
6
backtest_universal_portfolio(
  price_relative_matrix,
  transaction_rate,
  nsamples,
  consider_transaction_rate = TRUE
)

Arguments

price_relative_matrix

a matrix of price relatives, each row representing a trading period and each column an asset. A price relative is p_{t+1} / p_t, i.e. the ratio of trading price to next price. Prices change according to the price relatives after the trade, i.e. the price relatives for the trading period are not known at trading time

transaction_rate

The percentage of each transaction (buy and sell) spent on broker fees

nsamples

The number of portfolios to sample when estimating the universal portfolio

consider_transaction_rate

If FALSE, uses the original 1991 algorithm proposed by Cover, where the cumulative wealth produced by a constantly rebalanced portfolio (CRP) is computed without consider transaction costs. If TRUE, follows Blum & Kalai's 1991 paper and considers the transaction costs.

Details

See Cover's paper "Universal Portfolios" (1991, https://onlinelibrary.wiley.com/doi/epdf/10.1111/j.1467-9965.1991.tb00002.x ) for a description. We estimate the universal portfolio using a sampling estimation method mentioned in Blum & Kalai's 1999 paper "Universal Portfolios With and Without Transaction Costs" (https://link.springer.com/article/10.1023/A:1007530728748), but is basically just random sampling of portfolios, then the average weighted by the produced cumulative wealth up to this point. However, we use Dirichlet(1/2,1/2,...,1/2) priors for the portfolios because they may have better performance according to Cover & Ordentlich (1996)

initializes to uniform portfolio

Value

a matrix with the same number of columns and one more row than price_relative_matrix, row i is the portfolio after a trade during period i, i.e. right before the ith price relatives change the prices.


benSepanski/pfselect documentation built on May 1, 2020, 1:57 p.m.