tags:

views:

95

answers:

3

I want to graph from one date to another date and i only partial data now

For example, i have data points for each month from jan 2010 to march 2010 but i want a line graph with a data point for each month for all of 2010.

i basically want to take the slope of the current points and create new points for each future month of 2010 to fill in for the graph.

+1  A: 

It sounds like you're looking for Linear interpolation.

Be careful, however, of extrapolation beyond the boundaries of the data set you already have. For example, having three data points for the first three months of the year does not imply anything useful about November.

Greg Hewgill
The requirement sounds more like extrapolation than interpolation.
Hightechrider
@Hightechrider - do you know of any csharp libraries that have these functions built in ?
ooo
Extrapolation can indeed imply useful data about future dates. It all depends on what is being extrapolated, and how much you know about it.If, for example, the quantity measured is "money in a jar" and you deposit an approximately equal sum of money in the jar every month, and intend to do so the entire year, then the extrapolation for November will be very useful.The xkcd comic Mark listed in his comment does however show a good example where extrapolation is silly.
kigurai
A: 

This is called extrapolation. Beware though. That is a long way to extrapolate out on little data. Linear extrapolation is the least risky thing to do. A nice thing is that the same formula that works for linear interpolation will also extrapolate.

I strongly recommend avoiding extrapolation that uses high order polynomials. Even quadratic extrapolation is a terrible thing to do in some cases. And extrapolation for any long distance is just crazy.

In some cases, the extrapolant would be expected to level off. (Your knowledge of a system is important. Without some input from the user, I recommend avoiding extrapolation at all.) But if the system should be expected to level off, then a logical thing to do is some variety of negative exponential extrapolation.

woodchips
OP uses C#, not matlab, more's the pity.
AVB
+1  A: 

Linear extrapolation (the linked page has the formula).

AVB