# Minimization of objective function with three terms?

Hi,

I would like to optimize an objective function with thee terms, including Least square error, Total Variation(TV) and a function like exp(x/sigma). Something like appears here with an additional term as alph*exp(x/sigma)

Could you please tell me which algorithm should I use? Is there any builtin function in MATLAB to do this? May I use CVX tool for this? If yes, How?

(Mark L. Stone) #2

You need to provide us the details of your optimization problem formulation. If there are three additive terms in the objective function, each of which are representable in CVX, then the sum of these terms will also be representable in CVX.

The link you provided shows how to formulate the problem in that link in CVX. As for your additional term, `alph*exp(x/sigma)`, you need to tell us which of `alph`, `x,` and `sigma` are optimization (decision) variables, and which are input data. If `x` is the only optimization variable among these three, you can enter that term in CVX exactly as you have written it.

The first thing you must do is show that your optimization problem is convex. Please read Why isn't CVX accepting my model? READ THIS FIRST! and http://cvxr.com/cvx/doc/ .

Thanks Mark. yes x is my optimization variable. I don’t know how to write my math equation in pretty shape, but what I’m going to do is something like Eq(3) described here or here ( Sparse MRI: The application of compressed sensing for rapid MR imaging, M.Lustig 2007) but I want to use alph*(1-exp(Phi*m/sigma)) instead of L1 norm (here m is optimization variable).

(Mark L. Stone) #4
``````cvx_begin
variable m
% whatever else
minimize(1st_term + 2nd_term + alph*(1-exp(Phi*m/sigma)))
% insert any constraints
cvx_end``````

Thanks Mark,
The last term is not convex, it is concave. So, I need to use exp(Phi*m/sigma) instead and maximize the last term while minimizing first two terms. How may I do that in cvx?

(Mark L. Stone) #6

I got confused when you changed from `alph*exp(x/sigma)` in your initial post to `alph*(1-exp(Phi*m/sigma)))` in your later post, and I mindlessly copy and pasted the latter which is concave, while thinking of the former, which is convex.

I am confused as to what problem you are really trying to solve. You keep switching between `alph*exp(x/sigma)` and `alph*(1-exp(Phi*m/sigma)))`. You are not allowed to maximize a convex objective function (unless it is also convex, i.e., affine) in CVX. You either need all 3 terms to separately be convex, or if two of the terms are convex and one is concave, but their sum is convex, reformulate such that there are no concave additive terms.

So if you want
minimize`(1st_term + 2nd_term + alph*(1-exp(Phi*m/sigma)))`
the only way to do so in CVX is if `1st_term + 2nd_term - exp(Phi*m/sigma))` is convex, in which case you will have to find a reformulation which does not have a concave additive term. Note that I ignored the `+alph` term because it is a constant, so does not affect the argmin.