2011-09-17

Linear interpolation. Extended version.

I already wrote about the linear interpolation and related problems which were successfully solved. However, full convenience requires some monthly statistical capacities. Usually the data series, including interpolated ones, does not start and end with first and last day of the month, respectively and thus the first thing is to cut off the first and last incomplete month measurements. And only then it is possible to split the data series by month. Splitting occures in the loop splitting the corresponding date and getting the month and comparing it with the previously splitted month value. If the measurement is in the same month, the new two dimensional array is created with the date (year and month) in the first dimension, and (measured including interpolated) value in the second. And if the current month value differs from the detected month value in previous cycle, it is time to change the first - date dimension value to the next one. After creating such array, it is time to make some statistics for each of inner measurement array.
You can try the linear interpolator here and see the source code (not yet OOP, but i hope soon) - here.

Nav komentāru:

Ierakstīt komentāru