Dear All,

I was trying to estimate a non-linear least squares regression and found the following discussion from April 2008.

http://lists.wfu.edu/pipermail/gretl-users/2008-April/002337.html

I changed the code, so that it would accommodate my “model”. All Xi’s as well as Y are time series. Unfortunately, when I estimate the model, I get an error: b1: expect scalar or vector.


... But don´t you get this error because you define the scalars after de 'nls ... end nls' command, instead of defining them before?

nls Y= w1*X1+ w2*X2 + w3*X3 + w4*X4 + w5*X5 + w6*X6

    w1=b1^2

    w2=b2^2

    w3=b3^2

    w4=b4^2

    w5=b5^2

    w6=1-w1-w2-w3-w4-w5

    params b1 b2 b3 b4 b5

end nls

 

After this, I tried to define arbitrary scalars as starting values (no theory, just numbers that came to my mind)

scalar b1=0.1

scalar b2=0.2

scalar b3=-0.05

scalar b4=0.03

scalar b5=-0.015