RE: help for time series basic operations

• To: mathgroup at smc.vnet.net
• Subject: [mg46061] RE: [mg46046] help for time series basic operations
• From: "John C. Erb, Ph.D." <John_C_Erb at prodigy.net>
• Date: Wed, 4 Feb 2004 02:29:31 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```I'm sure there are more "elegant" ways, but
a Do loop works fine

Example

this={a1,a2,a3,a4,a5};
that=Table[0,{i,Length[this]-1}];
Do[
that[[i]]=this[[2]]-this[[1]];
this=Drop[this,1];,
{i,Length[that]}];
that

John C. Erb
Email:  John_C_Erb at prodigy.net

-----Original Message-----
From: paolo [mailto:tarpanelli at libero.it]
To: mathgroup at smc.vnet.net
Subject: [mg46061] [mg46046] help for time series basic operations

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

```

• Prev by Date: Re: help for time series basic operations
• Next by Date: Re: How do I Copy an error message to a text document, as text?
• Previous by thread: Re: help for time series basic operations
• Next by thread: Re: help for time series basic operations