Given $x_i,y_i,z_i \in \mathbb{R}$, I want to find $a_0, a_1, a_2$ that minimize the following
$$\sum_{i=1}^n(a_0\times\text{max}[a_1x_i-1,a_2y_i-1]-z_i)^2$$
Is this convex optimization problem and can it be solved efficiently using numerical methods?
Considering the gradient calculated as follows
$$ \nabla \max\left(a_0a_1x_k-a_0-z_k,a_0a_2y_k-a_0-z_k\right)=\left( \begin{array}{l} \begin{array}{cc} \left\{ \begin{array}{cc} a_1 x_k-1 & a_0 a_1 x_k-a_0 a_2 y_k\geq 0 \\ a_2 y_k-1 & \text{else} \\ \end{array}\right. \\ \end{array} \\ \begin{array}{cc} \left\{ \begin{array}{cc} a_0 x_k & a_0 a_1 x_k-a_0 a_2 y_k\geq 0 \\ 0 & \text{else} \\ \end{array} \right. \\ \end{array} \\ \begin{array}{cc} \left\{ \begin{array}{cc} 0 & a_0 a_1 x_k-a_0 a_2 y_k\geq 0 \\ a_0 y_k & \text{else} \\ \end{array} \right. \\ \end{array} \\ \end{array} \right) $$ the minimization problem can be handled successfully with an algorithm as basic as the steepest descent, when considering $\rho > 0$ small enough we proceed with a sequence
$$ A_k = A_{k-1}-\rho_k\nabla f(A_{k-1}) $$
with $A_k = (a_0^k, a_1^k, a_2^k)$
Follows a very basic MATHEMATICA script which tackles that.