port_estim_cml: Estimation of the Capital Market Line

Description Usage Arguments Value Examples

View source: R/port-optim.R

Description

Calculates the weights and the standard deviations along the Capital Market Line (CML).

Usage

1
port_estim_cml(Sigma, mu, rf = 0, mugrid, res_all = FALSE)

Arguments

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.

Value

a pxm matrix with the weights of the CML portfolio along mugrid.

a vector of length m with the corresponding standard deviations.

Examples

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)

antshi/auxPort documentation built on Oct. 27, 2020, 1:16 p.m.