Affine combination of independent univariate random variables¶
Introduction¶
Let be the random vector defined as the affine transform of independent univariate random variables. More precisely, consider:
(1)¶
where is a deterministic vector with , is a deterministic matrix and are independent random variables. In this case, it is possible to directly evaluate the distribution of and then to ask any request compatible with a distribution: moments, probability and cumulative density functions, quantiles (in dimension 1 only)… In this document, we present a method using the Poisson summation formula to evaluate the distribution of .
Evaluation of the probability density function¶
Since, by hypothesis, the univariate random variables are independent, the characteristic function of , denoted , is easily defined from the characteristic function of denoted as follows:
(2)¶
for any . Once is evaluated, it is possible to evaluate the probability density function of , denoted : several techniques are possible, as the inversion of the Fourier transformation, but this method is not easy to implement. We can alternatively use the Poisson summation formula:
(3)¶
where and is the complex imaginary number, i.e. . If are close to zero, then:
and:
because of the decreasing properties of . Thus the nested sums of the left term of (3) are reduced to the central term : the left term is approximately equal to . Furthermore, the right term of (3) is a series which converges very fast: few terms of the series are enough to get machine-precision accuracy. Let us note that the factors , which are expensive to evaluate, do not depend on and are evaluated once only.
It is also possible to greatly improve the performance of the algorithm by noticing that the equation is linear between and . We denote by and respectively the density and the characteristic function of the multivariate normal distribution with the same mean and same covariance matrix as the affine combination. By applying this multivariate normal distribution to the equation, we obtain by subtraction:
(4)¶
where , and . In the case where , using the limit central theorem, the law of tends to the normal distribution density , which will drastically reduce . The sum on will become the most CPU-intensive part, because in the general case we will have to keep more terms than the central one in this sum, since the parameters were calibrated with respect to and not .
The parameters are calibrated using the following formula:
where and , are respectively the number of standard deviations covered by the marginal distribution ( by default) and the number of marginal deviations beyond which the density is negligible ( by default). The parameter is dynamically calibrated: we start with then we double value until the total contribution of the additional terms is negligible.
Evaluation of the moments¶
The relation (1) enables to evaluate all the moments of the affine combination, if mathematically defined. For example, we have:
Computation on a regular grid¶
We want to compute the density function on a regular grid and to get an approximation quickly. The regular grid is:
for all and . Denoting :
for which the term is the most CPU consuming. This term rewrites:
with:
The aim is to rewrite the previous expression as a - discrete Fourier transform, in order to apply Fast Fourier Transform (FFT) for its evaluation. We set and and . For convenience, we introduce the functions:
We use instead of in this function to simplify expressions below. We obtain:
For performance reasons, we want to use the discrete Fourier transform with the following convention in dimension 1:
which extension to dimensions 2 and 3 are respectively:
We decompose sums of on the interval into three parts:
(5)¶
If we compute for dimension , then the middle term in this sum is trivial.
To compute the last sum, we apply a change of variable :
This implies:
Thus:
To compute the first sum of equation, we apply a change of variable :
This implies:
Thus:
To summarize:
In order to compute sum from to , we multiply by and consider
In order to compute sum from to , we consider