On Wed, 30 Apr 2014, Jan Tille wrote:
Sven,
thank you for clarification.
Afterwards, I tried to adapt Jack's code to my problem (I have six
independent variables x1...x6, therefore I think I need b1...b5
parameters, with exponential transformations e1...e5 and expand the den
to den=1+e1+...+e5 to finally get w1...w5).
That's correct.
This, however lead me to another problem. The calculation of the
jacobian failed. I guess this is due to multicollienarity issues
(correlations are high - between 0.83 and 0.97) and because it works,
when I omit x6 and adapt the model accordingly. I also tried standard
OLS-Coefficients as starting values for the b's but it did not change
(which might be no surprise).
That's also likely to happen when one or more of your "shares" are near 0.
See what happens with analytical gradients, as in
<hansl>
nls y = w1 * x1 + w2 * x2 + (1-w1-w2) * x3
e1 = exp(b1)
e2 = exp(b2)
den = 1 + e1 + e2
w1 = e1 / den
w2 = e2 / den
deriv b1 = w1 * (1-w1) * x1
deriv b2 = w2 * (1-w2) * x2
end nls --verbose
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------