Re: General Curve Fitting Question



John,

Thank you for your help. What i ended up doing was taking the log of
my data and use a fit which helped get more reasonable data.

The one thing i am still a bit confused on is setting constraints on
variables. For example, when i had the fit of y=x^25. When i had a
tight range, matlab found that with the equation y=x^a, a was 25. If
matlab can indeed determine that when fitting with 25 R^2 is ~1 then
when i set the limits from say 1 to 100 wont the value of 25
eventually be substituted into the forumla and a high value of R^2
will be found? Again I am assuming that by setting these limits
matlab will cycle through the numbers which.

Thanks again
Jonathan

John D'Errico wrote:


Jonathan wrote:


Hi John,
I am well aware of the range of number and also aware of the
plot
function. I understand that you are know what the issue is but
your
comment to plot and look at the data does not address the
question.

I would like to know why if i can get the correct values for
the
variable when i have heavy constraints matlab does not run
through
a
wider range and extract the same value once it passes it by.

Jonathan

What you do not appreciate is that when
you do a curve fit, these codes form the
difference between your data and the
prediction, square that difference and
then sum the results.

Now, when your data spans 50 orders of
magnitude, then you square numbers of
those magnitudes, what do you think
happens when you sum the results?

That sum is dominated by the last few
elements in the list. Everything else
is virtually meaningless. Again, a
standard minimization of the sum of
squares of residuals will almost
certainly not be appropriate for this
data.

Remember that Matlab works in only 16
digits of precision, not hundreds of
significant digits as would be necessary
to work with this data. When you work
in a floating point computational
environment, you need to remember
this fact.

John
.



Relevant Pages

  • Re: Matlab is not a real array oriented language.
    ... libraries for linear algebra, which is all about 1D and 2D matrices. ... spent a lot of time and effort popularizing the name MATLAB. ... and allow the debugger to stop when certain errors or warnings are ... If the input is a vector, SUM ...
    (comp.soft-sys.matlab)
  • Re: Number syntax
    ... fit your particular "N". ... 1C measuring cup to "remain unwashed" after its ... That's roughly the same height as the 5 mm square grid, ... Ruled paper for text-only usage is usually a good deal coarser, though: 9 or 10 millimeters, usually. ...
    (comp.arch.embedded)
  • Re: Corelating data in Matlab. Finding the best fit
    ... I want to write a code in Matlab, that will find a best fit. ... the best corelation between the RGB values and Temperature. ...
    (comp.soft-sys.matlab)
  • Re: Help with polynomial fitting
    ... MATLAB code for you. ... Use cftool to create a fit using whatever curve fitting method you feel is ... you can read up on the 'fit' command. ... about using high order polynomials to fit data sets. ...
    (comp.soft-sys.matlab)
  • Re: Wanted: socket for square nuts
    ... If it happens to fit the ... They can fit a square, ... I've tried 12 point sockets but they're too big to fit in the recess. ... some access to the top of the nuts so I'll use a cold chisel to ...
    (rec.crafts.metalworking)