Let $F[n]$ and $G[n]$ be arrays of length $N$. At first, $G=F$.
After initialisation, $G$ is calculated by the relation
for i in range(N-1):
G[i+1:] += A*G[i]*F[:-i-1],
where $A$ is an real number satisfying $A<1$.
We can also express this as a convolution, i.e.,
$$ G[i+1] = F[i+1] + A\sum_{j=0}^i F[j]G[i-j]. $$
We have also established that the above operation is an integro-differential equation for continous time domain.
I provided an example for this operation here for $A=1$. Doing this operation brute force is $\mathcal{O}(N^2)$. This not feasible for a large array. For example, for $N=800000000$, it takes approximately 50 hours. It is also not possible to parallel process this operation, at least the brute force version of it.
Partially influenced by the matrix method for finding the fibonacci numbers as outlined here, if I can turn this into some sort of matrix multiplication, I can use singular value decomposition or something similar to speed up the process, although I am pretty sure singular value decomposition will not speed the process a lot for $N=800000000$.
The issue is that $G$ completely depends on $F$, however the dependence may not be linear.
I am looking for a fast method to implement the above operation. If possible, I would be happier if I could obtain $G[n]$ without explicitly computing $G[i]$ for $i<n$.
Thanks in advance!
PS: I was not sure whether to post this on stackoverflow or here, but I decided to try my luck here first.
Range(N-1), [i:], [:i], +=this also includes the fact that saying $x = x+1$ is just making a false statement in mathematical language. It is not an instruction to change the value of $x$. – Paul Sinclair Sep 01 '23 at 21:26