I am working with four different time series which have the same first and last dates, but a different number of observations. One time series (svq) includes weekend data, the other three don't include weekend data, but seem to be missing a few days each. I can get the Intersection of "Dates" common to all four series and map each index over the common dates to get a matching set of values, but that is perhaps not the best way to get those values. Can someone suggest a better way?

enter image description here

  • $\begingroup$ Perhaps you could use TimeSeriesResample[{<time series>}, "Intersection"] $\endgroup$ – user42582 May 16 '18 at 19:49
  • $\begingroup$ "doesn't perform as expected is due to poor programming or incomplete understanding of the underlying task" - I get it $\endgroup$ – George Wolfe May 16 '18 at 20:18
  • 1
    $\begingroup$ for the record, I wasn't aware you could do this with TimeSeriesResample until I read this question; that's the reason I like mma.se; it forces you to be honest with what you know and learn the rest $\endgroup$ – user42582 May 16 '18 at 20:40
  • $\begingroup$ I didn't really understand the full capabilities of the function. TimeSeriesResample[ ts , {starttime,endtime,"BusinessDay"} also worked. $\endgroup$ – George Wolfe May 17 '18 at 20:14

Compare and contrast the following example series:

ts1 = TimeSeries[{1, 2, 3, 4}, {{1, 2, 3, 4}}]
ts1 // ListLinePlot[#, Mesh -> Full] &


ts2 = TimeSeries[{5, 4, 3, 2, 1}, {{1, 1.3, 2, 3.5, 4}}];
ts2 // ListLinePlot[#, Mesh -> Full] &



TimeSeriesResample[{ts1, ts2}, "Intersection"] // ListLinePlot[#, Mesh -> Full] &

we obtain the values at common dates:



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.