MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: help for time series basic operations


Use RotateLeft, subtract and Drop the last item. (% is the output from the
previously evaluated statement. If you put a number of statements together
in one cell it's safe to use.)

timeseries = Table[a[i], {i, 1, 10}]

% - timeseries
Drop[%, -1]

Or wrapping it all in one statement...

Drop[RotateLeft[timeseries] - timeseries, -1]

David Park
djmp at

From: paolo [mailto:tarpanelli at]
To: mathgroup at

I am a quantitative analyst and for the first time i am using Mathematica.
So, I
am sorry if my question seem "very easy (almost stupid)" but i need some
to begin to understand Mathematica

I have a time series
how can i do to subtract each element for the previous one?:

b:=[a_2 - a_1, a_3 - a_2, a_4 - a_3,.....,a_n - a_n-1]


Paolo Tarpanelli

  • Prev by Date: Re: How to plot...
  • Next by Date: Re: Graphics into MS Word
  • Previous by thread: Re: help for time series basic operations
  • Next by thread: Re: help for time series basic operations