简体   繁体   中英

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_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.

An example of use of this R package is:

# 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. Eg use quadprog .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM