I am trying to implement the Lucy algorithm that the authors of this paper use to get a distribution of diffusion coefficients from the distribution of displacements. The equation looks like this.
$$P^{n+1}(D)=P^n(D)\int \frac{G_s(x)}{G_s^n(x)} g(x\vert D) dx$$
Where $G_s^n(x)=\int P^n(D) g(x \vert D) dx$.
I know $G_s(x)$, $g(x\vert D)$ and $P^1(D)$ so it seems pretty straightforward to iterate until reaching a solution inside the desired tolerance.
I have tried to define a function
loopfunction[x_, y_, z_, m_, d_] := x*NIntegrate[y*z/m, {t, -Infinity, Infinity}]
Taking as arguments $[P(D)$, $g(t|D)$,$G_s(t)$,$G_s^n(t)$,$d]$ and then using a While loop to try to find a value $P^*=P^{n+1}$ such that $\Vert P^* - P^n \Vert < \varepsilon$ for some tolerance.
I can't get the While loop to work mainly because of the integrations involved in the process (it seems to be some kind of problem when I try to consider as variables those variables over which I have not integrated). I think this is because NIntegrate is not capable of giving me a result if I don't specify a value for the free variables and I can't use Integrate because the expressions become quite difficult after a couple of iterations.
How can I implement this sort of iterative algorithm in Mathematica?
I can provide more code if it is necessary and clarification if the question is not clear.