The main answer is no. Programming tools are not intended for forecasting. For this purpose, statistical tools have been developed. You should think more about R, SPSS, SAS, or another similar tool. Some databases have rudimentary data analysis tools built in, which is another (often inferior) option.
The standard statistical time series forecasting technique is called ARIMA analysis (autoregressive integrated moving average). It is unlikely that you are going to implement this in php / SQL. The standard statistical method for estimating the time between events is Poisson regression. It is also unlikely that you are going to implement this in php / SQL.
I observe that your data is indicated once a day in the evening. I can guess that this is the end of some process that works throughout the day. The end time is based on the start time and duration of the process.
What can you do? Often a reasonable prediction is "what happened yesterday." You would be surprised at how difficult it is to surpass this prediction for weather forecasting and stock market valuations. Another very reasonable method is the average of historical values.
If you know something about your process, then the average of the days of the week may work well. You can also get a more sophisticated approach and perform Monte Carlo estimates by measuring the mean and standard deviation, and then drawing a random value from the statistical distribution. However, the average will work just as well in your case.
I would advise you to learn a little about statistics / data mining / predictive analytics before trying to make βpredictionsβ. At least if you really have problems in this domain, you should look for the right tools.
source share