"EndOfMonth"
is date unit that can be used with date functions. When specifying a TimeSeries
object with date increments you can specify the date unit increment so that you obtain a regularly sampled time series. I need date units of "EndOfMonth"
in the TimeSeries
.
If I supply the month end dates the result is an irregularly sampled time series.
TimeSeries[
Transpose@{DateRange[{2006, 12, 31}, {2007, 9, 30}, "EndOfMonth"],
Range[10]}] // RegularlySampledQ
(* False *)
If I request a time increment of "EndOfMonth"
then TimeSeries
errors.
TimeSeries[Range[10], {Automatic, {2007, 9, 30}, {1, "EndOfMonth"}}]
TemporalData::tpspc: The time specification {Automatic,{2007,9,30},{1,EndOfMonth}} should be one of Automatic, a time range, a list containing a list of explicit times, or a list containing one such specification for each path in the data.
If I request a time increment of "Month"
I get a regularly sampled time series but the dates are not month ends.
(m = TimeSeries[
Range[10], {Automatic, {2007, 9, 30}, {1, "Month"}}]) // RegularlySampledQ
(* True *)
(m["Dates"] /. DateObject[d_, ___] :> DateObject[d]) ===
DateRange[DateObject@{2006, 12, 31}, DateObject@{2007, 9, 30}, "EndOfMonth"]
(* False *)
How can a regularly sampled TimeSeries
of date unit "EndOfMonth"
be created?