Can I set the ""ExtrapolationHandler" -> Indeterminate in a TimeSeries?

Hi,

I like the new time-series, but I wanted to be able to set the extrapolation handler, like I can do with interpolating functions. How do I do this?

Thanks!

Sam

Good question!

I also faced this problem and was not able to find a way to control the extrapolation handler in TimeSeries. It should be ResamplingMethod but it does not work! I ended up reimplementing this functionality on the base of Interpolation what gave me huge speed-up as compared to TimeSeries. The basic idea is to construct InterpolatingFunctions for the datasets and then use these InterpolatingFunctions for upsampling the datasets in order to line them up:

ts1 = {{1, 10}, {2, 20}, {5, 50}};
ts2 = {{2, -20}, {3, -30}, {6, -60}};

datasets = {ts1, ts2};
interpFs = Interpolation[#, InterpolationOrder -> 1, 
     "ExtrapolationHandler" -> {Indeterminate &, "WarningMessage" -> False}] & /@ datasets;
abscissas = Union[Flatten@datasets[[;; , ;; , 1]]];
upsampledDatasets = Transpose[{abscissas, #}] & /@ Through[interpFs@abscissas]

{{{1, 10}, {2, 20}, {3, 30}, {5, 50}, {6, Indeterminate}}, {{1,
Indeterminate}, {2, -20}, {3, -30}, {5, -50}, {6, -60}}}

Now we can perform arithmetic operations on the lined up datasets, for example summing them up:

Transpose[{abscissas, Total[upsampledDatasets[[;; , ;; , 2]], 1]}]

{{1, Indeterminate}, {2, 0}, {3, 0}, {5, 0}, {6, Indeterminate}}

Here is what we obtain using TimeSeries by default in version 10.2:

(TimeSeries[ts1] + TimeSeries[ts2])["Path"]

{{2, 0}, {3, 0}, {5, 0}}

Of course if would be much nicer to have the "ExtrapolationHandler" available from within of TimeSeries.