One option is to reparameterize to an unconstrained problem using the
transformation:
exp(betas_i) / sum(exp(betas_i)), with e.g., beta_1 = 0,
and then use optim() to maximize with respect to betas.
I hope it helps.
Best,
Dimitris
On 9/4/2011 7:50 AM, andre bedon wrote:>
> Hi Guys,
> Does anyone know how I could constrain my regression coefficients so that
they are positive and add up to one? Any help will be greatly appreciated.
> Kind Regards,
> Andre
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center
Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
Web: http://www.erasmusmc.nl/biostatistiek/