Multiple linear regression with constraint

7 visualizaciones (últimos 30 días)
abdoulaye thiam
abdoulaye thiam el 7 de Feb. de 2014
Editada: abdoulaye thiam el 8 de Feb. de 2014
I need to run a multiple linear regression such that all of the coefficients are positive, and their sum = 1 . I have 7 variables, so i need 7 seven coefficients.
Thanks !

Respuesta aceptada

Amit
Amit el 8 de Feb. de 2014
  6 comentarios
John D'Errico
John D'Errico el 8 de Feb. de 2014
Editada: John D'Errico el 8 de Feb. de 2014
Note that most likely, some of the coefficients MIGHT go negative by an amount on the order of eps. Look at the numbers. If they are -1.e-13, why do you care? Just set them to ZERO afterwards.
abdoulaye thiam
abdoulaye thiam el 8 de Feb. de 2014
Editada: abdoulaye thiam el 8 de Feb. de 2014
Yes you are right John, the only the only negative number that i have is -2.641592169276901e-17...Sure, why would I care!! Thank you both!!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Linear Least Squares en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by