ES function gives the below error. > ES(sim, p=.95, method=c("modified"),portfolio_method=c("component"), > weights=w1)
/Error in checkData(R, method = "xts", ...) : The data cannot be converted into a time series. If you are trying to pass in names from a data object with one column, you should use the form 'data[rows, columns, drop = FALSE]'. Rownames should have standard date formats, such as '1985-03-15'. / The problem, I believe, is when the function comes to building a time-series of portfolio returns when multiplying matrix 'sim' with vector 'w1'. I think vector 'w1' may be posing the problem, but I do not know why. *********************** Notes: sim is a 1000*4 matrix w1 is 4*1 column vector ********************** As always, any pointers or expertise will be forever great-fully received!!! kevj -- View this message in context: http://r.789695.n4.nabble.com/Error-with-Expected-Shortfall-function-ES-tp4656500.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.