On Wed, February 22, 2006 22:22, Arnaud Bervas wrote:
I can't execute the following program:
ols ld_SGD ld_USD ld_EUR ld_JPY ld_TWD ld_INR ld_KRW ld_IDR ld_AUD ld_THB
genr b0 = coeff(ld_USD)
genr b1 = coeff(ld_EUR)
genr b2 = coeff(ld_JPY)
genr b3 = coeff(ld_TWD)
genr b4 = coeff(ld_INR)
genr b5 = coeff(ld_KRW)
genr b6 = coeff(ld_IDR)
genr b7 = coeff(ld_AUD)
nls ld_SGD= b0*ld_USD + b1*ld_EUR + b2*ld_JPY + b3*ld_TWD + b4*ld_INR +
b5*ld_KRW+ b6*ld_IDR + b7*ld_AUD + (1-b0-b1-b2-b3-b4-b5-b6-b7)*ld_THB
end nls
I attach the corresponding dataset. Can you see what's wrong ?
Thank you
If you're using a post-1.5.0 version of gretl, you probably need to turn
"coeff" into "$coeff" (new syntax).
Besides, if you want to constrain the sum of parameters to 1, there's no need
to use nls; for example: say you have a relationship
y = b1 * x1 + b2 * x2
if you want to set the constraint (b1+b2)=1, you can rewrite the above as
y = b1 * x1 + (1-b1) * x2 => (y-x2) = b1 * (x1 - x2)
and estimate b1 via ols.
Hope this helps,
--
Riccardo "Jack" Lucchetti
Dipartimento di Economia
Facoltà di Economia "G. Fuà"
Ancona