Update 1: @kglr in a comment below showed that a random sample can be used with the simpler Mathematica code:
pd = ProbabilityDistribution[density, {r, 0, Infinity}];
SeedRandom[12345];
rr = RandomVariate[pd, n]
Now generate values of $\lambda$. From the relationship given we have:
I don't know the subject matter so I have no idea if the resulting figure makes any sense or if the cited paper makes any sense or if I've made an error. All are possible.
Update 2: Finding a nice closed-form formula for the density of $\lambda_i$ does not seem likely as the random variables $\lambda$ become more and more difficult to deal with. We have for the first few $\lambda$ random variables the following pattern:
$$\lambda_3=1+R_3$$ $$\lambda_4=1+R_3+R_3 R_4$$ $$\lambda_5=1+R_3+R_3 R_4+R_3 R_4 R_5$$ $$\lambda_6=1+R_3+R_3 R_4+R_3 R_4 R_5+R_3 R_4 R_5 R_6$$
@kglr also showed how to produce this using the following:
solλ = RSolve[{λ[m] == λ[m - 1] + r[m] (λ[m - 1] - λ[m - 2]), λ[1] == 0, λ[2] == 1},
λ[m], m][[1]] /. {K[1] -> j, K[2] -> i}
The above can be simplified for each value of $m$:
solλ /. m -> 3 // Expand
(* {λ[3] -> 1 + r[3]} *)
solλ /. m -> 6 // Expand
(* {λ[6] -> 1 + r[3] + r[3] r[4] + r[3] r[4] r[5] + r[3] r[4] r[5] r[6]}
However, one can produce the density for $\lambda_4$ numerically (as opposed to random sampling) by integrating the product of the densities times the Jacobian with r4
replaced by (-1 - r3 + \[Lambda]4)/r3
over r3
ranging from 0 to \[Lambda]4 - 1
:
(* Jacobian *)
J = 1/r3;
(* Integrand *)
integrand = FullSimplify[(density /. r -> r3) (density /. r -> (-1 - r3 + λ)/r3) J,
Assumptions -> {r3 > 0 && λ > r3 + 1}];
(* Probability density function *)
pdfλ4[λ4_] := NIntegrate[integrand /. λ -> λ4, {r3, 0, λ4 - 1}]
Now to compare with a random sample:
n = 10000;
density = 27 (r + r^2)/(8 (1 + r + r^2)^(5/2));
dist = ProbabilityDistribution[density, {r, 0, ∞}];
SeedRandom[12345];
rr3 = RandomVariate[dist, n];
rr4 = RandomVariate[dist, n];
λλ4 = 1 + rr3 + rr3*rr4;
Show[Histogram[λλ4, "FreedmanDiaconis", "PDF"],
Plot[pdfλ4[t], {t, 1, 20}]]