problem with fitting data using lsquares



I followed Leo Butler's "transforming"-suggestion:
m:matrix([100,16000],[200,8000],[500,3636],[1000,1818],[2000,870],[5000,323],[10000,160],[20000,83],[50000,33],[100000,20]);
j:1;
for i:1 thru 10 do
setelmx(1/m[i,j]^2,i,j,m);
j:2;
for i:1 thru 10 do
setelmx(m[i,j]^2,i,j,m);
m;
load (lsquares)$
lsquares_estimates(m,[u,v],v=r^2+u/(4*%pi^2*c^2),[r,c]);
float(%);

which gives:
r = 662.5790498454503, c = 9.9553192755652571E-8
The value for c is acceptable but the value for r is way too high, I guess 
this is what he had in mind when speaking of "a biased estimator".


best regards,
hugo


On Fri, 11 Jun 2010, Leo Butler wrote:

>
>
> On Fri, 11 Jun 2010, Hugo Coolens wrote:
>
> < oops, sorry for the missing %-sign. Unfortunately after correcting it, I still
> < have a problem with the result Maxima offers me:
> < [a = - 3.0489875948438647E-7, b = 9.894424748229691]
> < even though the value of 'b' is acceptable 'a' can't be negative because it
> < represents the series resistance of an RC-network (nominal values R=10 ohm and
> < C=100nF) so 'a' should in fact be around 10 which is the reason why I choose
> < that as een initial value. Is there a way to force Maxima not to use negative
> < a values/stick closer to the initial values?
> <
> < I also tried an alternative expression which gives worse results:
> < lsquares_estimates
> < (m,[x,y],y=sqrt((a^2)+((1/(2*%pi*x*b))^2)),[a,b],initial=[10,90e-9]);
>
> This is not the same model as you first wrote. You've rescaled b which
> will affect where/when the algorithm stops.
>
> <
> < now both a and b are way off their estimated values:
> <  [[a = 3094.318570260793, b = 1.032417178270959]]
> <
> < any ideas how to solve this best?
> <
> <
>
> A few suggestions which you have likely thought of:
>
> - generate some data using your model, when you know
> the true parameter values, and see how sensitive your
> estimator is to initial conditions
>
> - if a must be >0, then use a=exp(c)
>  (note that in your model the sign of a is irrelevant)
>
> - try transforming your variables and parameters to get a linear
> model, e.g. if you have y=sqrt(a/x + b) as a model, then
> v=a*u + b, with u=1/x and v=y^2, is linear in the parameters;
> although this may give you a biased estimator, you could use
> the estimated parameter values as initial conditions for your
> original, untransformed model
>
> - see the lsquares package documentation, which has more
> useful stuff.
>
> Leo
>
> -- 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>