[R] Help with factorized argument in solve.QP
Philipp Graf
p.graf at consolinno.de
Thu Feb 15 16:21:38 CET 2018
Hello David,
same problem here with solve.QP.
dykstra is causing problems as well and giving for the value NA if
factorized = TRUE:
library(quadprog)
library(Dykstra)
R<-cbind(c(1,1),c(0,1));
d<-c(t(R)%*%R%*%c(2,1))
solve.QP(solve(R),d,-as.matrix(c(1,1)),-2,1,factorized = TRUE)
S<-t(R)%*%R;
solve.QP(S,d,-as.matrix(c(1,1)),-2,1)
dykstra(solve(R),d,-as.matrix(c(1,1)),-2,1,factorized = TRUE)
dykstra(S,d,-as.matrix(c(1,1)),-2,1)
Nevertheless, factorized = TRUE yields false results, see
solve.QP(t(R)%*%R,rep(0,2),diag(2),rep(2,2))
solve.QP(solve(R),rep(0,2),diag(2),rep(2,2),factorized = TRUE)
where you see that the first is correct and agrees with
dykstra(t(R)%*%R,rep(0,2),diag(2),rep(2,2))
Best regards
Philipp
[[alternative HTML version deleted]]
More information about the R-help
mailing list