constant_weights {AssetAllocation}R Documentation

Returns constant weights for static asset allocations

Description

constant_weights applies the identity function to the default weights in a strategy.

Usage

constant_weights(strat, reb_date = NULL, P, R, risk_free)

Arguments

strat

A list representing an asset allocation strategy.

reb_date

A date on which the allocation rule is applied.

P

An xts object with daily prices of the tickers in strat.

R

An xts object with daily returns of the tickers in strat.

risk_free

Either an xts object with daily returns of the risk-free asset, or a scalar numeric with the annual risk-free rate in decimals.

Value

A numeric vector of weights after applying the rule.

Examples

us_60_40  <- asset_allocations$static$us_60_40
reb_date <- as.Date("2022-03-31")
constant_weights(us_60_40,
                 reb_date,
                 ETFs$Prices[, us_60_40$tickers],
                 ETFs$Returns[, us_60_40$tickers],
                 ETFs$risk_free)

[Package AssetAllocation version 1.1.1 Index]