Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2001

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

Search the Archive

Re: Q: Recursion on a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28897] Re: Q: Recursion on a list
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 18 May 2001 01:13:01 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <9e02kg$305@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

I assume x[t] mean x[[t]] and not a function call.

xNew=RotateRight[#1*(1.0-#2) @@@ Transpose[{RotateLeft[x],r}]];
xNew[[1]]=1.0;

?
Regards
  Jens

msc wrote:
> 
> Greetings,
> 
> I'm looking for an efficient method (i.e., with the use of an explicit loop)
> for the following problem. I am working with large lists (several thousand
> elements) of data. Denote one such list r. I would like to define a new list
> x such that:
> 
> x[0] = 1.0
> 
> x[t] = x[t-1]*(1.0 + r[t])
> 
> Can anyone suggest an efficient way?
> 
> Thanks in advance,
> 
> Mark


  • Prev by Date: Re: array generated
  • Next by Date: Mathematica graphics/fonts and Tex
  • Previous by thread: Re: Q: Recursion on a list
  • Next by thread: Re: Q: Recursion on a list