(this question addresses an expanded case of How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model?)
I am performing linear regression (using R) on data having both categorical (factor) and numeric variables, and fitting to a model having the form y ~ (.)^2 (i.e. including all first order and second-order interaction terms).
The question is: is there is a programmatic way of determining a coefficient vector among the set of optimal vectors $\Theta_{opt}$, where the length of the vector is minimized under the constraint that all elements of the vector are positive.
There may be cases where it is impossible to find an all-positive coefficient vector in $\Theta_{opt}$, but let's assume that the particular data which is being analyzed allows for such vectors to exist.
Perhaps one could start out with an initial (least-squares) optimal coefficient vector, and then manipulate this vector based on certain rules that depend on the nature of the terms which the coefficients are associated with. I can deduce some general rules for doing these manipulations, but don't know how to algorithmically perform the manipulations in a manner such that I arrive at a minimal-length parameter vector (parameters==0 don't count towards the vector's length). This may be heading the wrong direction though...?