I am trying to make the code for the following recurrence. Here wjoin[[i]]
is used for calling values from a data set and a
is a parameter.
- How can I perform the following recurrence using
Compile
? - How can I store the previous values of
gg[i]
to calculategg[i + 1]
?
I wrote the following code. But it is not working.
gg[1] = a - wjoin[[1]]
gg[2] = (a)*gg[1] - wjoin[[2]])
gg = Compile[{{r1, _Integer}}, 1/(a)*((1 + a )*gg[r1] - wjoin[[r1]])];
gg[3]