0

I want to have calculate a cummulative series from the existing one.

In a simplified example, let's say there's a series:

ts = TimeSeries[{{{2016, 1, 14}, 0}, {{2016, 2, 1}, 10}, {{2016, 4, 6}, 0},
{{2016, 5, 10}, 10}, {{2016, 8, 18}, 10}}]

which has 5 observations.

However, the following:

Accumulate[ts]

has only 4 observations and the Accumulate[ts]["Values"] are not what could be expected, i.e. {0, 10, 10, 20, 30}, but {0, 10, 98029/3978, 8353/221}.

What is the logic behind this? Why do we loose one observation? What are these numbers in the results mean?

iav
  • 2,006
  • 17
  • 26
  • Accumulate[ts["Values"]] – corey979 Jan 09 '17 at 11:09
  • @corey979, yep, I know. But I want to have a TimeSeries object as an output. I can hack around this by writing a function, i.e. TimeSeriesAccumulate, that will do that, but wanted to understand whether there's any logic behind what happens by default. – iav Jan 09 '17 at 11:17
  • @corey979, thanks! To be fair Mathematica in the recent years has drifted towards becoming if anything an ultimate pokemon analysis tool. This might be one cause. – iav Jan 09 '17 at 11:37

0 Answers0