Introduction
A common tool of casualty actuaries is the collective-risk model S = X1 + . . . + XN, according to which aggregate loss S is composed of a random number N of independent, identically distributed claims X. Although there are several techniques for deriving probability distributions for S, the discrete Fourier transform (DFT) is arguably the most elegant and powerful when severity X is both discrete and finite. However, it suffers from two drawbacks. First, its use of complex numbers may daunt some actuaries; certainly it does not easily program into a spreadsheet.[1] And, second, the finite support of S raises the issue of overflow, especially when the support of claim count N is unlimited. Since one can set an arbitrarily large common support for X and S, this issue is not a practical problem;[2] however, how the true distribution of S overflows the DFT-derived distribution is an interesting topic. Moreover, understanding the overflow issue may enable and encourage others to employ the DFT. It is to this end that we will start in Section 2 with the necessary complex algebra. From there, in Section 3 we will define abstractly the DFT as an invertible transformation (a finite matrix of complex numbers). Bringing in probability, we will in Section 4 derive the DFT of S = X1 + . . . + XN in terms of N and X. Finally, in Section 5 we will show what happens to overflow in the DFT, relating it back to the complex algebra of Section 2.
The nth roots of unity
Euler’s formula eiθ = cos θ + i sin θ forms the basis for the nth roots of unity.[3] The magnitude of z = eiθ is |z| = cos2 θ + sin2 θ = 1. Hence, eiθ is a point on the complex unit circle, and the function z(θ) = eiθ can be imagined as a point moving counterclockwise around this circle as θ increases. Plugging θ = 2π into Euler’s formula, we have ei • 2π = cos 2π + i sin 2π = 1. Since the circumference of a circle measures 2π radians, the exponential function is periodic along the imaginary axis.
Now consider the equation zn = 1, where n is a positive integer. For any integer k,
\[ \left(e^{i \frac{2 \pi k}{n}}\right)^{n}=e^{i \frac{2 \pi k}{n} n}=e^{i \cdot 2 \pi k}=\left(e^{i \cdot 2 \pi}\right)^{k}=(1)^{k}=1 \]
So numbers of the form [4] since
are nth roots of unity. Furthermore, since within this formally infinite set only n elements are distinct, viz., for k ∈ {0, 1, . . . , n − 1}. Multiplication of roots of unity involves modular arithmetic,\[ \begin{aligned} \omega_{k} \omega_{l}=e^{i \frac{2 \pi k}{n}} e^{i \frac{2 \pi l}{n}}=e^{i \frac{2 \pi(k+1)}{n}}= & \omega_{k+l}=\omega_{\bmod (k+l, n)} \\ & \Rightarrow k+1 \equiv \bmod (k+l, n) . \end{aligned} \]
Because an nth degree polynomial has at most n distinct roots,[5] there can be no other nth roots of unity.
The operation of multiplication on G, the set of the nth roots of unity, constitutes an algebraic group (Clark 1984, 17f). In addition to closure (if a, b ∈ G, then a · b ∈ G), multiplication on G has the three defining properties:
-
∀a, b, c ∈ G (a · b) · c = a · (b · c)
-
∃e ∈ G : ∀a ∈ G a · e = e · a = a
-
∀a ∈ G ∃b ∈ G : a · b = b · a = e
The properties are (1) associativity, (2) identity existence, and (3) inverse existence. That multiplication is associative hardly needs to be mentioned. The identity element is ω0 = 1. Abstractly, the identity element must be unique, for if e1 and e2 satisfy the identity property, then e1 = e1 · e2 = e2. Similarly, the inverse of an element must be unique, for, if both a · b1 = b1 · a = e and a · b2 = b2 · a = e, then
\[ b_{1}=b_{1} \cdot e=b_{1} \cdot\left(a \cdot b_{2}\right)=\left(b_{1} \cdot a\right) \cdot b_{2}=e \cdot b_{2}=b_{2} . \]
For group
the inverse of is the third part of the equation applies to the identity element: But, again from Euler’s formula:\[ \begin{aligned} \omega_{k}^{-1}=e^{-i \frac{2 \pi k}{n}} & =\cos \left(-\frac{2 \pi k}{n}\right)+i \sin \left(-\frac{2 \pi k}{n}\right) \\ & =\cos \left(\frac{2 \pi k}{n}\right)-i \sin \left(\frac{2 \pi k}{n}\right)=\bar{\omega}_{k} . \end{aligned} \]
This means that the inverse of a root of unity is its complex conjugate.
Of all the
roots of unity, is the principal, from which the others can be derived by exponentiation We will often drop the subscript from the principal root and designate all the roots as The value of will be understood; however, were it forgotten, it could always be reclaimed as the smallest positive integer for whichFinally, as to the sum of the nth roots of unity:
\[ (\omega-1) \sum_{k=0}^{n-1} \omega^{k}=\sum_{k=1}^{n} \omega^{k}-\sum_{k=0}^{n-1} \omega^{k}=\omega^{n}-\omega^{0}=1-1=0 . \]
Either ω = 1 or
But the principal root is unity if and only if n = 1. Hence\[ \sum_{k=0}^{n-1} \omega^{k}=\left\{\begin{array}{ll} 1 & \text { if } n=1 \\ 0 & \text { if } n>1 \end{array} .\right. \]
Intuitively, the formula for n > 1 is obvious from the equal dispersion of the roots about the circle; the origin is the center of their mass.[6]
The discrete Fourier transform
The DFT is simply an n × n matrix Ω involving the nth roots of unity ωk. The jkth element of Ω is ωj • k. As in the previous section, ω is the principal nth root of unity, and the indexing starts at zero. Define the two n × 1 vectors:
\[ \mathbf{n}=\left[\begin{array}{c} 0 \\ \vdots \\ n-1 \end{array}\right] \text { and } \mathbf{p}=\left[\begin{array}{c} p_{0} \\ \vdots \\ p_{n-1} \end{array}\right] \]
The DFT of
is Understanding the exponentiation as elementwise, we can express this as which matrix is symmetric. But it is unnecessary to perform the exponentiation on Due to the cyclicality of the multiplication, the elements of can be reduced modulo to the set at which point they are just as much -root subscripts as they are exponents. In sum,To reclaim vector
one needs the inverse DFT, or whose existence we will now show. Define the conjugate of matrix or as the matrix of the conjugated elements of According to Section 2 , the conjugate of a root of unity is the inverse of the root. So the element of is Since is symmetric, so too is Now the element of is the dot product of the row of and the column of Hence:\[ [\overline{\mathbf{\Omega}} \boldsymbol{\Omega}]_{j k}=\sum_{l=0}^{n-1} \bar{\omega}_{j l} \omega_{t k}=\sum_{l=0}^{n-1} \omega_{j l}^{-1} \omega_{l k}=\sum_{l=0}^{n-1} \omega^{-j l} \omega^{k}=\sum_{l=0}^{n-1}\left(\omega^{k-j}\right)^{l} . \]
The formula for the geometric series gives us
\[ \begin{aligned} {[\overline{\mathbf{\Omega}} \boldsymbol{\Omega}]_{j k} } & =\sum_{l=0}^{n-1}\left(\omega^{k-j}\right)^{l} \\ & =\left\{\begin{array}{ll} n & \text { if } \omega^{k-j}=1 \\ \frac{\left(\omega^{k-j}\right)^{n}-1}{\left(\omega^{k-j}\right)-1} & \text { if } \omega^{k-j} \neq 1 \end{array}=\left\{\begin{array}{ll} n & \text { if } \omega^{k-j}=1 \\ 0 & \text { if } \omega^{k-j} \neq 1 \end{array} .\right.\right. \end{aligned} \]
But
if and only if Since if and only if So, finally,\[ [\overline{\boldsymbol{\Omega}} \boldsymbol{\Omega}]_{j k}=\left\{\begin{array}{ll} n & \text { if } j=k \\ 0 & \text { if } j \neq k \end{array} \Rightarrow \overline{\boldsymbol{\Omega}} \boldsymbol{\Omega}=n \mathbf{I}_{n} .\right. \]
And since both [7]
and are symmetric, Therefore, is invertible:The discrete Fourier transform as a characteristic function
The relevance of the previous two sections will become clear in connection with the characteristic function, which is a moment generating function (mgf) with an imaginary argument. The characteristic function of any real-valued random variable
or is Because the characteristic function, unlike the mgf, always converges. However, since here we are concerned with discrete and finite random variables, whose mgfs do converge, this is of no advantage. Its advantage here lies in the simplicity and accuracy of its inversion.First, we give a probability interpretation to vector
of Section 3. The element of will be the probability for random variable to equal : So now the elements of must be non-negative real numbers whose sum is unity. Second, we define for These values of are the radian measures on the unit circle of the roots of unity, so Accordingly,\[ \varphi_{x}\left(t_{j}\right)=E\left[e^{i t_{j} X}\right]=\sum_{k=0}^{n-1} e^{i t_{j} k} p_{k}=\sum_{k=0}^{n-1}\left(\omega_{j}\right)^{k} p_{k}=\sum_{k=0}^{n-1} \omega^{j k} p_{k} . \]
The last expression is the
element of the matrix product In fact, defining as the vector whose element is and applying elementwise, we have Therefore, the DFT is a discrete form of the characteristic function, from which one can reclaim the probabilities asEven so, it seems that we are just playing games, jumping from probabilities to the characteristic function and back again. Must not one know the probabilities before knowing the characteristic function? The answer is “Not necessarily.” The collective-risk model is a case in point, for if S = X1 + . . . + XN:
\[ \varphi_{s}(t)=E\left[e^{i s}\right]=E\left[e^{i\left(X_{1}+\cdots+x_{N}\right)}\right]=E\left[\prod_{k=-}^{N} e^{i x_{k}}\right] . \]
Separate N from the X variables by conditional expectation:
\[ E\left[\prod_{k=1}^{N} e^{i x_{k}}\right]=\underset{N}{E}\left[E\left[\prod_{k=1}^{N} e^{i i x_{k}} \mid N\right]\right]=\underset{N}{E}\left[\prod_{k=1}^{N} E\left[e^{i i x_{k}}\right] \mid N\right] . \]
Finally, simplify due to the identical distribution of the X variables:
\[ \begin{aligned} \underset{N}{E}\left[\prod_{k=1}^{N} E\left[e^{i X_{k}}\right] \mid N\right] & =\underset{N}{E}\left[\prod_{k=1}^{N} \varphi_{X}(t) \mid N\right] \\ & =\underset{N}{E}\left[\varphi_{x}(t)^{N} \mid N\right]=E\left[\varphi_{x}(t)^{N}\right] \end{aligned} \]
Therefore, Heckman and Meyers (1983, 34), Klugman, Panjer, and Willmot (1998, 316), and Wang (1998, 864). The point is made: one can obtain the characteristic function of without knowledge of its probabilities, and by DFT inversion (i.e., ) work back to the probabilities.
in agreement withIf [8] We will check it for In this case an vector of ones, and which contains the row averages of Its element is
is a constant, or then and Therefore, This is the formula for the convolution of which holds for any non-negative integer\[ \begin{aligned} {\left[\mathbf{p}_{s}\right]_{j} } & =\frac{1}{n} \sum_{l=0}^{n-1} \bar{\omega}_{j l}=\frac{1}{n} \sum_{l=0}^{n-1} \omega^{-j l}=\frac{1}{n} \sum_{l=0}^{n-1}\left(\omega^{-j}\right)^{l} \\ & =\frac{1}{n}\left\{\begin{array}{ll} n & \text { if } j=0 \\ \frac{\left(\omega^{-j}\right)^{n}-1}{\omega^{-j}-1} & \text { if } j>0 \end{array}\right. \\ & =\left\{\begin{array}{ll} 1 & \text { if } j=0 \\ 0 & \text { if } j>0 \end{array}\right. \end{aligned} \]
So Prob[S = 0] =1, as it must.
Again, if
In this case and\[ \varphi_{s}(t)=E\left[\varphi_{X}(t)^{N}\right]=E\left[\left(e^{i t}\right)^{N}\right]=E\left[e^{i N}\right]=\varphi_{N}(t) . \]
This means that
is distributed as in the realm of the DFT,In general, (Klugman, Panjer, and Willmot 1998, 201) and denoted as Therefore, Klugman’s Appendix B contains the probability generating functions of many claim-count distributions, and our purpose here does not require us to duplicate his and others’ work. So we turn at last to the overflow problem.
is called the probability generating functionThe discrete Fourier transform and overflow
Example 4.11 of Klugman, Panjer, and Willmot (1998, 319f) demonstrates the use of the DFT to obtain the distribution of where is Poisson-distributed with a mean of 3 , and The demonstration is performed twice, once over the support and once over the support For the first support, for the second, The purpose of the twofold demonstration is to show the importance of choosing a value for large enough for the overflow to be negligible. Having replicated his calculations, we present the results in Table 1.
Klugman remarks:
. . . all the entries for n = 4,096 are accurate to the five decimal places presented. On the other hand, with n = 8, the FFT gives values that are clearly distorted. If any generalization can be made it is that more of the extra probability has been added to the smaller values of S. [p. 319]
In other words, the values for n = 8 are distorted by the overflow, but the lower the value of s, the greater the error. This is true enough, but more generalization can be made.
The probability for S to exceed 7, or to overflow the procedure for n = 8, is about 17.7 percent. The remarkable point is that the DFT preserves all the probability, regardless of n. Why does it not simply cut off accurately at s = 7? Instead, it compresses all the probability into the eight values. The explanation will appear from the following example.
Starting with a Bernoulli(0.5)-distributed X, we derived its next four convolutions and display them in Table 2. The probabilities of C(n) are binomial(n, 0.5).
Next, we calculated those probabilities according to the DFT with n = 4. Accordingly,
\[ \begin{array}{c} \mathbf{n}=\left[\begin{array}{l} 0 \\ 1 \\ 2 \\ 3 \end{array}\right] \mathbf{p}_{x}=\left[\begin{array}{l} 0.5 \\ 0.5 \\ 0.0 \\ 0.0 \end{array}\right] \\ \boldsymbol{\Omega}=\left[\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & i & -1 & -i \\ 1 & -1 & 1 & -1 \\ 1 & -i & -1 & i \end{array}\right] \quad \mathbf{\Omega}^{-1}=\frac{1}{4}\left[\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -i & -1 & i \\ 1 & -1 & 1 & -1 \\ 1 & i & -1 & -i \end{array}\right] \end{array} \]
Hence, Table 3 shows the DFT result.
As expected, C(2) and C(3) agree. But overflow begins with C(4), and the form of the overflow is cyclical. What should have been in the k = 4 row added to the k = 0 row; what should have been in the k = 5 row added to the k = 1 row.
The DFT cannot ignore overflow; rather it must recycle it. Instead of calculating probabilities for S = X1+ . . . + XN, it calculates them for mod(S, n). Its arithmetic is as modular as that of the G group of Section 2:
\[ \omega_{k} \omega_{l}=\omega_{k+l}=\omega_{\bmod (k+l, n)} \Rightarrow k+l \equiv \bmod (k+l, n) . \]
Alternatively, one may imagine the support to be infinite, over the set of natural numbers
However, there is no least root of unity; one must settle for some finite and its principal root. So to match the roots of unity with the natural numbers, one must cycle endlessly through The roots of unity are like ID variables according to which the probabilities may be summarized, as in the summation:\[ \sum_{k=0}^{\infty} \omega^{k} p_{k}=\sum_{k=0}^{\infty} \omega^{\bmod (k, n)} p_{k}=\sum_{k=0}^{n-1}\left(\omega^{k} \sum_{\bmod (l, n)=k} p_{l}\right)=\sum_{k=0}^{n-1}\left(\omega^{k} p_{k}^{*}\right) . \]
Summarizing the n = 4,096 probabilities of Table 1 according to mod(s, 8) will produce the n = 8 probabilities.
Conclusion
Many actuaries have neither the temperament nor the fortitude to penetrate the thicket of Σ operators found in many treatments of the DFT. Hopefully, they will find this treatment gentler, starting as it does with the nth roots of unity. The addition of a dash of group theory, about which much more could be said,[9] is suggestive of the modular arithmetic underlying the DFT and of the behavior of any overflow. The magic[10] of the DFT is not dispelled by its being opened to examination. But to those who understand the preceding sections of this paper, any impediments to working DFT magic will pertain only to computer hardware and software.[11]
The Analysis ToolPack of Excel allows one to work with complex numbers, as well as to perform a Fourier analysis through the menu “Tools/Data Analysis.” But a matrix language with built-in complex arithmetic is far preferable.
It becomes a practical problem if it involves limitations to computing speed, memory, and accuracy, which are limitations we will ignore here. The fast Fourier transform (FFT) is a remarkable algorithm for reducing, but not eliminating, them.
See in References the Wikipedia articles on “Euler’s formula” and “roots of unity.” No complex analysis will be used in this paper, but we presume the reader to be proficient in complex algebra.
More accurately, such multiplication is the basis of modular arithmetic. It has enriched the concept in classical number theory of congruence modulo n, i.e., p ≡ q mod n, and made complex analysis, culminating in the Riemann zeta function, essential to modern number theory.
See Wikipedia, “Fundamental theorem of algebra,” for a history of the attempts to prove this. The article disputes the opinion of most mathematical historians that Gauss in his 1799 doctoral dissertation produced the first rigorous proof. Appendix D of Havil [2003], “Complex Function Theory,” a readable introduction to complex analysis, contains an elegant proof of one version of the theorem, viz., that every finite polynomial with complex coefficients has a complex root (pp. 241f). Induction completes the proof: If r is a root, factoring z − r out of the polynomial leaves a polynomial for solution whose degree is one less.
Alternatively, according to the theory of equations, the sum of the roots of zn + a1z*n*−1 + . . . + an = 0 equals −a1. Since the ω*k* are the roots of the equation zn − 1 = 0, they sum either to one (if n = 1) or to zero (if n > 1).
One could define the DFT as
in which case Ω−1 would simply be Ω. But we have kept the standard definition, on account of which one must be careful to include the 1/n factor.Even fractional convolutions make sense. The half convolution of X is a distribution of a random variable whose second convolution is the distribution of X. If X can be formed from a second convolution, the DFT will yield the correct result. For example, if p*X* = [0.25 0.50 0.25]′, then
If X cannot be so formed and n is large enough (p*X* right-padded with zeros), non-zero probabilities will appear beyond max(X), even though all the probabilities will sum to unity. Moreover, when the convolution is impossible, negative probabilities may arise.The properties of an algebraic group ensure that for any element a of group G, a ⋅ G and G ⋅ a are in one-to-one correspondence with G. Because of this, group theory is all about shifts, cycles, or rotations, especially for finite groups. Moreover, a finite group with a generating element (i.e., an element by repeated operations on which all the elements of G can be generated, such as a primitive root of unity) has a counting mechanism, from which a modular arithmetic can be developed. One who understands this can apply the DFT to abstractions of {0, 1, . . . , n − 1}.
A friend of the author and former colleague, James C. Sandor, FCAS, MAAA, who introduced the Fourier transform into his company’s pricing models, never tires of saying, “The Fourier transform works like magic.”
After this paper was reviewed and revised, the author was made aware of the paper, “Panjer Recursion versus FFT for Compound Distributions,” by Paul Embrechts and Marco Frei (2007). On page 8, the authors wrote, “Compound mass which lies at M and beyond will be ‘wrapped around’ and erroneously appears in the range 0, . . . , M − 1. For severities with considerable tail mass, the truncation and wrap-around error (the so-called aliasing error) can become quite an issue.” Although they did not explicitly claim the wrapping around to be modulo M, it is likely that they so understood it. Also, they called DFT overflow “aliasing” by analogy with a problem in signal processing (cf. Wikipedia, “Aliasing”).