Dear Group, I have a large set of stocks and want to determine the efficient frontier. The data set covers approx. 1.5 years and S&P 500 companies (nothing weird). portfolio.optim from the PerformanceAnalytics package works very well and fast. However, whenever I decrease the number of stocks in the portfolio (to 10 or 400), I receive an error message:
"solve.QP(Dmat, dvec, Amat, bvec = b0, meq = 2) : matrix D in quadratic function is not positive definite!" My command settings for portfolio.optim were: seed <- portfolio.optim(t(x), pm = current_er, riskless = FALSE, shorts = FALSE, rf = 0.0) Even when I tried it with shorts = TRUE the error would still remain. x is the set of stocks (stocks in columns, time in rows), current_er is the target return (lies between the minimal mean and the maximum mean of a long only portfolio). I can not post the stock data here - so maybe you have some general suggestions for me of what could have gone wrong... The covariance matrix is positive definite. What could cause the problem? It works fine with the large data set but does not work at all with the small one... Thanks a lot for your suggestions! Lui _______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
