You are on page 1of 29

COMPUTATIONAL METHODS FOR COMPOUND SUMS

(With application to portfolio Credit Risk models)





Raghav Ohri
H00117202




August 2012




Actuarial Mathematics and Statistics
School of Mathematical and Computer Sciences

Dissertation submitted as part of the requirements for the
award of the degree of MSc in Actuarial Science


Acknowledgements
I would like to thank Prof. Alexander McNeil for all the support he has given me through the
period of this project. I would also like to extend thanks to my team partner Ahmed Sabeel
for providing such focus and guidance for the past few months. I would like to thank my
friends for their love and support. I owe many thanks to the giants on whose shoulders I can
barely peek. And last but not the least, my parents without whose many sacrifices I would
never have been anywhere close to pursuing my passions.


Abstract

A compound sum is the sum of a random number of independent and identically distributed
claim or loss amounts and is a standard model for aggregate losses in many applications in
risk management including non-life insurance, credit risk and operational risk.

There are a number of approaches to computing or approximating the distribution of a
compound sum, including moment matching, Fourier inversion, Panjer recursion and Monte
Carlo methods. The initial objective of this project is to survey some of these and implement
them in R with appropriate examples.

We will then consider specifically how the methods might apply to credit risk models. First,
it is explained how actuarial models and techniques are used in credit risk. Then, the specific
methods of the CreditRisk
+
model are considered. In particular we build a toy version of
CreditRisk+ in R, which would allow us to compute the portfolio loss distribution and key risk
measures like VaR and expected shortfall.



Table of Contents
1. Introduction to the project
2. Compound Sums
2.1. Introduction to Compound Sums
2.1.1. The model
2.1.2. Distribution of S
N

2.2. Methods of Evaluation
2.2.1. Panjer Recursion
2.2.2. Fourier Inversion
2.3. Examples of Implementation and Results
3. Credit Risk
3.1. Introduction to Credit Risk
3.2. Applications of Compound sums and the CreditRisk
+
Methodology
3.2.1. Independent Obligors
3.2.2. Sector Model
3.2.3. Randomness of the rate of default
3.2.4. Distribution of default events
3.2.5. Distribution of default losses for a portfolio
3.3. Algorithm for Basic Model using FFT
3.4. Algorithm for 1 Sector Model using FFT
3.5. Example of Implementation and Results
4. Conclusion
5. Appendix
6. References



1. Introduction to the project
In the field of actuarial risk theory, the concept of compound sums is a crucial one for
finding the distribution of the total claim amount in a set of insurance contracts. The
applications of these methods have been found in quantitative financial risk management as
well, where the Credit Risk+ methodology utilizes this method in finding the distribution of
the aggregate credit portfolio losses.
Compound sums consist of two separate distributions for the number of losses and the
severities of the losses. The direct computation of this sum is generally not simple and thus
methods have been developed over the years to do this. We focus on two methods- the
Panjer recursion and the Fast Fourier transform (FFT). Later, we apply these in examples and
compare them.
After implementing the above methods in R, we proceed to apply the FFT in Credit Risk+.
Credit Risk + is a credit risk mixture modelling framework widely used in the industry. The
Credit Risk+ model uses background factors (state of economy for example) which influence
default rates by using sectors to divide the obligors into groups influenced by similar factors
in certain times. Using a data set with the program in R, we find the portfolio loss
distribution, the value at risk at different percentiles and the expected shortfall.



2. Compound Sums
2.1. Introduction to Compound Sums
2.1.1. The Model
Compound sum models in non life insurance are used to develop models for aggregate
losses. Aggregate losses when independent and identically distributed can be represented
by the following formula-
1 2
....
N N
S X X X = + + + ( 0,1, 2... & 0
N
N S = = when N=0)
which can be written as:
1
N
N i
i
S X
=
=


Where:
N
S - Sum denoting the aggregate losses
X
1,
X
2
X
N
etc Individual claim amounts
N Number of claims

There are two assumptions made in the above model- { }
0
N
i
i
X
=
is a series of independent
and identically distributed random variables and that random variable N is independent of
{ }
0
N
i
i
X
=
.
In terms of notations, we introduce additional notations for the distributions themselves.
We let F denote the claim severity distribution and Q the frequency distribution. The
distribution of S
N
is a compound distribution of F under Q, or Q F v .
2.1.2 Distribution of SN:
Let G(x) = Pr ( )be the distribution function of aggregate claims and F(x) = Pr (X
1
)be
the distribution function of the individual claim amounts.
Let p
n
= Pr(N = n) so that

is the probability function for the number of claims.




The event { S } takes place if n claims occur, n = 0, 1, 2... and if the sum of these claims is
less than x. Therefore, the above event can be denoted as follows-
= { = }

=0

Therefore, G(x) = Pr ( ) = Pr{ = }

=0

Pr{ = }

=0
= Pr{ | = }

=0
.Pr (N = n)
Pr{ | = }

=0
= Pr
( )
*
1
( ).
n
n
i
i
X x F x
=
s =


Thus for x0,

The above equation seems to be a method for providing the distribution for the aggregate
loss. However, the convolution
* n
F does not exist in a closed form for many individual claim
amounts distributions of practical interest such as Pareto and lognormal. Even in cases
when a closed form does exist, the distribution function in the above equation needs to be
evaluated as a compound sum.
Despite the complications involved in their calculation, aggregate loss models are quite
useful in non life insurance for a number of reasons- to make up for the growth in business
by changing the expected number of claims, to include the effects of inflation and claims
inflation (due to weather conditions, say), ease in making changes in deductibles and other
policy variables, all of the above resulting in a more accurate and flexible model. (Klugman,
Panjer, & Willmot, 2004) Also, these models are computationally efficient and closer to
reality. (Kaas, Goovaerts, Dhaene, & Denuit, 2008)
In cases where direct calculation is not possible, there are a few ways of finding out the
distribution of the compound sum- Moment matching, approximation, recursion and
inversion. Each of these has its own set of advantages and disadvantages, but this paper
shall only be comparing a recursive method- the Panjer Recursion, with an inversion
method- the Fast Fourier transform.
*
0
( ) ( )
n
n
n
G x p F x

=
=



Both the Panjer recursion as well as the Fast Fourier transform work on discretised severity
distributions. However, since these distributions are normally continuous in nature, an
essential part of the method is to discretise these distributions at intervals. If these intervals
(or bandwidths) are suitably small, the approximations give fairly accurate results.
The discretised function can be found by the rounding method or the forward/backward
difference method, both described by the formulae below-
Rounding Method:
,
( / 2) ( / 2)
h j
f F jh h F jh h = + ;
,
( / 2) ( / 2)
h j
f F jh h F jh h = +
Where F
h
tends to F as h tends to 0. Therefore, Q V F
h
tends to Q V F as h tends to zero.
Forward Difference:

,
(( 1) ) ( )
h j
f F j h F jh
+
= +
Backward Difference:
,
( ) (( 1) )
h j
f F jh F j h

=
From the above equations, Q V F
h
+
gives the upper bound for Q V F and Q V F
h
-
gives the
lower bound. Thus the true compound distribution lies between the two distributions listed
above. (Embrechts & Frei, 2009)
2.2 Methods of Evaluation
The computational methods for finding the distribution of these compound sums discussed
in the paper are the Panjer method (recursion methodology) and the Fast Fourier transform
(inversion method). Further, the Panjer recursion and the FFT are implemented in R.
2.2.1 Panjer Recursion

The 1981 paper Recursive Evaluation of a Family of Compound Distributions by Harry
Panjer describes a method for recursive calculation of the probabilities of g(x). Since
recursion can be performed quite easily by computer programming, Panjer recursion
became a very important part of the risk theory basis and replaced the existing convolution


or empirical based methods as a method of choice for a set of distributions. The recursion is
as follows:
Consider a compound distribution with integer-valued non-negative claims with pdf p(x),
x=0,1,2..., for which, for some real a and b, the probability g
n
of having n claims satisfies the
following recursive relation
1 n n
b
q a q
n

| |
= +
|
\ .

, n=1,2..
Then the following relations for the probability of a total claim equal to s hold:
0 =
Pr = 0 0 = 0

(log(0)) (0) > 0


1
1
( ) ( ) ( )
1 (0)
s
h
bh
g s a p h g s h
ap s
=
| |
= +
|

\ .

, s=1,2...and h is a suitable monetary interval


(Kaas, Goovaerts, Dhaene, & Denuit, 2008)
The complete proof for the above can be found in (Panjer, 1981) or (Kaas, Goovaerts,
Dhaene, & Denuit, 2008).
The Poisson, Negative Binomial and the Binomial distributions are found to be applicable for
the Panjer recursion. The Panjer recursion is easy to implement and is less intense
numerically than convolution, which asymptotically requires O(n
3
) operations to obtain
g
0,...
g
n
compared to the O(n
2
) complexity in the Panjer case. (Embrechts & Frei, 2009)
Computational problems can occur in the Panjer recursion- especially in the compound
binomial case especially where terms with mixed signs come up throughout the recursion.
However the values of g
n
are bound within a small error bound for Poisson and Negative
Binomial distribution. The recursion starts with the calculated value Pr = 0 =

0]. For large insurance portfolios, this probability is very small, sometimes smaller
than the smallest number that can be represented on the computer. (Klugman, Panjer, &
Willmot, 2004) When this occurs, this initial value is represented by the computer as zero
and the recursion fails since further values are based on the first one. The problem of
underflow is solved by the following relationship for Compound Poisson distributions:


*
( ( / ) ) ( )
m
Pois m F Pois F v = v
For a fairly large m, ( / ) Pois m F v can be calculated without underflow. (Embrechts & Frei,
2009).
Algorithm for Panjer Recursion:
1. Define a step size for discretization (h)- as mentioned above, the smaller the step
size, the more accurate the final result. It should be noted that for monetary
applications, the Panjer recursion needs severities in terms of monetary units
(0,1,2..,m)
2. Discretize the distribution vector for the severity distribution f(x). In the example
considered, we generate a Pareto distribution and discretize it through steps of h till
a certain maximum value which is the largest possible payment. This could be infinite
in general insurance but will be finite in credit risk (since the exposure is limited to
the loss of the entire portfolio), however improbable that is.
If the frequency distribution is already discrete, then simply pad the vector with
enough zeroes on the right of the maximum claim size till a maximum value which is
the largest possible payment.
(Klugman, Panjer, & Willmot, 2004)
3. Define the first value of the aggregate claim (0) [ (0)]
N X
g P f =
4. Within a loop, define a corresponding value to g for every value of f, using the
previous value of f in a recursive fashion.

If the frequency distribution satisfies
1 k k
b
p a p
k

| |
= +
|
\ .
, k1,a,bR
Then the following result holds for g
r=
Pr(S
N
=n):
| |
1 0
1
( ) ( ) ( / ) ( ) ( )
1 (0)
r
X x
y
r
x
p a b p f x a by x f y g x y
g
af
=
+ + +
=


For the purposes of credit risk and for most general insurance purposes, the Poisson
distribution is most useful. The above equation reduces in case of the Poisson
distribution with parameter to:

1
( ) ( )
r
r x
y
g yf y g x y
x

=
=



With:
0 0
( )
N
g P f =

The result from the above is the compound distribution and can be represented by graphs
and the Value at Risk percentiles can be found easily for this.
2.2.2. Fast Fourier Transform

The Fast Fourier transform algorithm is used for inverting the characteristic function to
obtain the densities of discrete random variables.
We denote the probabilities by:
Pr[ ]
h
p X h = = ; Pr[ ]
n
q N n = = ; Pr[ ]
s
f S s = =
In a banking or insurance set up, with long tailed securities, i.e. high aggregate losses with
low probabilities, in order to determine the 99.9% quantile of a compound distribution with
Pareto severity, as is often required in the calculation for regulatory capital, the Panjer
recursion will require several (ten) thousand knots of processing. Compared to this, the
inversion method the Fast Fourier transform has two advantages- it works with arbitrary
frequency distributions and it is much more efficient. To find
0
,....,
n
g g , FFT takes ( log ) O n n
operations compared to
2
( ) O n operations for the Panjer recursion. (Embrechts & Frei, 2009)
The FFT was originally used in the field of signal processing and found application in the
inversion of the characteristic function of compound distributions only later. The definition
of a Fourier transform is-
A continuous distribution f(x) can be transformed by the Fourier transform by
( ) ( )
izx
f z f x e dx
+

=
}


The inverse of which can be found by the following relation-
1
( ) ( )
2
izx
f x f z e dz
t

=
}




In our applications, f(x) is real valued while ( ) f z

is a complex valued variable.


Cumulative losses can be represented by their characteristic function as follows-
1
( ... ) ( )
( ) [ ] [ [ | ]]
[ ( ) ] ( ( ))
N
it X X it Z
z N
N
N X N X
t E e E E e N
E t P t
|
| |
+ +
= = =
= =

Where P
N
is the probability generating function of N.
Algorithm for Fast Fourier Transform:
1. Choose a value of n such that it is the number of points that fit the distribution of
cumulative losses, i.e. the probability of loss beyond n is nearly zero. In case of
non life insurance, this is more complex, however in credit risk, the losses are
limited by the portfolio value itself which is quite elementary to calculate.
If the severity distribution has no values beyond a point, the rest of it has to be
padded with zeroes till n.
2. The severity distribution f(x) has to be discretised into such that the discretised
severity vector [ (0), (1),...., ( 1)]
x x x
f f f f n =
3. Apply the FFT to the above severity vector such that ( )
x x
f FFT f =


4. Multiply each of the elements of the discretised FFT vector
x
f

by the probability
generating function of the frequency P
N
.
( )
z N x
f P f =


5. Apply the Inverse of the FFT to get the cumulative distribution losses
( )
z z
f IFFT f =


Here we divide the answer by M to get the normalized inverse discrete Fourier
transform.
(Melchiori, 2004) (Klugman, Panjer, & Willmot, 2004)

If there are severity probability values beyond n, then there is something known as an
aliasing error which creeps in during the FFT. This affects the initial results of the
distribution of aggregate losses. (Embrechts & Frei, 2009) Suggest the usage of a tilting


algorithm to remove this aliasing error and this can be seen in the examples covered in the
next section as well. However, this paper does not cover the aliasing error in much detail.
2.3 Examples of Implementation and Results
The Panjer and FFT methods for compound sum computation were coded as per the
algorithms given above in the R statistical package and some interesting results obtained.
- (20) (4, 3) Pois Pareto v

The figure on the left shows the M=2
8
, while the one on the right has M=2
10
. This
means both the Panjer and FFT severity vectors f are of length M. The black plot in
both is the Panjer recursion output, which is nearly accurate (with minor errors
coming with discretisation of the severity distribution). The FFT algorithm output is
plotted by the red line which clearly doesnt match the Panjer recursion output
when M=2
8
. The reason for this is the aliasing error touched upon earlier- due to
high tail probabilities beyond M (as is visible from the graph being cut off at 256),
these probabilities wrap around the initial output values and create an aliasing error
effect. Further details and the tilting method to combat this is discussed in
(Embrechts & Frei, 2009).
The figure on the right clearly has no tail beyond 2
10
and so the Panjer recursion and
the FFT outputs perfectly overlap each other. It is worth noting that the graph has a
long right hand tail which fits the description of expected losses in such portfolios
fairly well.
Running a timer on these two methods shows clearly the Panjer recursion taking at
least twice (and up to 4 times) as much time to compute the same number of results.


This matches the expectations for any recursion more than 256 steps. However the
time for nearly a thousand recursions is in tenths of a second so with todays
computer speeds, it will not make a large difference till hundreds of thousands of
iterations, when FFT & simulation methods may make more computational sense
than recursion. (Tiwari, 2010)
Percentiles
Aggregate Sum
by FFT
Aggregate Sum by Panjer
Recursion
0.95 339 339
0.975 378 378
0.99 430 430
0.995 471 471
0.9975 515 516
0.999 581 583

On observing the values of aggregate sums received from the above graph (M=2
10
), we can
see the value of the 99
th
percentile as fitting in well with the graph observed above. There is
a small difference between the percentile values for the FFT and Panjer recursion values,
with the error being brought about by the fact that the FFT is an approximation. (Embrechts
& Frei, 2009) refer to adjusting the step size to reduce this error till it is zero.


3. Credit Risk
3.1 Introduction to Credit Risk
Credit risk is the risk of default in a portfolio by an obligor or due to the downgrading of
their credit ratings. An obligor default may include inability to pay installments by a simple
debtor, a company which is unable to pay coupons on a loan or a bond or a general lack of
liquidity or insolvency. The financial obligation need not be monetary but can be a financial
obligation in any form.
Instruments subject to credit risk include loans, which can be secured such as mortgages, or
unsecured like a personal loan, bond coupons on debt, ordinary derivatives on which there
may be defaults due to inability of the counterparty to pay or credit derivatives which are
influenced directly by the credit risk they are meant to mitigate.

Portfolio Loss Distribution (Bluhm, Overbeck, & Wagner, 2010)
As can be seen in the graph above denoting the portfolio loss distribution, in order to
mitigate credit risk, some factors need to be calculated, the first being the distribution of
the expected losses, followed by the expected losses and its standard deviation. The
regulatory capital requirements need to be adjusted according to the exposures- this can be
evaluated by the distribution of the loss portfolio as well. If capital requirements work out
to be quite high then it may mean a diversification of risk is in order, or the invoking of
structured financial products such as CDOs is required.
Various regulatory rules (Basel II/III for banks and Solvency II for insurance companies) refer
to some form of capital needed to be maintained by banks and insurance companies to
hedge their liabilities, a loss-bearing buffer as such to ensure solvency over a year. Equity
capital is the shareholders capital in the company. Regulatory capital is maintained as per


regulatory rules for insuring operations can take place without issue. Economic capital is
maintained to ensure solvency over a one year horizon. (Bluhm, Overbeck, & Wagner,
2010)
3.2. Applications of Compound sums and the CreditRisk
+
Methodology
CreditRisk
+
(CR+) is a credit risk modeling methodology developed by Credit Suisse Financial
Products. (Credit Suisse Financial Products , 1997) It is based on a mostly actuarial method
of calculation of aggregate losses, by treating each default as a loss in non life insurance- a
rather unlikely event with a Poisson Mixture model. The exact distribution is one of a
Poisson mixture with the Poisson parameter Gamma distributed for each sector. CR+
methodology has become popular for two main reasons- one being the ease of calibration
and the lack of data required for the same, and the fact that the output is an exact
probability distribution which allows users to compute loss distributions quickly and fairly
precisely, something lacking in many other methods.
The probability generating function of the Poisson distribution is used in the modeling
framework of CR+ can be found as follows-
The probability density function is given by
Pr( ) ;
!
n
e
N n
n


= = for n=0,1,2
The probability generating function is equal to
1
( ) Pr( 0) Pr( 1) ..... Pr( )
n
N
P t N N t N n t = = + = + + =
=
0
!
n
n
n
e
t
n


From the Maclaurin expansion,
2
0
1 ....
2! !
n
u
n
u u
e u
n

=
= + + + =


We can rewrite the probability generating function as,


0
( 1)
( )
( ) .
!
( )
n
t
N
n
t
N
t
P t e e e
n
P t e

= =
=


In order to reduce the amount of data being considered and improve computational
efficiency, CR+ uses exposure bands to divide individual obligors into groups depending
upon their exposures. This is done by taking a value for exposure unit E. The exposure that is
subject to loss after default can be calculated as
i i i
E EAD LGD =
Where EAD
i
=Exposure at Default for obligor i
And LGD= Loss given default for obligor i
The exposure
i
v and the expected loss
i
c of obligor i in multiples of E is given as-
,
i
i
E
E
v =
i
i
EL
E
c =
From here on, CR+ assumes the exposure rounded to the nearest integer multiple of E. An
appropriate choice of E is essential for an approximation that is close enough to the real
values and also efficient enough to partition into
E
m exposure bands, where
E
m is
significantly lower than the original number of obligors m.
If every obligor has a default intensity
i
, which can be calibrated from the obligors one
year default probability PD
i
by the following formula-
log(1 )
i i
PD = ( 1,...., ) i m =
Using the additive property of Poisson expectations, since ~ ( )
i i
L Pois is [ ]
i i
E L = , the
expected number of defaults in exposure bands can be given by-
j i
i j

e
=


The expected loss in band j, denoted by
j
c can be given by


j j j
c v =
Here, an adjustment of the default intensities is made so that the original value of the
expected losses is preserved. This can be done by defining an adjustment factor
i
for every
obligor by
i
i
j
E
E

v
= (ij, j=1,.,m
E
)
And so a portfolios expected number of default events can be given by the equation below
1 1
E E
m m
j
PF j
j j
j
c

v
= =
= =


3.2.1. Independent Obligors
The Poisson model has one drawback, it accounts for multiple defaults in a single obligor,
albeit with a very small probability. This can thus be ignored and the Poisson loss
distribution tends to the real one. We begin with a portfolio of m independent obligors with
default risk Poisson with parameters
i
L .
When we group individual exposures
i
E into exposure bands j and assume the intensities
i
to include the adjustments by factors
i
, we ger a new loss variable
j i
L v , where losses
are measured in multiples of E. Since obligors are assumed to be independent, the number
of defaults L in the portfolio and L
j
in the band j also follow the Poisson distribution.
(because the convolution of independent Poisson variables yields a Poisson distribution)
~ ( ),
j i j
i j
L L Pois
e
=


j i
i j

e
=


For the number of defaults in exposure band j, j=1,,m
E
.
1 1
~ ( ) ( )
E E
m m
i j PF
j i j j
L L Pois Pois
= e =
= =


The corresponding losses are given by-


' '
j j j
L L v =

or respectively,
'
1 1
'
E E
j
m m
j j
j j
L L L v
= =
= =



Due to grouping of exposures
j
v e together, we can describe the portfolio loss by the
probability generating function of the random variable ' L

. Applying the convolution


theorem for generating functions (Credit Suisse Financial Products , 1997) and (Bluhm,
Overbeck, & Wagner, 2010), we get:
'
' '
0 1 1
'
0 0 1 1
( ) [ ]
[ ]
!
E E
j
j
E E
j j j j
j
m m
k
j j
L L
k j j
k
m m
k k
k k j j
G z G r L v k z
r L k z e z
k
v
v v

= = =

= = = =
= = P =
= P = =
[ [
[ [



1
( 1)
1
e
m
E
j
E j
j
j j j
m z
z
j
e
v
v


=

+
=

= =
[

3.2.2. Sector Model
Since the earlier basic model did not account for the standard deviation of the rate of
default being higher than the mean (as is the distribution in the Poisson case), we need to
account for this. CR+ does this by sector analysis- by assuming that the volatility of some
factors can influence a certain set of obligors in a certain way. These sectors can be
industries, countries, macroeconomic factors or rating classes. We assume that the volatility
of the default intensity of the obligors is related to the underlying factors and associated
with each of these sectors is a sector weight
1
0, 1
s
m
is is
s
w w
=
> =

, expressing for every s=1,m


s

that sector s has a fraction w
is
to contribute to the default intensity.
We rewrite the earlier equation for generating function of portfolio loss as-
1
( 1)
'
1
( )
exp( ( 1))
m
E
j
j
j
E
j
z
L
m
j
PF
j
PF
G z e
z
v

=

=

=
=


If we define the functions


( 1)
'
( )
PF
z
L
G z e

= and
1
( )
E
j
m
j
N
j
PF
G z z
v

=
=


We see that the generating function of the portfolio loss variable ' L

can be written as-


( ( ) 1)
'
'
( ) . ( ) e
PF N
G z
L N
L
G z G G z

= =


As we can see, the portfolio loss has a compound distribution, with one source of
randomness coming from the uncertainty of the number of defaults, and with the other
coming from the uncertainty of the exposure bands affected by L defaults. The function
( )
N
G z has distribution
Pr[ ]
j
j
PF
N

v

= = (j=1,,m
E
)
3.2.3. Randomness of the rate of default
As the distribution for number of defaults in a credit market is assumed poisson, the mean
of the number of defaults equals the standard deviation. However, this Poisson distribution
is found to be an underestimate of loss because of various factors. (mainly since the mean
default rate is lower when the economy is booming but higher when it is in recession)
One way of modeling this is to use a secondary mixing distribution, wherein the external
parameter controlling default is drawn from a distribution function such as the Gamma
distribution, and the severity of each external parameters is obtained from a Poisson
distribution. This model is named as a Mixed Poisson model where the parameter is
Gamma distributed with parameters and , which is effectively a negative binomial
distribution with parameters and o .
3.2.4. Distribution of Default Events
The Negative binomial distribution ( , ), , 0 NB o o >
Has the probability function
( ) 1
Pr( ) , 0,1, 2..
( ). ! 1 1
n
n
n
p N n n
n
o
o |
o | |
| | | | I +
= = = =
| |
I + +
\ . \ .



Where
( 1)
0
( )
x
x
e x dx
o
o


=
I =
}

And
2
2

o
o
= ;
2
o
|

=
And the probability generating function of which is:
( ) [1 ( 1)]
N
P t t
o
|

=
3.2.5. Distribution of default losses for a portfolio
The number of default events in CR+ results from a summing of negative binomial
distributions. However, the aggregate losses are a compound distribution for which we have
to calculate the probability generating function. To do so, we assume that loss events are
not independent but correlated to one another as the loss events all depend on some
external factor.
The gamma distribution has the probability function,
1
( ) , 0
( )
x
x e
f x x
o |
o
| o

= >
I

And has the following moment generating function-
( ) [ ] (1 )
tx
X
M t E e t
o
|

= =
If we consider n discrete random variables
1 2
, ,...,
N
N N N and assume there is a random
variable O such that:
( | ) ~ ( ), 1, 2,...,
j j
N Pois j n u u O= =
Let the variable O have the probability density function ( ) t u and a moment generating
function M
O
. The variables ( | )
j
N u are independent and distributed Poisson ( )
j
u for any
value of u O= . These have a joint conditional probability generating function of
1 1
1
[ ( 1) ... ( 1)]
,..., | 1 2 1
( , ,..., | ) [ ... | ]
n n
N
N t t N
N N n n
P t t t E t t e
u
u
u u
+ +
= O= =


Since
1
,...,
n
N N are unconditionally correlated (as they all depend upon O , the joint
unconditional probability generating function for
1
,...,
n
N N is given by
1
1
,..., 1 1
( ,...., ) [ [ ... | ]]
n
n
N N
N N n n
P t t E E t t
O
= O
=
1
[ ( 1) ... ( 1)] ( )
0
n
t t d
e
u t u u

+ +
}

1
1
[ ( 1) ... ( 1)] ( )
,..., 1 1
0
( ,..., ) ( ( 1) ... ( 1))
n
n
t t d
N N n n
P t t e M t t
u t u u
u

+ +
= = + +
}

=
1
[1 ( 1) .... ( 1)]
n
t t
o
| |


1
,..., 1
1
( ,..., ) [1 ( 1)]
n
n
N N n j
j
P t t t
o
|

=
=

(Melchiori, 2004)
3.3. Algorithm for Basic Model using FFT
We can describe the compound sum loss distribution of the portfolio using the Fast Fourier
transform as follows-
- Discretise the severity vector f into n dimensions, such that probability of x lying
outside f
n
is negligible. This ensures no aliasing error of the sort we have seen earlier.
- Building a probability vector for each band j, we get,
Pr( )
!
j n
j
e
n defaults
n


=
For 0,1, 2..., 2
r
n = and 1, 2, 3...,
E
j m =
- The loss distribution vector is derived using the FFT as follows-
1
( )
E
m
j
j
IFFT FFT f
=

`
)
[

(Melchiori, 2004)
3.4 Algorithm for 1 Sector model using FFT
As mentioned earlier, CR+ accounts for the high level of variations in mean default
probabilities by assuming a Poisson distribution for mean rate of default with the Poisson


parameter distributed with mean
A
P and standard deviation
A
P
o . CR+ specifically takes a
mean of 1 and standard deviation = 0.50. (Credit Suisse Financial Products , 1997)
The algorithm for calculation of the loss distribution for the entire portfolio is given below-
- Calculate the following variable parameters:
A
P
A
s
P
o
= ;
2
1
s
o = ;
2
1
s
| =
- The severity vector is constructed by taking the fraction of each severity factor by
the sum of all the factors:
0
( )
j
m
j
i
f j

=
=

; for j=1,2,3,,m
- Taking the FFT of the earlier vector,
( ) f FFT f =


- We apply the PGF to the FFT of the severity vector as shown below:
( )
1
1 1
m
z j
j
f f
o
|

=
( | |
=
( |
(
\ .



- Applying the Inverse FFT to recover the cumulative losses
( )
z z
f IFFT f =


3.5. Example of Implementation and Results
The severity vector considered in this
Taking a severity vector Mu=(2,4,2,3.3,1,5,7,1.1,0.80,10.40), the following aggregate claims
were obtained using FFT:



No sectors and Poisson Distribution of Losses 1 Sector model & Negative Binomial Distribution of Losses
As can be seen in the above graphs, aggregate losses differ even when considering the same
severity vectors. The introduction of the higher variability in the Poisson distribution by
giving the Poisson parameter a gamma distribution has resulted in fatter tails. This is
consistent with what we expect and we see this difference in the value at risk percentile
values as well.
Percentiles Basic Model
1 Sector
Model
0.95 306 466
0.975 321 529
0.99 338 608
0.995 351 666
0.9975 362 721
0.999 376 792
If we had assumed a constant Poisson parameter without the Gamma distribution, the
result in the 99.5% value at risk is starkly different from that of the Basic Model. This can
result in severe regulatory issues if not considered well.
Additional sectors introduced in this will give an even closer picture of the expected
aggregate losses- sectors could include industries, countries, economic criteria or even
credit ratings. Including these factors will account for higher correlation of defaults and will
push up the value at risk for each percentile slightly higher, depending on the level of
correlation between obligors.


4. Conclusions
The application of compound sums in credit risk, through the implementation of Credit
Risk+ has been done in this paper. First, the compound sums model and distributions were
studied. Two methods for evaluation of compound sums have been studied in detail, the
Fast Fourier Transform and the Panjer recursion, and the Panjer recursion found to be
slower for a large number of obligors, as found in general insurance or credit risk. The FFT is
found to be an efficient algorithm and fairly accurate for large number of obligors as well.
However, it is shown that care needs to be taken in the input variables of the aggregate
sums using FFT, as computational problems are seen to occur due to underflow or aliasing
errors.
Next, credit risk theory was touched upon and the application of compound sums in credit
risk seen. The Credit Risk
+
model was studied as an application of compound sums and the
various algorithms for basic and dependent models experimented with. The implementation
of these models was done in R and positive results obtained. The graphs of the two
algorithms were compared and found to match the expected aggregate loss distribution
graphs. The Value at risk for both of these were compared as well and it is found that the
Poisson mixture model was found to be a more appropriate fit for the aggregate losses than
the Poisson model.


5. Appendix
R Code for finding compound sums using Panjer Recursion and FFT:
tic <- function(gcFirst = TRUE, type=c("elapsed", "user.self", "sys.self"))
{
type <- match.arg(type)
assign(".type", type, envir=baseenv())
if(gcFirst) gc(FALSE)
tic <- proc.time()[type]
assign(".tic", tic, envir=baseenv())
invisible(tic)
}
toc <- function()
{
type <- get(".type", envir=baseenv())
toc <- proc.time()[type]
tic <- get(".tic", envir=baseenv())
print(toc - tic)
invisible(toc)
}
#tic toc are timer functions similar to those used in MATLAB

h=0.1; M=2^10; lambda=20; alpha=4; beta=3;
#discretized severity vector, adjust function for different inputs
f <- discretize(ppareto(x,alpha,beta), from=0, to=M*h, by=h,method="rounding")
#FFT
tic()
fhat <- fft(f, inverse=FALSE)
P <- exp(lambda*(fhat-1))
g <- 1/M*fft(P, inverse=TRUE)
toc()

#Panjer Recursion
tic()
gp <- vector(length=M)
gp[1] <- exp(lambda*(f[1]-1))
for(n in 1:(M-1)){
gp[n+1] <- sum(lambda*(1:n)/n*f[(1:n)+1]*gp[n-(1:n)+1])
}
toc()

plot(Re(g),xlab="Loss",ylab="Probability of Losses",col='red')
par(new=TRUE)
plot(gp,axes=FALSE,xlab="Loss",ylab="Probability of Losses",col='black')

gcum.acum=cumsum(Re(g))


gpcum.acum=cumsum(gp)

percentiles=c(0.95,0.975,0.99,0.995,0.9975,0.999)
percentiles=matrix(percentiles,length(percentiles),3)

for(i in 1:dim(percentiles))
percentiles[i,2]=(min(which(gcum.acum>=percentiles[i,1]))-1)
#percentiles for FFT
for(i in 1:dim(percentiles))
percentiles[i,3]=(min(which(gpcum.acum>=percentiles[i,1]))-1)
#percentiles for Panjer Recursion
percentiles; #print output.
R Code for Basic Credit Risk
+
algorithm (no sectors):
n=10
r=2^n
m=10
x=0:(r-1)
mu=c(2,4,2,3.3,1,5,7,1.1,0.80,10.40)
prod=array(1,length(x))
#severity vector
for(i in 1:m)
{
y=array(0,length(x))
y[seq(1,length(x)-1,by=i)]=dpois(x[seq(1,length(x)-1,by=i)]/i,mu[i])
y=fft(y,inverse=FALSE)
prod=prod*y
}

cr=Re(fft(prod,inverse=TRUE)/length(prod))
plot(cr,xlab="Aggregate Loss with no sectors considered",ylab="Probability of
Loss",type='l')

gcum.acum=cumsum(cr)
percentiles=c(0.95,0.975,0.99,0.995,0.9975,0.999)
percentiles=matrix(percentiles,length(percentiles),2)

for(i in 1:dim(percentiles))
percentiles[i,2]=(min(which(gcum.acum>=percentiles[i,1]))-1)
percentiles;
R Code for extended CreditRisk
+
algorithm (one sector):
o=10
r=2^o
m=10
s=0.5 #assumed from CR
+
technical document
alpha=1/(s^2)


beta=(s^2)
x=0:(r-1) #x axis from 0 to 2^o

mu=c(2,4,2,3.3,1,5,7,1.1,0.80,10.40) #frequency vector

epsilon=mu*(1:m) #multiplying by bands gives expected loss

severity=array(0,r)

for (i in 2:(m+1))
{
severity[i]=mu[i-1]/sum(mu)
} #built severity vector, step 2

t=array(0,r)
t=fft(severity,inverse=FALSE) #fhat
fzhat=(1-(t-1)*(beta*sum(mu)))^(-alpha) #fzhat
cr=Re(fft(fzhat,inverse=TRUE)/length(fzhat))

plot(cr,type='l',xlab="Aggregate Loss with 1 Sector Model",ylab="Probability of
Loss")
cr.acum=cumsum(cr)
percentiles=c(0.95,0.975,0.99,0.995,0.9975,0.999)
percentiles=matrix(percentiles,length(percentiles),2)

for(i in 1:dim(percentiles))
percentiles[i,2]=(min(which(cr.acum>=percentiles[i,1]))-1)

(Embrechts & Frei, 2009) (Melchiori, 2004)


References

Bluhm, C., Overbeck, L., & Wagner, C. (2010). Introduction to Credit Risk Modelling 2nd
Edition. London: Chapman & Hall.
Credit Suisse Financial Products . (1997). CreditRisk+ : A Credit Risk Management. London.
Embrechts, P., & Frei, M. (2009). Panjer recursion versus FFT for compound distributions.
Mathematical Methods of Operations Research , 497-508.
Kaas, R., Goovaerts, M., Dhaene, J., & Denuit, M. (2008). Modern Actuarial Risk Theory using
R. Laussane: Springer.
Klugman, S. A., Panjer, H. H., & Willmot, G. E. (2004). Loss Models: From Data to Decisions.
New Jersey: Wiley - Interscience.
Melchiori, M. R. (2004). CreditRisk+ by Fast Fourier Transform. Santa Fe,
http://www.yieldcurve.com.
Panjer, H. H. (1981). Recursive Evaluation of a Family of Compound Distributions. Astin
Bulletin 12 , 22-26.
Robertson, J. P. (1992). The Computation of Aggregate Loss Distributions. Proceedings of the
Casualty Actuarial Society , 57-133.
Tiwari, S. (2010). Enhancements in CreditRisk+ Model. Retrieved August 17, 2012, from
SSRN: http://ssrn.com/abstract=1553304

You might also like