I'm looking for some guidance in how to approach this problem mathematically. I'm not even sure what to Google to find the answer.
I have a set of values from the past 30 days - [2,5,8,5,9,15,20,12,etc]. I would like to extrapolate the next several values that might occur in the sequence. At its simplest, taking an average of the 30 entries and having that as the prediction could work, but I'd like to notice growth/change and extend accordingly, to get a prediction of value in 2 days or 10 days. I'm not really looking for pattern matching, just a trend line extrapolation.
I thought I could graph the data, put a line of best fit, and simply extend it. The issue is that I can't find much reference to the math one would use for calculating such information. Does one have to create a graph and read the figures off the line of best fit, or could one create a function in say PHP to calculate the next few predicted values from the trend line? I'm looking for an extended trend line basically, like Excel can do.
Many many thanks
Sam
I guess you are looking for regression. With regression, you fit a line through your data, which you can use to predict future values of your series. The simplest form of regression is linear regression, which tries to fit a straight line through your data points, to represent a trend.
More literature can be found as well when you look for time series analysis.