Description Usage Arguments Value Examples
Calculates the in-sample variance of a portfolio
1 | portvar_calc(Sigma, weights)
|
Sigma |
a pxp covariance matrix of returns. |
weights |
a numeric vector, the portfolio weights. |
a double, the portfolio variance
1 2 3 4 5 | data(sp500_rets)
Sigma <- var(sp500_rets[,-1])
p <- dim(Sigma)[2]
weights <- rep(1/p, p)
portvar <- portvar_calc(Sigma, weights)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.