# Mark

less info
reputation
4
bio website location age member for 2 years, 9 months seen Apr 18 '12 at 16:10 profile views 5

# 29 Actions

 Apr18 comment How can all-positive coefficients be chosen in 2nd order linear regression to minimize the number of coefficients? @whuber: based on what you wrote, it seams likely that it is a linear programming problem -- do you have suggestions on resources (e.g. links, articles) which address this particular kind of problem with linear programming? (also doing this kind of thing in R?) Apr12 comment How can all-positive coefficients be chosen in 2nd order linear regression to minimize the number of coefficients? On second thought, if you have terms for all levels of the factors specified in the model formula, there really isn't a difference in the terms of one solution to the next -- so, I guess thinking of it as a fixed-length vector (which may contain zeroes) is fine after all. Apr12 comment How can all-positive coefficients be chosen in 2nd order linear regression to minimize the number of coefficients? Also, note that specifying the model formula is not the same as specifying its specific terms. I guess this is a bit confusing with my notation, since $\Theta_{opt}$ may lead one to believe that all of the vectors it contains have elements corresponding to the same terms. The terms may be freely changed (under the constraint of maintaining OLS optimality), and this is what affects the length of vectors in $\Theta_{opt}$. So, technically, one could think of $\Theta_{opt}$ not as a set of vectors, but as a set of (terms,coeffs) pairs. Apr12 comment How can all-positive coefficients be chosen in 2nd order linear regression to minimize the number of coefficients? @whuber, I'll try to clarify: assume that we have a given dataset and model formula (i.e. what factors / variables / interactions should be in the model). If we perform unconstrained OLS linear regression using this data and formula, we will get a non-unique vector of coefficients $\theta_0$ which minimize the RSS. $\theta_0$ is one of possibly several vectors in $\Theta_{opt}$. All vectors in $\Theta_{opt}$ share the property that they minimize the RSS (all with the same minimal value). Does that make sense? There may be a $\theta_1 \in \Theta_{opt}$ with fewer negatives than $\theta_0$. Apr12 comment How can all-positive coefficients be chosen in 2nd order linear regression to minimize the number of coefficients? @guest: statistics isn't the only purpose of regression -- it is often used for modelling systems from data. In these cases, one might have prior knowledge about the factors being used in the model, and desire to shape the model's form in such a way to improve human-interpretability of the model. For example, if I have a factor with 5 levels, and I know that only one of those levels causes an increase in the regressand variable, I would prefer a model form where that 1 level has a positive coefficient, instead of the 4 other levels having negative coefficients. Apr12 awarded Commentator Apr12 comment How can all-positive coefficients be chosen in 2nd order linear regression to minimize the number of coefficients? @whuber: $\Theta_{opt}$ is a set of vectors, not a single vector. If a vector belongs to this set, it must provide a least-squares optimal solution (i.e. minimizes the squared residual sum). An all-zero vector would fail to minimize this sum. Apr10 asked How can all-positive coefficients be chosen in 2nd order linear regression to minimize the number of coefficients? Jan23 revised How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? replace the incorrect use of "zero-order" with "first-order". Jan23 revised How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? rephrase to remove incorrect/unclear use of "zero-order" in a comment Jan23 comment How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? I should have called it a model containing second-order interaction terms. I mean a linear model whose terms include each level of each factor, as well as each pairwise combination of levels between differing factors. Jan19 comment How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? @whuber, maybe it warrants a different question, but do you have ideas on how one might approach this with a first-order model? Jan19 revised How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? updated function, fixing a grep-related bug, and handling NA coefficients Jan18 awarded Teacher Jan18 comment How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? see my answer below, and how I use the all_levels vector. Jan18 answered How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? Jan18 comment How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? Another issue I noticed with your example is that it only considers the non-base levels, since it derives the list of levels from names(coef(helpreg)), and helpreg doesn't include the base levels. Jan18 comment How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? This seems to work well for data having a single categorical variable (except in the case of identical minimum coefficients) -- will this extend to cases where there are more than one categorical variable, by just releveling one variable at a time? Jan17 asked How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model? Jun15 comment Is there a covariance MLE which takes into account independence relationships? @whuber I updated the question to be a bit more explicit. It would be helpful to me if you (or anyone) could elaborate in an answer, explaining for the example I mention at the end of the question, how one would derive and write the covariance or precision-matrix MLE (also, is there an incremental form?).