View source: R/opt.outputMvoWts.R
opt.outputMeanVolWts | R Documentation |
opt.outputMeanVolWts(opt, returns, digits = NULL, names = NULL)
opt |
\item returns \itemdigits \itemnames ##—- Should be DIRECTLY executable !! —- ##– ==> Define data, use random, ##– or do help(data=index) for the standard data sets. ## The function is currently defined as function (opt, returns, digits = NULL, names = NULL) wts = opt$weights sigmasq = as.numeric(t(wts) %*% var(returns) %*% wts) sigma = sqrt(sigmasq) mu.ret = apply(returns, 2, mean) mu = as.numeric(t(wts) %*% mu.ret) if (is.null(digits)) output = wts else if (is.null(names)) output = list(wts = wts) output = lapply(output, round, digits) else output = list(wts = wts) names(output) = names output = lapply(output, round, digits) output ~kwd1 ~kwd2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.