[英]Convex optimization in R with sqlp function
With the following convex problem: 有以下凸问题:
minimize ∥Ax−b∥2
subject to l⪯x⪯u
It could be done in matlab with CVX, with SDPT3 solver: 可以使用CVX和SDPT3解算器在matlab中完成:
cvx_begin
variable x(n)
minimize( norm(A*x-b) )
subject to
l <= x <= u
cvx_end
In this way, R has a sdpt3r
package as well, but i dont know how could it be done to translate this problem with this package. 这样,R也有一个
sdpt3r
程序包,但是我不知道如何用此程序包转换此问题。
An example of use of this R package is: 使用此R包的示例是:
# NOT RUN {
#Solve the MaxCut problem using the built in adjacency matrix B
data(Bmaxcut)
out <- maxcut(Bmaxcut)
blk <- out$blk
At <- out$At
C <- out$C
b <- out$b
out <- sqlp(blk,At,C,b)
#Alternatiee Input Method (Not Run)
#out <- sqlp(sqlp_obj=out)
# }
Anyone knows how could be done? 有人知道该怎么做吗?
Using 使用
min y'y
y = Ax-b
L <= x <= U
this is just a QP. 这只是一个QP。 Eg use
quadprog
. 例如使用
quadprog
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.