- qspec. combined_pdf ( z , pdf_1=pdf , pdf_2=pdf , loc_1=0.0 , scale_1=1.0 , loc_2=0.0 , scale_2=1.0 , operator='+' , n=10 )[source]
-
The probability density function (pdf) of the sum or the product of two random variates $X$ and $Y$
$$ \rho_Z(z) = \begin{cases}\int\rho_X(x)\,\rho_Y(z - x)\,\mathrm{d}x, & Z = X + Y\\ \int\rho_X(x)\,\rho_Y(z / x)\,\frac{1}{|x|}\,\mathrm{d}x, & Z = XY\end{cases}, $$calculated by numerical integration.
- Parameters:
-
- zarray_like
The quantiles $z$ of the combined pdf.
- pdf_1Callable
The pdf $\rho_X$ of the first random variate.
- pdf_2Callable
The pdf $\rho_Y$ of the second random variate.
- loc_1float
The
locparameter of the first pdf.- scale_1float
The
scaleparameter of the first pdf.- loc_2float
The
locparameter of the second pdf.- scale_2float
The
scaleparameter of the second pdf.- operatorstr
The operator that defines the new random variate $Z$. Can be either
"+"or"*".- nint
The precision of the numerical integration, which uses
2**nintervals.
- Returns:
-
- rho_zndarray
The value of the pdf $\rho_Z$ at the given
zquantiles.
- Raises:
-
- ValueError
If
operatoris not supported.