opt.outputMeanVolWts: opt.outputMeanVolWts

View source: R/opt.outputMvoWts.R

opt.outputMeanVolWtsR Documentation

opt.outputMeanVolWts

Usage

opt.outputMeanVolWts(opt, returns, digits = NULL, names = NULL)

Arguments

opt \item

returns

\item

digits

\item

names

##—- 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


kecoli/PCRM documentation built on May 7, 2022, 9:33 a.m.