I’d like to penalize negative values for a linear function of parameters without using an
@constraint (since I’d like it to be possible, but costly to violate the constraint)
Is there a way to do this within JuMP w/o defining a custom function?
My model is something like the following:
@variables m begin coeff_0 coeffs_X[j = 1:P] end @NLexpression( m, B[i = 1:N], coeff_0 + sum( X[i, j] * coeffs_X[j] for j = 1:P) ) @NLobjective( m, Min, sum( (y[i] - B[i]) for i = 1:N )^2 )
And I’d like to penalize
B[i] being negative.