Learn R Programming

AssetAllocation (version 1.1.1)

risk_parity: Returns risk parity weights on a given date

Description

risk_parity determines asset allocations using a risk parity rule. It obtains the weights such that all assets provide the same risk contribution to the risk of the portfolio.

Usage

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

Value

A numeric vector of weights after applying the rule.

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.

Details

The function calculates the covariance matrix of returns using the last two years (or minimum of one year) of daily returns.

Examples

Run this code
ivy  <- asset_allocations$tactical$ivy
reb_date <- as.Date("2022-03-31")
risk_parity(ivy, reb_date, ETFs$Prices[, ivy$tickers], ETFs$Returns[, ivy$tickers])

Run the code above in your browser using DataLab