One way ive seen this done is to make a table of the slopes
of the "type curve" for a given time interval, then get the
slope of the measured data and compare them. that boils down
to a table lookup, with linear interpolation if needed.
{Quote hidden}> Well, this is really a math question, although the end product will be PIC
> code. I'd like to have a figure of merit that would tell me how closely
> some real world data fits a theoretical curve.
>
> I've got a data stream from a process that follows a certain very
> predictable curve. I've worked out a formula for the curve, and my project
> is to predict, early in the process, when the process will be finished.
> [details of the "process" are patent pending - no talkie no tellie] [No,
> Andy, it's not a toaster. ;-) ] See attached graph.
>
> Now we are not talking about a linear process here, that would be so easy
> I'd not bother posting about it. I've been able to model the process as a
> nice exponential function.
>
> The exponential model has two input variables. The task of my program will
> be to "guess" at those variables, then test the guess against data that has
> already been measured, adjust the guess, and test again. The attached graph
> shows the real world data, and a first "guess" at an estimate. Note that
> the guess is really close until time gets to about 145 then the guess starts
> to fail. At this popint the program must adjust it's guess, recalculate
> the curve, and update it's estimate of time to finish the process.
>
> The real world data and the estimated data follows this equation:
>
> Forcing Function = 112 - 112exp(-S1*T) = F1
>
> Estimated data = F1 - F1Exp(-S2*T)
> where F1 is the first equation. This is a nice exponential response that
> you'd typically see in an RLC circuit.
> S1 and S2 are the unknown variables, T is time.
>
> NOW THE ACTUAL QUESTION:
> The question is, I'd like a simple mathematical function that I can
> implement in a PIC that can tell me how good my "fit" of my estimated data
> to my real world data is. This is sort of a statistics question: how can
> you tell, mathematically, when two data sets follow the same curve, and if
> not, how close they are?
>
> I've tried some simple items. First I tried sum of the differences between
> the two curves at each X data point. The result is that a really bad
> fitting curve can have a sum-of-differences of zero if it crosses
> symmetrically. Also tried minimizing average of the differences, and median
> of differences. (these allow big negative numbers) and sum of absolute
> value of differences (Same problems as sum of differences) None of these
> really gives a good indication.
>
> Hopefully the figure of merit will be some function that takes only a rew
> bytes of RAM memory locations to calculate (I don't want to have to have
> thousands of bytes of memory holding an entire history of my data in a PIC)
>
> If the PIC could glance at a graph, it would be easy, but a pic has no
> eyeballs!
>
>
> -- Lawrence Lile
> Sr. Project Engineer
> Salton inc. Toastmaster Div.
> 573-446-5661 Voice
> 573-446-5676 Fax
>
--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspam@spam@mitvma.mit.edu