The optimization problem looks like this now:
$minimize\;\frac{1}{N}\sum_{s=1}^N max\{L-Br_s^Tx,0\}$
$s.t.\;\sum_i x_i=1$
$x\ge0$
Is it ok to put the max part inside the objective function? If not, how should I correct it?
The optimization problem looks like this now:
$minimize\;\frac{1}{N}\sum_{s=1}^N max\{L-Br_s^Tx,0\}$
$s.t.\;\sum_i x_i=1$
$x\ge0$
Is it ok to put the max part inside the objective function? If not, how should I correct it?
Since each $\max(L - Br_s^Tx, 0)$ is not differentiable, we can add an extra variable $t_s$ equal to $\max(L - Br_s^Tx, 0)$:
$\min \frac{1}{N}\sum t_s$
s.t. $\sum x_i = 1$
$x \geq 0$
$L - Br_s^Tx \leq t_s$, $\forall r_s$
$0 \leq t_s$, $\forall r_s$
To make your problem differentiable, you can replace this kind of problem
$\min \max(a, b)$
with the smooth reformulation:
$\min t$
s.t.
$a \leq t$
$b \leq t$