min_variance | R Documentation |
min_variance
determines asset allocations that minimize the variance
of aportfolio.
min_variance(strat, reb_date, P, R, risk_free = NULL)
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. |
The function calculates the covariance matrix of returns using the last two
years (or minimum of one year) of daily returns. It relies on the
minvar
function from the NMOF
package.
A numeric vector of weights after applying the rule.
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])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.