Fitting piecewise linear function

#1

Hi,

I have some data which needs to fit the convex piecewise linear function
max_i(a*v_i+b*s_i)

I want to determine the values of a and b from the fit. Is there a function in cvx that can do the fitting or do I have to write the iterative algorithm myself? Also, are there examples for convex piecewise linear fitting in the software package that I could look at?

Thanks
Aparna

Interpolation error
(Michael C. Grant) #2

You could take a look at this code:

http://web.cvxr.com/cvx/examples/cvxbook/Ch06_approx_fitting/html/convex_interpolation.html

But no, CVX cannot do this for you.

#3

Thanks for the help.

(zhangQK) #4

Hi, Michael C. Grant.
Now I have some three-dimensional data points such as (x,y,z),Could you please tell me how to fit these data points to a convex function such as z=f(x,y)?Or could please give a example?
Thank you very much.

(zhangQK) #5

In addition,The result that is obtained by the way of (http://web.cvxr.com/cvx/examples/cvxbook/Ch06_approx_fitting/html/convex_interpolation.html) seemly can not use in cvx when the variable is a vector.