Re: [R-SIG-Finance] Failure of solve.QP in portfolio modeling

2015-09-22 Thread Patrick Burns
One correction and another comment. I should have said that a trade optimizer not caring about positive definiteness is usually a bad thing -- it has its uses but giving the optimizer a shot at a portfolio with negative variance is asking for trouble (because it will do its best to get there).

Re: [R-SIG-Finance] Failure of solve.QP in portfolio modeling

2015-09-22 Thread Patrick Burns
You can use a factor model or shrinkage to get a positive definite variance matrix. There is a function for each in the BurStFin package on CRAN. The optimizer in Portfolio Probe doesn't care about positive definiteness (though that is not always a good thing). It is free for academic use. Pat

[R-SIG-Finance] Failure of solve.QP in portfolio modeling

2015-09-22 Thread aschmid1
Hi everyone, I'm trying to estimate optimal Markowitz portfolio weights for a list of stocks chosen upon some criterion using solve.QP from quadprog library. When the number of stocks N reaches some limit, I get a message "matrix D in quadratic function is not positive definite." For example,

Re: [R-SIG-Finance] Failure of solve.QP in portfolio modeling

2015-09-22 Thread Ilya Kipnis
Because you can't invert a matrix with more features than observations. IE if you have 50 stocks but only use 26 weekly return data points, you can't invert that covariance matrix because it's not positive semi-definite. You may want to try my Constrained Critical Line algorithm.

Re: [R-SIG-Finance] Failure of solve.QP in portfolio modeling

2015-09-22 Thread Enrico Schumann
On Tue, 22 Sep 2015, aschmid1 writes: > Hi everyone, > I'm trying to estimate optimal Markowitz portfolio weights for a list > of stocks chosen upon some criterion using solve.QP from quadprog > library. When the number of stocks N reaches some limit, I get a > message