get_wealth: Get portfolio wealth

Description Usage Arguments Value Examples

Description

calculates the achieved cumulative wealth of a steadily rebalanced portfolio

Usage

1
get_wealth(returns, weights)

Arguments

returns

Matrix of price relatives, i.e. the ratio of the closing (opening) price today and the day before (use function get_price_relatives to calculate from asset prices).

weights

vector or matrix containing portfolio weights.

Value

vector of the portfolio's cumulative wealth

Examples

1
2
3
4
5
6
7
8
# load data
data(NYSE)
# select stocks
x = cbind(comme=NYSE$comme, kinar=NYSE$kinar)
# specify portfolio weights
b = c(0.05, 0.05)
# calculate wealth
W = get_wealth(x, b); W

ngloe/olpsR documentation built on May 23, 2019, 4:42 p.m.