problem with fitting data using lsquares



On 6/13/10, Hugo Coolens <coolens at kahosl.be> wrote:

> m:matrix([100,16000],[200,8000],[500,3636],[1000,1818],[2000,870],[5000,323],[10000,160],[20000,83],[50000,33],[100000,20]);

With these data (the last one has been corrected, right?)
and the original model I get the following.

lsquares_estimates (m, [x, y], y = sqrt(a^2 + (10e7/(2*%pi*x*b))^2),
[a, b], initial=[10, 10]);
 => [[a = 19.2898942613692, b = 9.89381119455951]]

I gather that b = 10 is the exact value for b. (If that's not so,
just substitute the correct value in the following.)
I'll construct the mean square error as a function of a alone
and then plot it.

mse : lsquares_mse (m, [x, y], y = sqrt(a^2 + (10e7/(2*%pi*x*b))^2));
mse1 (a) := ''(subst (b=10, mse));
plot2d (mse1, [a, 0, 100]);

In the plot there is a very shallow minimum around a = 20.
So at this point I have two observations; one is that a is not very
strongly determined by the available data (since the MSE is almost
the same for a wide range of a values), and anyway the lsquares
estimates can't be too far off the mark (in the neighborhood of a = 20).

You might try to make a contour plot of MSE as a function
of both a and b.

Hope this helps in some way.

Robert Dodier