backtest_online_newton_step: Backtests using an online newton step method

Description Usage Arguments Details Value

View source: R/backtest_strategy.R

Description

Backtests using an online newton step method for portfolio selection.

Usage

1
backtest_online_newton_step(price_relative_matrix, transaction_rate)

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

Details

This is implements the Online Newton Step (https://www.researchgate.net/publication/221346006_Algorithms_for_portfolio_management_based_on_the_Newton_method) from Agarwal, Hazan, Kale, & Schapire's 2006 paper "Algorithms for portfolio management based on the Newton method". Each step solves a small linear set of equation then projects to the unit simplex in a matrix norm (estimated using projected gradient descent).

According to the paper, we set η=0, β=1, and δ=1/8

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.