# Whoops! I have just seen there's a little mistake # in the 'sharpe' function, because I had to use # 'w' array instead of 'ead' in the cm.CVaR function! # This does not change the main features of my, # but you should be aware of it
--- # The function to be minimized sharpe <- function(w) { - (t(w) %*% y) / cm.CVaR(M, lgd, ead, N, n, r, rho, alpha, rating) } # This becomes... sharpe <- function(w) { - (t(w) %*% y) / cm.CVaR(M, lgd, w, N, n, r, rho, alpha, rating) } # ...substituting 'ead' with 'w'. -- View this message in context: http://r.789695.n4.nabble.com/The-best-solver-for-non-smooth-functions-tp4636934p4636936.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.