Consider the product distribution $Z = X_1\cdot X_2$ for
$$ \begin{aligned} X_1 &\sim \textrm{Uniform}[1 - a, 1 + a] \quad, \quad 0 < a < 1 \\ X_2 &\sim \textrm{Uniform}[1 - b, 1 + b] \quad, \quad 0 < b < 1 \\ \end{aligned} $$
I derived the CDF as follows (similar to this answer) but I'm having doubts that it is correct since a comparison with random sampling shows quite some deviation.
$$ \begin{aligned} F_Z(z) &= \textrm{Pr}[Z \leq z] \\ &= \int_{1-a}^{1+a} \textrm{Pr}[X_2 \leq z/x] \, f_{X_1}(x) \; dx \\ &= \int_{1-a}^{1+a} F_{X_2}(z/x) \, f_{X_1}(x) \; dx \\ &= \int_{1-a}^{1+a} \frac{\frac{z}{x} + b - 1}{2b} \, f_{X_1}(x) \; dx \\ &= \frac{b - 1}{2b} + z\cdot\frac{\tanh^{-1}(a)}{2ab} \end{aligned} $$
I estimate this CDF using the following Python snippet:
import numpy as np
np.random.seed(0)
def F(z, , a, b):
return (b - 1) / (2b) + z * np.arctanh(a) / (2ab)
def estimate(z, , a, b, N=107):
x1 = np.random.uniform(1 - a, 1 + a, size=N)
x2 = np.random.uniform(1 - b, 1 + b, size=N)
return np.mean(x1x2 <= z)
def compare(z, *, a, b):
e = [estimate(z, a=a, b=b) for _ in range(7)]
diff = F(z, a=a, b=b) - np.mean(e)
print(f'[{z=}, {a=}, {b=}] {diff} vs. {np.std(e)}')
for ab in [0.1, 0.2, 0.3, 0.4, 0.5]:
compare(1.0, a=ab, b=ab)
which gives:
[z=1.0, a=0.1, b=0.1] 0.0011786436966352287 vs. 9.239367413632735e-05
[z=1.0, a=0.2, b=0.2] 0.005161311390312617 vs. 0.00016954833637446384
[z=1.0, a=0.3, b=0.3] 0.012021147160144685 vs. 0.00013443702569435986
[z=1.0, a=0.4, b=0.4] 0.02242172114071983 vs. 0.0001156793157035264
[z=1.0, a=0.5, b=0.5] 0.037655831525252426 vs. 0.00018787333770497807
So the deviation grows quite big compared to the standard deviation of the estimates. However I can't spot what's wrong with the above formula. I'm glad for your help.