Learn R Programming

DOSPortfolio (version 0.1.0)

wGMV: Sample estimator of the weights of the global minimum variance portfolio

Description

The functions computes the sample estimate of the weights of the global minimum variance portfolio (see, e.g., Eq. (1.4) of BODNAR21dynshrink;textualDOSPortfolio)).

Usage

wGMV(data)

Arguments

data

an n by p matrix of asset returns. Columns represent different assets rows are observations, where n>p, containing, for instance, log-returns.

Value

a vector, which is the Global Minimum Variance Portfolio.

Examples

Run this code
# NOT RUN {
n <- 200
p <- 80
data <- 3/5 * matrix(rt(n*p, df=5), ncol=p, nrow=n)
weights <- wGMV(data)
# since the covariance matrix is the identity-matrix the estimated weights
# should be close to the equally weighted portfolio.
mean(abs(wGMV(data) - 1/p))

# }

Run the code above in your browser using DataLab