Computer Science Canada Graph Analysis - Curve fitting |
Author: | Cervantes [ Tue Aug 08, 2006 9:03 pm ] |
Post subject: | Graph Analysis - Curve fitting |
Hey guys, I'm hoping to be able to write a program to do some complex graphical analysis for me. I have a graph (a series of data points) that should contain 2 or 3 separate curves. That is, the graph first follows one function, then at a certain x value, the shape of the graph changes to follow a different function. But there's more to it than that. The graph isn't smooth. Rather, it's a bunch of ups and downs about these particular functions. It looks sort of like a seismograph, except with a general curve to it. I need to be able to calculate the function for each part of the graph, then shift the graph up to be sitting flatly (aside from the ups and downs) along the x-axis. At this point, the hard part is over, I imagine. What is left is to idealize the graph so that it is either up or down, not part way in between. The halfway value will be defined as half the vertical distance from the baseline to the peak of the ups. Then a point above the halfway value is defined to be completely up, or open, and a value below the halfway value is defined to be completely down, or closed. From this, I can calculate the percentage of time spent in the open state and the percentage of time spent in the closed state. Thoughts? Thanks! |
Author: | Tony [ Tue Aug 08, 2006 9:17 pm ] |
Post subject: | Re: Graph Analysis - Curve fitting |
Cervantes wrote: The graph isn't smooth. Rather, it's a bunch of ups and downs about these particular functions. It looks sort of like a seismograph, except with a general curve to it.
Seems like you should normalize that data first, remove the noise. Depending on the resolution of the data, it might be reasonably accurate to take an average slope for every 4 points or so (up, down, up, down), and normalize datapoints to that. Once it starts to look somewhat reasonable, match it to your favourite Taylor polynomial |
Author: | Cervantes [ Tue Aug 08, 2006 9:57 pm ] |
Post subject: | Re: Graph Analysis - Curve fitting |
Tony wrote: Seems like you should normalize that data first, remove the noise. Depending on the resolution of the data, it might be reasonably accurate to take an average slope for every 4 points or so (up, down, up, down), and normalize datapoints to that.
It's not necessarily going to be [up, down, up, down], though. It could be anything. This has to do with an ion channel in the cell membrane being open or closed, and whether it is open or closed depends on the presence of a blocker chemical as well as the random walk of diffusion. Taylor functions! A quick google found me this site. The way it models the cosine function is very cool. I remember once being told that you can calculate ever more accurate values of cos(x) using a recusrive formula; now I know what that formula is! What about the different sections of the graph? How would I know exactly where to split it? You can eyeball it, but this should try to be exact. Or can the Taylor function handle that? I can't imagine so Thanks, Tony. |
Author: | Tony [ Tue Aug 08, 2006 10:47 pm ] |
Post subject: | |
well since Calculus is not one of my stronger points, I can't say much on Taylor in detail. It's does have to do with curve fitting based on derivatives and Mean-Value-Theorem. Trying to remove noise could be tricky, though ultimately you have to think averages. Each datapoint should be within noise threshold from the base function. So averaging the points out should give you an approximation of the tangent in that region. Heh, the area under the noise graph should about equal the integral of the base function I guess that could be used as a quick way to check how closely you match or something. I can't think of a way to mathematically split appart the graph into different function classes. There's noise and probably some smoothed out connection between datasets anyways |
Author: | bugzpodder [ Tue Aug 29, 2006 5:54 pm ] |
Post subject: | |
i havent read the whole post, but i think you are looking for spline approximations |