Description Usage Arguments Value Examples
Calculates the weights and the standard deviations along the Capital Market Line (CML).
1 | port_estim_cml(Sigma, mu, rf = 0, mugrid, res_all = FALSE)
|
Sigma |
a pxp covariance matrix of asset returns. |
mu |
a vector, the expected returns. |
rf |
a double, the assumed risk-free return. Default value is 0. |
mugrid |
a vector with length m as the grid of expected returns, along which the capital market line is to be estimated. |
res_all |
a logical. If TRUE, the result includes the calculated weights and the standard deviations for the CML. If FALSE, only the weights. Default value is FALSE. |
a pxm matrix with the weights of the CML portfolio along mugrid.
a vector of length m with the corresponding standard deviations.
1 2 3 4 5 6 | data(sp500_rets)
example_rets <- sp500_rets[,2:11]
covMat <- var(example_rets)
muVec <- colMeans(example_rets)
mugrid <- seq(0, 0.2, by=0.001)
results <- port_estim_cml(covMat, muVec, rf=0, mugrid, res_all=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.