Linear regression with convex combination of the parameters I am looking for a method to solve the following linear regression problem:
$$
y_i=\sum_{j=1}^Kx_{ij}\beta_j+\varepsilon_i
$$
with all $\beta_j\geq0$ and $\sum \beta_j=1$. I am familiar with implementing the last restriction (substitute one of the $\beta_j$'s and solve with OLS), but I wouldn't know how to include the first restriction of nonnegative betas. Any help is welcome, as are heuristic methods in case a closed form/global optimum is not generally available.

I'm sure there are more efficient methods to handle this problem but starting point could be to reparametrize it as
$$
y_i = \sum_{j}x_{ij}e^{\tau_j}.
$$
Having computed $\hat\tau_j$, the constrained estimates you are looking for are simply
$$\hat\beta_j = \log\tau_j.$$
To also handle the $\sum_j e^{\tau_j}=1$ constraint, the easiest way I can think of (from an implementation point of view) is to use the nloptr package of R.
See this link for some examples on how to use nloptr.
