Quantcast
Channel: How to implement a recursive process in R? - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Joris Meys for How to implement a recursive process in R?

If I understood you right, this is the process you're talking about: X1 = f(n) X2 = X1*v[1] + n X3 = F(X2)*v[2] + X2 X4 = F(X3)*v[3] + X3 ...If you need all in-between steps, a recursive function is...

View Article



Answer by agstudy for How to implement a recursive process in R?

I assume here that n is length of v.I rewrite the recusrion like this : y1 <- n ## slight change herey2 <- f(y1)*v[1] +y1, y3 <- f(y2)*v[2] +y2y4 <- f(y3)*v[3] +y3.... I can''t see the...

View Article

How to implement a recursive process in R?

Say I have a vector v = c(250,1200,700), a starting value n and a function e.g.f = function(v){g = function(v){ cases( v <= 20 -> 0.1, v > 20 & v <= 100 -> 0.075, v > 100 ->...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images