From: John D'Errico on
"James Phillips" <zunzun(a)zunzun.com> wrote in message <htbq9f$as6$1(a)fred.mathworks.com>...
> "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <htbbvv$jtc$1(a)fred.mathworks.com>...
> >
> > Sorry, but this is just silly. Ridiculous in the extreme.
>
> I apologize for posing an well-understood alternative physical model that might help explain the underlying physics of the data set, even though you did not. Better?
>
> Note the number of digits of precision in the data set.

No. You picked out an arbitrary, random model, that
happens to fit well. Now you claim that it will help to
explain the underlying physics. There is no physical
justification for choosing this model from the OP's
query.

That it happens to fit well does not suggest that it
explains anything. The quadratic fits just as well.
Does it explain anything? Of course not. But I'm not
trying to claim that it will. Both models extrapolate
smoothly. So what?

The number of digits of precision provided tells you
nothing here.

Sorry, but this is just an abuse of modeling.

John
From: Mark Shore on
"James Phillips" <zunzun(a)zunzun.com> wrote in message <htbq9f$as6$1(a)fred.mathworks.com>...
> "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <htbbvv$jtc$1(a)fred.mathworks.com>...
> >
> > Sorry, but this is just silly. Ridiculous in the extreme.
>
> I apologize for posing an well-understood alternative physical model that might help explain the underlying physics of the data set, even though you did not. Better?
>
> Note the number of digits of precision in the data set.
>
> James

One usually uses a more complex model where there is either an understood physical basis for doing so, or where trial and error over a range of parameters has eliminated simpler methods.

Here we are given a grand total of six points, with no explanation of what they might represent physically - if anything. With a little digging, I find that the Steinhart&#8211;Hart approximation is used to model thermistor resistance vs. temperature. OK, good, but is there any indication this is relevant for the set of numbers shown?

After all, a fifth-order polynomial would fit the data both perfectly, and pointlessly.
From: James Phillips on
Perhaps this is a good place for the original poster to chime in. Anton, any thoughts or remarks on this thread?

James
From: Star Strider on
"Anton " <anton.mazurenko(a)gmail.com> wrote in message <hqnmt4$1bj$1(a)fred.mathworks.com>...
> Hello, I need to fit a curve very accurately. The function is
>
> n = ( k * sqrt(1 + x^2 / h^2)+phi ) / pi
>
> where k, h, phi are fitting parameters
> and the data is
> n =
> 2
> 3
> 4
> 5
> 6
> 7
>
> x =
> 3.7910
> 4.0640
> 4.2850
> 4.4930
> 4.6750
> 4.8440
>
> I tried doing a nonlinear least squares, but it comes up a fitted curve that is essentially straight, so the residuals go up and then down, and are not randomly distributed.
>
> Can you suggest a better method?
>
> Thank you,
>
> Antonmaz


With due note to the fact that I may be missing something, I didn't have any trouble fitting it:

nfit = inline('( B(1) .* sqrt(1 + x.^2 ./ (B(2).^2) ) + B(3)) ./ pi', 'B', 'x'); % B(1) = k, B(2) = h, B(3) = phi

B0 = rand(3,1);
[Bfit, nrsd, nJ, covB, mse] = nlinfit(x, n, nfit, B0);

This estimates:
Parameters:
k = 604.376
h = 12.857
phi = -624.226

MSE = 0.017

If I wrote your equation correctly in my "inline" function, this works. If I didn't, rewrite it and post your rewrite. Run it to see if it fits your data, and post your parameters.

Frank