On 1/25/2012 10:09 AM, patzoul wrote:
I have 2 series of data a,b and I would like to calculate a new series which
is z[t] = z[t-1]*a[t] + b[t] , z[1] = b[1].
How can I do that without using a loop?
A combination of Reduce and Map will work. Map to stitch together the a
and b vectors, Reduce
On 26-01-2012, at 17:58, Brian Diggs wrote:
On 1/25/2012 10:09 AM, patzoul wrote:
I have 2 series of data a,b and I would like to calculate a new series which
is z[t] = z[t-1]*a[t] + b[t] , z[1] = b[1].
How can I do that without using a loop?
A combination of Reduce and Map will work.
On 26-01-2012, at 19:10, Berend Hasselman wrote:
On 26-01-2012, at 17:58, Brian Diggs wrote:
On 1/25/2012 10:09 AM, patzoul wrote:
I have 2 series of data a,b and I would like to calculate a new series which
is z[t] = z[t-1]*a[t] + b[t] , z[1] = b[1].
How can I do that without using a
On 1/26/2012 10:33 AM, Berend Hasselman wrote:
On 26-01-2012, at 19:10, Berend Hasselman wrote:
On 26-01-2012, at 17:58, Brian Diggs wrote:
On 1/25/2012 10:09 AM, patzoul wrote:
I have 2 series of data a,b and I would like to calculate a new series which
is z[t] = z[t-1]*a[t] + b[t] ,
I have 2 series of data a,b and I would like to calculate a new series which
is z[t] = z[t-1]*a[t] + b[t] , z[1] = b[1].
How can I do that without using a loop?
--
View this message in context:
http://r.789695.n4.nabble.com/aplpy-recursive-function-on-a-list-tp4328017p4328017.html
Sent from the
On 25-01-2012, at 19:09, patzoul wrote:
I have 2 series of data a,b and I would like to calculate a new series which
is z[t] = z[t-1]*a[t] + b[t] , z[1] = b[1].
How can I do that without using a loop?
?filter
Berend
__
R-help@r-project.org
On 25-01-2012, at 21:00, Berend Hasselman wrote:
On 25-01-2012, at 19:09, patzoul wrote:
I have 2 series of data a,b and I would like to calculate a new series which
is z[t] = z[t-1]*a[t] + b[t] , z[1] = b[1].
How can I do that without using a loop?
?filter
Oops. filter only works
that's an AR(1) with a constant added each time so you could use arima.sim
and add the constant in afterwards. but I don't know how that fast that is.
I started to check if there was a relation cumprod wise but I didn't get
far.
z[4] = a[4]*a[3]*a[2] + a[4]*a[3] + a[4]*b[3] + b[4]
for z[5] you
Hi: I thought about it some more and arima.sim will not work because it
will add noise.
so sorry for my noise.
On Wed, Jan 25, 2012 at 3:46 PM, Mark Leeds marklee...@gmail.com wrote:
that's an AR(1) with a constant added each time so you could use arima.sim
and add the constant in afterwards.
9 matches
Mail list logo