Closed Stanpol closed 6 years ago
Hi @Stanpol ,
Thanks for this problem report. Interesting.
This is a known issue. The month periods are not regular (more like a human process ;). I will work on it.
I however cannot be sure that the pattern has been defined somewhere (unless an option is set). The current behavior is to maintain the same average period between consecutive dates which is the closest to the beginning of month one can have in an automated way. YMMV, new ideas are welcome.
If you want to look at the code, see nextDate() method in TS/Time.py
Just curious, can you please copy-paste a plot of the forecasts ?
By the way, the standard python timedelta object stops at weeks ;)
https://docs.python.org/3.6/library/datetime.html#datetime.timedelta
class datetime.timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]])
A lot of databases also have a SQL addMonths() function .... guess why ?
numpy.timedelta does not support months. (too low-level)
FIX : use pandas.DateOffset , high-;level and supports all possible periods, even business , calendar and custom periods
see https://pandas.pydata.org/pandas-docs/stable/timeseries.html#dateoffset-objects
Example with ozone datset :
before :
After
@Stanpol
Your feedback is welcome.
Added release 1.0 fixing this issue.
Closing. Please, reopen if needed.
I'm using the latest version from the github. Unfortunately the package doesn't have a convenient version variable to specify.
The following example illustrates the problem. My training dataset has a column with dates as the 1st day of month:
when doing a forecast, future dates are calculated not following the pattern of the 1st of month, but with a shift like every month has only 30 days:
Could someone please point out where are the forecast dates calculated in the code?