findMu {CLA} | R Documentation |
Find mu(W) and W, given sigma(W) and CLA result
Description
Find \mu(W)
and W
, given \sigma(W
) and
CLA
result.
Usage
findMu(Sig0, result, covar, tol.unir = 1e-06, equal.tol = 1e-06)
Arguments
Sig0 |
numeric vector of |
result |
a |
covar |
the same |
tol.unir |
numeric tolerance passed to |
equal.tol |
numeric tolerance to be used in
|
Value
a list
with components
Mu |
numeric vector of same length, say |
weight |
numeric |
References
Master thesis, p.33
See Also
Examples
data(muS.sp500)
## Full data taking too much time for example
if(getRversion() >= "3.6") .Rk <- RNGversion("3.5.0") # for back compatibility & warning
set.seed(2016)
iS <- sample.int(length(muS.sp500$mu), 17)
if(getRversion() >= "3.6") do.call(RNGkind, as.list(.Rk)) # revert
cov17 <- muS.sp500$covar[iS, iS]
CLsp.17 <- CLA(muS.sp500$mu[iS], covar=cov17, lB=0, uB = 1/2)
CLsp.17 # 16 turning points
summary(tpS <- CLsp.17$MS_weights[,"Sig"])
str(s0 <- seq(0.0186, 0.0477, by = 0.0001))
mu.. <- findMu(s0, result=CLsp.17, covar=cov17)
str(mu..)
stopifnot(dim(mu..$weight) == c(17, length(s0)))
plot(s0, mu..$Mu, xlab=quote(sigma), ylab = quote(mu),
type = "o", cex = 1/4)
points(CLsp.17$MS_weights, col = "tomato", cex = 1.5)
[Package CLA version 0.96-3 Index]