What constrained regression function shuld I use?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Simon Wang
am 13 Mär. 2015
Beantwortet: Simon Wang
am 15 Mär. 2015
I have a regression model log (r(i)) = a + b * log(A(i)) where A(i) is a vector and each element is known. Log is the nature log.
I need to find out a, b, and each element of r(i) such that the sum of r(i) equals to a constant k and the sum of error, i.e. sum(square[log (r(i)) – (a + b * log(A(i)))]) is minimized. Both a and b are scalars.
What regression model can I choose?
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (3)
Torsten
am 13 Mär. 2015
Choose a and b such that
exp(a)*(A(1)^b+A(2)^b+...+A(n)^b)=k
Then sum (exp(a)*A(i)^b) = k is satisfied.
Now define r(i) = exp(a) * A(i)^b, and you are done.
Best wishes
Torsten.
0 Kommentare
Simon Wang
am 13 Mär. 2015
Bearbeitet: Simon Wang
am 13 Mär. 2015
1 Kommentar
Torsten
am 13 Mär. 2015
Choose b=1, a=log(k/(A(1)+A(2)+...+A(n))) and define r(i)=exp(a)*A(i).
Then sum(square[log (r(i)) – (a + b * log(A(i)))]) is minimized (because it equals 0) and sum r(i)=k.
Best wishes
Torsten.
Siehe auch
Kategorien
Mehr zu Linear Regression finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!