[R] solve.QP

2010-06-22 Thread Barbara . Rogo
Why sometimes I have error??? In this code I use solve.QP, and I have error sometimes and other times no. Why? Thanks... matr.dati=cbind(c(0.035,0.065,0.040,0.130,0.120,0.140,0.100,0.090),c(0.0750,0.2150,0.0550,0.2280,0.1858,0.2450,0.1555,0.1650)) 0.040 0.0550 0.130 0.2280 0.1

Re: [R] solve.QP with box and equality constraints

2009-02-16 Thread Selwyn McCracken
;= 1 iff -x >= -1 > >> solve.QP(Dmat = XX,dvec=Xy,Amat = a2,bvec=b2,meq=2) #complains that >> Amat and dvec are incompatible > > The constraints of the QP are A^T b >= b0 and b0 is passed to b2 while > A is passed to Amat. Your matrix a2 contains A^T, so you have

Re: [R] solve.QP with box and equality constraints

2009-02-16 Thread Berwin A Turlach
= a2,bvec=b2,meq=2) #complains that > Amat and dvec are incompatible The constraints of the QP are A^T b >= b0 and b0 is passed to b2 while A is passed to Amat. Your matrix a2 contains A^T, so you have to pass t(a2) to solve.QP: R> solve.QP(Dmat = XX,dvec=Xy,Amat = t(a2),bvec=b2,me

[R] solve.QP with box and equality constraints

2009-02-16 Thread Selwyn McCracken
[reposting as a plain text - apologies for the double posting] Dear list, I am trying to follow an example that estimates a 2x2 markov transition matrix across several periods from aggregate data using restricted least squares. I seem to be making headway using solve.QP(quadprog) as the unrestri

[R] solve.QP with box and equality constraints

2009-02-16 Thread Selwyn McCracken
Dear list, I am trying to follow an example that estimates a 2x2 markov transition matrix across several periods from aggregate data using restricted least squares. I seem to be making headway using solve.QP(quadprog) as the unrestricted solution matches the example I am following, and I can spec

[R] solve.QP() error

2008-05-08 Thread Megh Dal
I got following error while I was using solve.QP() in my problem: > Dmat = matrix(c(0.0001741, 0.0001280, 0.0001280, 0.0002570), nrow=2) > dvec = t(c(0,0)) > Amat = matrix(c(-1,1,0,-1,0, 1,0,1,0,-1), nrow=5) > bvec = c(-2, 1, 1, -5, -5) > solve.QP(Dmat,dvec,Amat,bvec=bvec) Error i