svm negative(positive) semidefinite matrix in Rmosek

svm negative(positive) semidefinite matrix in Rmosek



I tried to set up the svm by using Rmosek package, and I got a problem about



using Rmosek.


## SET UP THE "negative semidefinite matrix"
## K is the kernel
## m=nrow(X)
qy1=t(matrix(Y,m,m))
qy2=matrix(Y,m,m)
Q=qy1*qy2*K*-1



At this stage, I have already checked that Q is the negative



semidefinite matrix.


## qobj i
funi=function(a,m)
op=a:m
return(op)


mi=mapply(funi, a=1:m,m=m)
i=as.numeric(unlist(mi[1:m]))
j=rep(1:m,m:1)

library(MCMCpack)
v=vech(Q)

ql$qobj=list(i=i,
j=j,
v=v)

r =mosek(ql,list( soldetail = 1 ))



However, "sometimes" I still get the error : **"The quadratic coefficient matrix



in the objective is not negative semidefinite"**


Optimizer started.
Quadratic to conic reformulation started.
MOSEK error 1296: The quadratic coefficient matrix in the objective is not negative semidefinite as expected for a maximization problem.
Quadratic to conic reformulation terminated. Time: 0.00
Optimizer terminated. Time: 0.00

Optimization interrupted.
ERROR: MSK_RES_ERR_OBJ_Q_NOT_NSD: The quadratic coefficient matrix in the objective is not NSD.



I don't know which part I am missing or doing wrong.
(I have already checked it so many time, and I am still no idea.)






I would dump the problem to an opf file and check if the quadratic terms are really as you expect them (instructions on Mosek website). And then see if your matrix perhaps has a positive or almost positive eigenvalue after all. Especially if it happens only sometimes.

– Michal Adamaszek
Sep 14 '18 at 11:59





0



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế