> 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?
- 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 [EMAIL PROTECTED]        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

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to