Accumulate
Accumulate[list]
gives a list of the successive accumulated totals of elements in list.
Details and Options
- Accumulate[list] has the same length as list.
- Accumulate[list] is effectively equivalent to FoldList[Plus,list].
- Accumulate[list,Method"CompensatedSummation"] uses compensated summation to reduce numerical error in the result.
Examples
open allclose allScope (3)
Accumulate a regularly sampled TimeSeries:
The created time stamps are regularly spaced:
Compare to the accumulated values:
Accumulate an irregularly sampled time series:
Or define a new time series and set TemporalRegularity to True:
Now the result of Accumulate is given as a TimeSeries:
Generalizations & Extensions (1)
The head does not need to be List:
Applications (4)
Properties & Relations (3)
Differences is almost the inverse of Accumulate:
Accumulate is equivalent to a particular case of FoldList:
Use Sum to symbolically accumulate sequences:
Possible Issues (1)
Accumulating directly an irregularly sampled time series may differ from accumulating the values:
This is not the same as the accumulated values:
The time series was first upsampled according to MinimumTimeIncrement and then downsampled:
Text
Wolfram Research (2007), Accumulate, Wolfram Language function, https://reference.wolfram.com/language/ref/Accumulate.html (updated 2008).
CMS
Wolfram Language. 2007. "Accumulate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/Accumulate.html.
APA
Wolfram Language. (2007). Accumulate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Accumulate.html