2
$\begingroup$

Possible bug in v10.1


ResamplingMethod -> None in TimeSeries does NOT take any effect in v10.1. Try:

ts = TimeSeriesResample[TimeSeries[{{123, 3}, {130, 3}, {124, 3}, {122, 9}}, 
ResamplingMethod -> None], ResamplingMethod -> None];
ts/@{125.5,122.5}
(*{0. +Missing[], 6.}*)

The answer is supposed to be {Missing[], Missing[]}.

Can anyone help me work this out?


Update: Thanks @2012rcampion for the comment: Changing the ResamplingMethod to {"Constant",Missing[]} is a temporary workaround in v10.1.

$\endgroup$
  • $\begingroup$ ts[125.5] // Rationalize $\endgroup$ – Bob Hanlon Apr 15 '15 at 12:10
  • $\begingroup$ @BobHanlon , the thing is that not only Missing[] is not correctly return but also the positions which should be Missing[] are actually set with interpolated values. for e.g.: ts[122.5]. $\endgroup$ – sunt05 Apr 15 '15 at 12:45
  • $\begingroup$ This may be a bug. I get {Missing[], Missing[]} on 10.0.0.0, Windows 8.1 64-bit. $\endgroup$ – 2012rcampion Apr 15 '15 at 13:37
  • 1
    $\begingroup$ What happens if you try ResamplingMethod -> {"Constant", Missing[]}? $\endgroup$ – 2012rcampion Apr 15 '15 at 13:38
  • $\begingroup$ Thanks @2012rcampion, the Constant method works. I'm deeply disappointed by the recent updates by WRI, where the unmentioned features are in fact bugs. The funny thing is that the bugs seem to be rotating but never disappear. $\endgroup$ – sunt05 Apr 15 '15 at 14:55
1
$\begingroup$

This is not a bug, but an intended design change. The motivation is that TimeSeries is meant for those time-series that support resampling.

Zero order interpolation is supported, example:

TimeSeries[Range[3], Automatic, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 0}]

If your time series is not meant to support resampling then EventSeries would most likely be a better choice than TimeSeries.

$\endgroup$
  • $\begingroup$ OK, I know EventSeries can used for such scenarios. However, what is meaning of ResamplingMethod -> None for TimeSeries then? At least, according to the documentation, this is a valid option for TimeSeries and did what it is supposed to do in the previous versions. So I cannot accept the saying that it is "an intended design". $\endgroup$ – sunt05 Apr 15 '15 at 16:20
  • $\begingroup$ TimeSeries[..., ResamplingMethod->None] will now default to linear interpolation, as can be verified by checking the InputForm of the resulting TimeSeries object. The documentation should be clarified on this issue. $\endgroup$ – Stefan R Apr 15 '15 at 16:38
  • $\begingroup$ This is really bad. There is no reason for changing the default behavior of a function without clear notification. And I'd rather consider this change (i.e. TimeSeries[..., ResamplingMethod->None] to linear interpolation) as a redundant design since the default setting of ResamplingMethod has already been linear interpolation. $\endgroup$ – sunt05 Apr 15 '15 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.