Re: help for time series basic operations
- To: mathgroup at smc.vnet.net
- Subject: [mg46080] Re: [mg46046] help for time series basic operations
- From: János Löbb <janos.lobb at yale.edu>
- Date: Thu, 5 Feb 2004 04:02:59 -0500 (EST)
- References: <200402032320.SAA28930@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
My newbee approach: a = {a1, a2, a3, a4, a5, a6, a7} Partition[a, 2, 1] /. {x_, y_} -> (y - x) {-a1 + a2, -a2 + a3, -a3 + a4, -a4 + a5, -a5 + a6, -a6 + a7} János On Feb 3, 2004, at 6:20 PM, paolo wrote: > 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 helps > to begin to understand Mathematica > > I have a time series > a:=[a_1,a_2,a_3,a_4,...a_n] > 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] > > Thanks > > Paolo Tarpanelli > > ------------------------------------------------- clear perl code is better than unclear awk code; but NOTHING comes close to unclear perl code http://www.faqs.org/faqs/computer-lang/awk/faq/
- References:
- help for time series basic operations
- From: "paolo" <tarpanelli@libero.it>
- help for time series basic operations