Re: Fitting Data
- From: dpb <none@xxxxxxx>
- Date: Wed, 14 Nov 2007 14:50:39 -0600
Robert wrote:
"John D'Errico" <woodchips@xxxxxxxxxxxxxxxx> wrote in
message <fhfiha$lro$1@xxxxxxxxxxxxxxxxxx>...
"Robert " <robert.sochon@xxxxxxxxxxxxxxxxxx> wrote inmessage <fhfgen$nif$1@xxxxxxxxxxxxxxxxxx>...equation,I have some noisy(ish) data from an experiment, I would like
to plot this data and plot a line of best fit through it! -
easyish - I think!
My data is long and messy, but It should follow they = k * x ^ (3/2)If x and y are columns, and x is non-negative
The problem is the 3/2 and the fact that it should lack a
constant. polyfit gives me hassle, but I think I have
managed it. I have tried logging the data too, and this just
only confuses me.
k = (x.^(3/2)) \ y;
John
Sorry - I'm confused, I can calculate 'k' just that deciding
when K deviates from the data is now the problem, I suppose
you could write the question as "what is the data sample
length that fits the curve y =k*x(3/2)?" - this leaves two
unknows! - "k" and a the length of "x".
My curve starts off with a curving section upwards, and then
turns to a straight line, by plotting R i can work out when
the curve ceases to be a straight line (downwards from the
top), but working upwards to where the curve stops fitting
the initial equation and turns to the transition region is
proving more difficult.
Sorry... I think my question wasn't clear enough!
That would be an iterative procedure then -- if you don't need to have it fully automated, I'd start by plotting the data to visually select a starting breakpoint.
After that, you would have to fit the two sections, compute the overall residual, and move the breakpoint one direction or the other and repeat until you locate a minimum.
There are procedures for this, whether any are implemented in the Matlab Statistic and/or Curve Fitting toolbox(es) or not, I don't know; or, of course, whether you have either. A common-enough problem that might have some code at the Code Exchange, too.
--
.
- Follow-Ups:
- Re: Fitting Data
- From: Robert
- Re: Fitting Data
- References:
- Fitting Data
- From: Robert
- Re: Fitting Data
- From: John D'Errico
- Re: Fitting Data
- From: Robert
- Fitting Data
- Prev by Date: Re: Vectorize Matrix Multiplication
- Next by Date: Second Order system
- Previous by thread: Re: Fitting Data
- Next by thread: Re: Fitting Data
- Index(es):
Relevant Pages
|