This is the purpose of the TemporalRegularity
option.
TemporalRegularity is an option for TemporalData, TimeSeries, and EventSeries that controls whether the paths are assumed to be uniformly spaced in time.
When setting this option, the dates themselves are ignored and a standard index {0,1,...,n}
is used in its place, allowing for non-uniform dates/times to be used for labeling and plotting purposes while leveraging algorithms that require uniform spacing.
TimeSeries[
Transpose@{DateRange[{2006, 12, 31}, {2007, 9, 30}, "EndOfMonth"],
Range[10]}, TemporalRegularity -> True] // RegularlySampledQ
(* True *)
Edit
It is interesting to look at the InputForm
of the TimeSeries
object that is produced by setting TemporalRegularity
to True
. Note the use of a uniform time specification.
TemporalData[TimeSeries, {{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}},
{TemporalData`UniformTimeSpecification[{3376512000, 3379190400, 3381609600,
3384288000, 3386880000, 3389558400, 3392150400, 3394828800, 3397507200,
3400099200}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ValueDimensions -> 1, DateFunction -> Automatic,
ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1},
TemporalRegularity -> True}}, True, 10.1]
Obviously this is exposing internal functionality that is subject to change.