[R] fitting power growth
Thomas Hoffmann
thomas.hoffmann at uni-bonn.de
Tue Jul 10 12:47:48 CEST 2012
Dear all
I am using the x and y vectors as defined below and want do to a power
law regression:
y = a x^b
using
> lm(log(y)~log(x))
gives reasonable values (b=1.23) but is not very popular due to biases
of back-transformation from log to non-log values. Using
> nls(y~a*x^b,start=list(a=1000000,b=1.23))
is statistically more correct but gives a too large "a" value and a too
small "b" value.
Doe anybody have a better way to solve the above power-law regression
(using for instance maximum likely hood or anything else).
Kind regards for your help
Thomas
> x
[1] 744.90 806.40 838.00 910.70 1818.60 2870.10 4070.00
4476.80 4857.60 4858.10
[11] 5916.40 13970.80 27306.60 28226.60 2532.10 2658.40 18863.10
758.00 54.00 79.00
[21] 139.00 46.70 1003.00 24.00 106.00 186.00 1503.00
228.00 10.24 162.00
[31] 381.70 312.60 209.00 246.00 221.20 1151.55
> y
[1] 1.500e+08 2.850e+08 1.800e+08 1.800e+08 6.300e+08 7.200e+08
1.170e+09 1.095e+09 1.620e+09
[10] 4.650e+09 1.575e+09 4.200e+09 7.755e+09 8.745e+09 9.900e+08
6.600e+08 1.077e+10 3.450e+08
[19] 1.350e+07 2.550e+07 6.600e+07 6.000e+06 3.300e+07 1.500e+06
4.500e+06 7.500e+06 2.415e+08
[28] 6.900e+07 9.000e+05 9.450e+06 3.510e+07 4.880e+07 3.100e+06
1.930e+07 2.270e+07 5.270e+07
More information about the R-help
mailing list