I am looking for the name of a computer algorithm. I'm fairly sure that one should exist which will help me, but I can't for the life of me figure out what to search for.
If you have implementations of the algorithm, that'd be awesome - but I'm really just researching this because I'd like to figure out how to build it myself.
Basically, I'm looking for an algorithm that can calculate future usage of some set of data based on my previous usage. For example, my electricity supplier knows how much power I've used for the previous 20 days of a 30 day month, so they can extrapolate that out and predict how quickly I will run out of money on my power account. I'd like to know if there's an algorithm out there that can tell me in how long I'm likely to run out.
What I'm looking for is something that given the following inputs:
- A range (e.g. 30 days)
- A period of time through that range (e.g. 4, never smaller than zero, never greater than the max of the range)
- Some values for previous time periods - either the previous days, or the same days from previous months)
- A total value for this range (e.g. 300)
Can give me a date range in which I'm likely to run out of the total value (300). What I'd like at the other end would be something simple - e.g. "Based on previous usage, you're going to run out in 2 days."
I've done the usual Google searches, but haven't come up with anything particular that even looks close - yet as far as I can see it's a reasonably common algorithm used all over the place.