[R] nls: different results if applied to normal or linearized data

Rolf Turner r.turner at auckland.ac.nz
Wed Mar 5 21:04:29 CET 2008


On 6/03/2008, at 2:53 AM, Wolfgang Waser wrote:

> Dear all,
>
> I did a non-linear least square model fit
>
> y ~ a * x^b
>
> (a) > nls(y ~ a * x^b, start=list(a=1,b=1))
>
> to obtain the coefficients a & b.
>
> I did the same with the linearized formula, including a linear model
>
> log(y) ~ log(a) + b * log(x)
>
> (b) > nls(log10(y) ~ log10(a) + b*log10(x), start=list(a=1,b=1))
> (c) > lm(log10(y) ~ log10(x))
>
> I expected coefficient b to be identical for all three cases.  
> Hoever, using my
> dataset, coefficient b was:
> (a) 0.912
> (b) 0.9794
> (c) 0.9794
>
> Coefficient a also varied between option (a) and (b), 107.2 and 94.7,
> respectively.
>
> Is this supposed to happen? Which is the correct coefficient b?

The two approaches assume two different models.

	Model (1) is y = a*x^b + E (where different errors are independent  
and identically
	--- usually normally --- distributed).

	Model (2) is y = a*(x^b)*E (and you are usually tacitly assuming  
that ln E is normally distributed).

	The point estimates of a and b will consequently be different ---  
although usually not hugely
	different.  Their distributional properties will be substantially  
different.

		cheers,

			Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-help mailing list