I want to build a logistic regression model on my data, which contains three continuous predictors and a logical response. I need to constrain the regression coefficients to be not less than 0 and sum up to a constant, i.e.,
$$y=\frac {1}{1+e^{-(\beta_1\times x_1+\beta_2 \times x_2+\beta_3 \times x_3)}}$$
$$s.t. \beta_j \geq 0(j=1,2,3)$$
$$ \beta_1+\beta_2+\beta_3=1$$
Is there anyone who knows how to add such constraint in theory? And how can this be done in MATLAB? The following is my test code using the function 'glmfit' which did not have an option to introduce a constraint:
load hospital.mat
dsa = hospital;
Age = dsa.Age;
Weight = dsa.Weight;
Blood = dsa.BloodPressure(:, 1);
Smoker = dsa.Smoker;
mdl = fitglm([Age, Weight, Blood], Smoker, 'Distribution', 'binomial', 'Intercept', false)