Harald Bartel
2003-Sep-26 10:06 UTC
[R] least squares regression using (inequality) restrictions
Dear R Users, I would like to make a lesast squares regression similar to that what is done by the command "lm". But additionally, I would like to impose some restrictions: 1) The sum of all regression coefficients should be equal to 1. 2) Each coefficient should assume a value between 0 and 1. (inequality restrictions) Which command is the best to use in order to solve this problem in a computationally efficient way? Thank you in advance for your help, Harald Bartel -- ------------------------------------------------------ PROZENTOR GmbH Financial Content Provider Bergstr. 67 10115 Berlin Fon: +49 (0) 30 28 44 59-42 Fax: +49 (0) 30 28 44 59-59 email: harald.bartel at prozentor.de PROZENTOR GmbH: http://www.prozentor.de kostenlose Aktienprognosen: http://www.happyYuppie.com
Simon Wood
2003-Sep-26 10:51 UTC
[R] least squares regression using (inequality) restrictions
> I would like to make a lesast squares regression similar to that whatis> done by the command "lm". But additionally, I would like to impose some > restrictions: > 1) The sum of all regression coefficients should be equal to 1. > 2) Each coefficient should assume a value between 0 and 1. (inequality > restrictions) > > Which command is the best to use in order to solve this problem in a > computationally efficient way?- I don't know if it's the best way, but pcls() in package mgcv will do this for you. It solves penalized least squares problems subject to linear equality and inequality constraints by quadratic programming (uses a least squares specific method rather than a general QP method). It's less easy to use than lm, but not too bad --- see the first example in ?pcls. Simon _____________________________________________________________________> Simon Wood simon at stats.gla.ac.uk www.stats.gla.ac.uk/~simon/ >> Department of Statistics, University of Glasgow, Glasgow, G12 8QQ >>> Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814
Reasonably Related Threads
- subset VAR time series models
- non-negative least-squares
- use pcls to solve least square fitting with constraints
- Which package/function for solving weighted linear least squares with inequality and equality constraints?
- linear model with equality and inequality (redundant) constraints