fair valuation of participating life insurance contracts with jump risk
TRANSCRIPT
EMLYON Business School
Specialized Master Quantitative Finance
(2013 / 2014)
Fair Valuation of Participating Contracts with
Jump Risk
KOUAM KAMGUIA AURELIEN ALEX
Reg.No: 20142165
Summary
This report aims to detail the implementation of a Participating Life Insurance con-
tract pricer in accordance with the fair value accounting principle of International
Accounting Standard Board (IASB).
• An inclusion of market and credit risk goes in line with the risk–sensitive
approach promoted by Solvency II and enhances risk management.
• The use of a double exponential random variable creates a rare case of in-
cluding default risk whilst obtaining a closed–form formula.
• A Taylor series approach is sufficiently accurate to approximate the confluent
hypergeometric function within this application.
CONTENTS
Contents
1 The Contract 1
1.1 The Pricing framework . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 Valuation for default at maturity: generic formulas . . . . . 3
1.2 European Option Pricing under a Double exponential jump-diffusion
model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Computational Implementation 7
2.1 Source code of the file KouFormulas.cpp . . . . . . . . . . . . . . . 8
2.2 Source code of the file LicMath.h . . . . . . . . . . . . . . . . . . . 14
CONTENTS
Acronyms
IASB International Accounting Standard Board
LIST OF TABLES
List of Tables
1 Balance Sheet as at 0 . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 The Contract
The participating life insurance contract with guarantee (LIC) spans on the interval
[0, T ] and at time 0, the balance sheet of the insurer is as follows:
Assets Liabilities
A0 E0
L0
Table 1: Balance Sheet as at 0
where the assets portfolio, A0, is invested partially in equity such that E0 =
(1− α)A0 and bonds as L0 = αA0 in which α ∈ [0, 1]. The variable α is directly
linked to the financial leverage β = L0
E0.
As the contract’s name states, the policyholder is guaranteed a minimum rate
of return rg during the life of the contract, in other words she will receive at least
at maturity LTg = L0ergT . In practice, the guaranteed rate rg is always less than
the return of a risk–free asset of the same maturity.
Under the conditions that the insurer is fully solvent during the period [0, T ],
the policyholders will receive additionally a fraction δ of financial earnings up to
their contribution α to the funding of the portfolio. Formally, this relationship
could be written as: δ[AT − LTg
].
Courtois and Quittard-Pinon (2008) priced the LIC under two approaches:
when default occurs solely at maturity and when default could occur anytime
during the contract’s lifetime. For the time being, we will exclusively cover the
first case in the rest of this document.
1
1.1 The Pricing framework
The authors based their LIC pricing under the following assumptions about the
insurance and financial market:
1. there are no transactions costs, taxes, or problems with indivisibilities of
assets
2. there are a sufficient number of investors with comparable wealth levels so
that each investor believes that he can buy and sell as much of an asset as
he wants at the market price.
3. there exists an exchange market for borrowing and lending at the same rate
of interest.
4. short–sales of all assets, with full use of the proceeds, is allowed.
5. The interest rate r is constant.
6. Under the risk–neutral world the firm’s assets portfolio, A , follows a geo-
metric Levy process notably:
dA
A−= rdt+ σdz + d
(Nt∑k=1
(Zk − 1)− λζt
)(1)
where r is the risk–free interest rate, σ is the asset’s volatility, z is a stan-
dard Brownian motion, N is a Poisson process with constant intensity λ, Zk
are strictly positive i.i.d random variables and ζ is here for compensation
purposes.
The random variable Z in the above equation is the novelty of this document
over previous works on LIC pricing because not only it embeds insurer’s
2
bankruptcy risk but also, provides quasi–closed–form formula. The random
variables Yk = log(Zk) are i.i.d. and possess a double exponential density:
fY (y) = pη1e−η1y1{y≥0} + qη2e
−η2y1{y<0} (2)
where η1 is the intensity of positive jumps, η2 is the intensity of negative
jumps, p is the probability of upward jumps, q is the probability of downward
jumps and p+ q = 1. All sources of randomness z, N and Yk are independent.
Using Ito’s lemma for jump–diffusions, it can be easily shown that the unique
solution to the firm’s assets portfolio SDE is:
At = A0exp{Xt
}= A0exp
{(r − λζ − 1
2σ2
)t+ σzt +
Nt∑k=1
Yk
}(3)
1.1.1 Valuation for default at maturity: generic formulas
At maturity, there are 3 possible outcomes: Within the first case, the insurer is
unable to meet its commitments and the firm is declared bankrupt. Policyholders
receive the residual value of the insurer’s assets, that is AT and the equityholders
nothing. In the second case, the end value of invested assets is greater than
the promised assets value to policyholders but, less than the threshold to deliver
bonuses to policyholders. Finally, the insurer is totally solvent at maturity and
pays the bonus to the policyholders. The mathematical translation of the above
explanation is:
Θ (T ) =
AT ifAT < LgT
LgT ifLgT ≤ AT ≤LgTα
LgT + δ (αAT − LgT ) ifAT >LgTα
3
Therefore, the arbitrage free price of the LIC can be rewritten as:
VL (0) = EQ[e−rT
(LgT + δ (αAT − LgT )+ − (LgT − AT )+
)]or more precisely as:
VL (0) = A0 + δαC
(AT ,
LgTα
)− C (AT , L
gT ) (4)
where C(XT , K) is the price at time 0 of a European call with maturity T , un-
derlying process X and strike K. It’s plain to see that the LIC pricing in this
framework boils down to work out the price of a European call option in which
the underlying process is normally and double exponentially distributed. Luckily,
Kou (2002) developed such a formula.
1.2 European Option Pricing under a Double exponential
jump-diffusion model
Under a double exponential jump-diffusion model, Kou (2002) showed that an
European Option can be computed as follows:
ψc = S(0)Υ(r +1
2σ2 − λζ, λ, p, η1, η2, log(K/S(0)), T )
−Ke−rTΥ(r − 1
2σ2 − λζ, λ, p, η1, η2, log(K/S(0)), T ) (5)
where S(0) is the initial stock price, σ is the underlying instrument volatility,
r, and λ are defined as in 1. η1, η2, p are defined as in 2. K is the strike price.
Furthermore, parameters p, η1, η2, λ and ζ are used to price under the risk-neutral
world. The relationships between p, η1, η2 and ζ and the other variables are as
follows:
λ = λ (1 + ζ) , η1 = η1 − 1, η2 = η2 + 1
4
and:
p =p
1 + ζ
η1η1 − 1
and:
ζ = pη1
η1 − 1+ q
η2η2 + 1
− 1
Υ(...) := P{Z(T ) ≥ log(K/S(0))} stands for the sum of the double exponential
and normal random vaviables and, equals to the cumulative distribution function
of a standard normal random variable under the European Black-Scholes pricing.
With πn := P(N(T ) = n) = e−λT (λT )n/n!
P{Z(T ) ≥ a} =eση12 T
2
σ√
2πT
∞∑n=1
πn
n∑k=1
Pn,k(σ√Tη1)
k
× Ik−1(a− µT ;−η1,−1
σ√T,−ση1
√T )
+eση12 T
2
σ√
2πT
∞∑n=1
πn
n∑k=1
Qn,k(σ√Tη2)
k
× Ik−1(a− µT ; η2,1
σ√T,−ση2
√T ) + π0Φ(−a− µT
σ√T
)
(6)
where:
Pn,k =n−1∑i=k
P(goingfrom(i, n− i)to(k, 0)) ·P(startingfrom(i, n− i))
5
=n−1∑i=k
n− k − 1
i− k
· ( η1η1 + η2
)i−k(η2
η1 + η2
)n−ipiqn−i,
And
Qn,k =n−1∑i=k
n− k − 1
i− k
· ( η1η1 + η2
)n−i(η2
η1 + η2
)i−kqipn−i
And
In (c;α, β, δ) = −eαc
α
n∑i=0
(β
α
)n−i×Hhi (βc− δ) +
(β
α
)n+1√
(2π)
β
× eαδβ+ α2
2β2 Φ
(−βc+ δ +
α
β
)when β > 0 , α 6= 0 and for all n ≥ −1.
In (c;α, β, δ) = −eαc
α
n∑i=0
(β
α
)n−i×Hhi (βc− δ)−
(β
α
)n+1√
(2π)
β∗
× eαδβ+ α2
2β2 Φ
(βc− δ − α
β
)when β < 0 , α < 0 and for all n ≥ −1. Φ (...) is the standard normal cumulative
distribution function. Hhn (x) is the Hodgkin - Huxley function defined as:
Hhn (x) = 2−n2
√(π)e−
x2
2 ×{
1F1
(12n+ 1
2, 12, 12x2)√
(2)Γ(1 + 1
2n) − x1F1
(12n+ 1, 3
2, 12x2)
Γ(12
+ 12n) }
where 1F1 (...) is the confluent hypergeometric function and Γ (...) is the gamma
function.
6
2 Computational Implementation
The development of a participating life insurance contract pricer was made in
C++. In order to price a life insurance contract, the end–user will make use of
the “KouFormulas.cpp” file. This file requires the integration of the “LicMath.h”
file which embeds all the necessary mathematical functions for the application.
Moreover, we employed some libraries from Boost. Once the “KouFormulas.cpp”
file opens, she will click on the “Local Windows Debugger” button. The interface
will subsequently request the following information:
1. The initial asset price.
2. The prevailing risk-free interest rate.
3. The asset’s volatility.
4. The average number of jumps per unit of time of the exponential random
variable.
5. The probability value of positive jumps of the double exponential random
variable.
6. The average number of positive jumps per unit of time of the double expo-
nential random variable.
7. The average number of negative jumps per unit of time of the double expo-
nential random variable.
8. The number of simulations required (Enter an integer value between 1 and
50).
9. The leverage coefficient or the proportion of assets invested in risk-free bonds.
7
10. The interest rate guaranteed to the policyholder at the contract’s maturity.
11. The participating coefficient.
12. The maturity of the contract.
2.1 Source code of the file KouFormulas.cpp
// KouFormulas . cpp : Def ines the entry po in t f o r the conso l e
// a pp l i c a t i o n .
//
// r e qu i r e s LicMath . h
//
#include<cmath>
#include”LicMath . h”
#include<boost /math/ d i s t r i b u t i o n s /normal . hpp>
#include<iostream>
//#i f ! d e f ined ( MSC VER)
using namespace std ;
//#end i f
using boost : : math : : normal ;
using namespace std ;
double KouFormulas (double S0 , double K, double i n t r ,
double sigma , double lambda , double p ,
double eta1 , double eta2 , double n ,
double Expiry )
8
{
//Compute the d i f f e r e n t parameters under the r i s k−neu t ra l measure
double a = log10 (K/S0 ) ;
double var iance = pow( sigma , 2 ) ;
double zeta = ( ( p∗ eta1 )/ ( eta1 − 1) ) + (((1−p)∗ eta2 )/ ( eta2+1)) − 1 ;
double p e s t = (p/(1+ zeta ) ) ∗ ( eta1 /( eta1 −1)) ;
double e t a 1 e s t = eta1 −1;
double e t a 2 e s t = eta2 + 1 ;
double i n t e n s i t y e s t = lambda ∗ (1+zeta ) ;
double new dr i f t = ( ( i n t r + 0 . 5∗ ( var iance ) − ( lambda ∗ ze ta ) )∗
Expiry ) ;
double new dr i f t 1 = ( ( i n t r − 0 . 5∗ ( var iance ) − ( lambda ∗ zeta ) )∗
Expiry ) ;
//Compute sum of Pnk and sum of Qnk
double Sum Pnk rn = 0 . 0 ;
double Sum Qnk rn = 0 . 0 ;
double Sum Pnk = 0 . 0 ;
double Sum Qnk = 0 . 0 ;
double k d = 0 . 0 ;
for (unsigned long long int k = 1 ; k<=n ; k++)
{
k d = static cast<double>(k ) ;
Sum Pnk rn += Pnk(n , k d , e t a1 e s t , e t a2 e s t , p e s t ) ∗
pow( sigma∗ s q r t ( Expiry )∗
e t a1 e s t , k d ) ∗
In ( k d−1,a − new dr i f t ,− e t a1 e s t ,
−(1/( sigma ∗ s q r t ( Expiry ) ) ) ,
−(sigma∗ e t a 1 e s t ∗ s q r t ( Expiry ) ) ) ;
9
Sum Qnk rn += Qnk(n , k d , e t a1 e s t , e t a2 e s t , p e s t ) ∗
pow( sigma∗ s q r t ( Expiry )∗
e t a2 e s t , k d ) ∗
In ( k d−1,a − new dr i f t , e t a2 e s t ,
(1/( sigma ∗ s q r t ( Expiry ) ) ) ,
−(sigma∗ e t a 2 e s t ∗ s q r t ( Expiry ) ) ) ;
Sum Pnk += Pnk(n , k d , eta1 , eta2 , p) ∗
pow( sigma∗ s q r t ( Expiry )∗ eta1 , k d ) ∗
In ( k d−1,a − new dr i f t1 ,−eta1 ,
−(1/( sigma ∗ s q r t ( Expiry ) ) ) ,
−(sigma∗ eta1 ∗ s q r t ( Expiry ) ) ) ;
Sum Qnk += Qnk(n , k d , eta1 , eta2 , p) ∗
pow( sigma∗ s q r t ( Expiry )∗ eta2 , k d ) ∗
In ( k d−1,a − new dr i f t1 , eta2 ,
(1/( sigma ∗ s q r t ( Expiry ) ) ) ,
−(sigma∗ eta2 ∗ s q r t ( Expiry ) ) ) ;
}
// Standard normal cd f are needed f o r the remaining o f
// t h i s a p p l i c a t i o n
norma l d i s t r i bu t i on<double> nv ( 0 , 1 ) ;
// p o i s s o n d i s t r i b u t i o n<> pv ( lambda ) ;
// de f i n e d1 and d2 to measure the r e s p e c t i v e
// cumula t ive d i s t r i b u t i o n s
double d1 , d2 = 0 ;
d1 = ( exp (pow( sigma∗ e t a1 e s t , 2 ) ∗ ( Expiry /2 ) ) ) / ( sigma ∗
10
s q r t (2∗ boost : : math : : cons tant s : : pi<double>() ∗ Expiry ) ) ∗
(gamma q(n+1, i n t e n s i t y e s t ) ) ∗ Sum Pnk rn +
( exp (pow( sigma∗ e t a2 e s t , 2 ) ∗ ( Expiry /2 ) )/ ( sigma ∗
s q r t (2∗ boost : : math : : cons tant s : : pi<double>() ∗ Expiry ) ) ) ∗
(gamma q(n+1, i n t e n s i t y e s t ) ) ∗ Sum Qnk rn +
(Ncdf (0 ,1 ,−( a − new dr i f t )/ ( sigma ∗ s q r t ( Expiry ) ) ) ) ;
d2 = ( exp (pow( sigma∗ eta1 , 2 ) ∗ ( Expiry /2 ) ) ) / ( sigma ∗
s q r t (2∗ boost : : math : : cons tant s : : pi<double>() ∗ Expiry ) ) ∗
(gamma q(n+1,lambda ) ) ∗ Sum Pnk +
( exp (pow( sigma∗ eta2 , 2 ) ∗ ( Expiry /2 ) )/ ( sigma ∗
s q r t (2∗ boost : : math : : cons tant s : : pi<double>() ∗ Expiry ) ) ) ∗
(gamma q(n+1,lambda ) ) ∗ Sum Qnk +
(Ncdf (0 ,1 ,−( a − new dr i f t 1 )/ ( sigma ∗ s q r t ( Expiry ) ) ) ) ;
return ( S0 ∗ d1 ) − (K∗exp(− i n t r ∗Expiry )∗d2 ) ;
}
//Define the Payof f o f a l i f e insurance con t rac t wi th p r o f i t s and
// guarantee as in the O. Le Courto is and FQP (2008) paper
double DMLIC(double A0 , double i n t r ,
double alpha , double rg , double de l ta ,
double sigma , double lambda , double p ,
double eta1 , double eta2 , double n ,
double Expiry )
{
// I n i t i a l i z e the con t rac t parameters
double L0 = alpha ∗ A0 ;
double K1 LIC = (L0 ∗ exp ( rg ∗Expiry ) )/ alpha ;
double K2 LIC = (L0∗exp ( rg ∗Expiry ) ) ;
11
return (A0 + ( de l t a ∗ alpha ∗(KouFormulas (A0 , K1 LIC , i n t r , sigma ,
lambda , p , eta1 , eta2 , n , Expiry ) ) ) −
KouFormulas (A0 , K2 LIC , i n t r , sigma , lambda ,
p , eta1 , eta2 , n , Expiry ) ) ;
}
int main ( )
{
cout<<”Please ente r the spot Asset p r i c e : ” <<endl ;
double A0 = 0 . 0 ;
c in>>A0 ;
cout<<”Please ente r the r i sk−f r e e i n t e r e s t r a t e : ” <<endl ;
double r = 0 . 0 ;
c in>>r ;
cout<<”Please ente r the Vo l a t i l i y l e v e l : ” <<endl ;
double Vol = 0 . 0 ;
c in>>Vol ;
cout<<”Please ente r the i n t e n s i t y o f the Poisson d i s t r i b u t i o n : ” ;
cout<<endl ;
double lambda = 0 . 0 ;
c in>>lambda ;
cout<<”Please ente r the p r obab i l i t y value o f p o s i t i v e jumps : ” ;
cout<<endl ;
double p = 0 . 0 ;
c in>>p ;
cout<<”Please ente r the i n t e n s i t y o f p o s i t i v e jumps : ” <<endl ;
12
double eta1 = 0 . 0 ;
c in>>eta1 ;
cout<<”Please ente r the i n t e n s i t y o f negat ive jumps : ” <<endl ;
double eta2 = 0 . 0 ;
c in>>eta2 ;
cout<<”Please ente r the n value ” <<endl ;
int n = 0 ;
cin>>n ;
cout<<”Please ente r the l e v e r ag e c o e f f i c i e n t value ( alpha ) ” <<endl ;
double alpha = 0 ;
cin>>alpha ;
cout<<”Please ente r the guaranteed ra t e ” <<endl ;
double rg = 0 ;
cin>>rg ;
cout<<”Please ente r the p a r t i c i p a t i o n c o e f f i c i e n t value ( de l t a ) ” ;
cout <<endl ;
double de l t a = 0 ;
cin>>de l t a ;
cout<<”Please ente r the maturity in years : ” <<endl ;
double T = 0 . 0 ;
c in>>T;
for (n ; n<=70;n++)
{
cout<<”The value o f the L i f e Insurance Contract with d e f au l t ” ;
13
cout<<at Maturity for n : ”<<n<<” i s : ”<<’ ’ ;
cout<<DMLIC(A0 , r , alpha , rg , de l ta , Vol , lambda , p , eta1 , eta2 , n ,T)<<;
cout<<endl ;
}
system ( ”PAUSE” ) ;
r e turn 0 ;
}
2.2 Source code of the file LicMath.h
// LicMath . h
#ifndef LicMath
#define LicMath
#include<cmath>
#include<iomanip>
#include<iostream>
#include<boost /math/ d i s t r i b u t i o n s . hpp>
#include<boost /math/ d i s t r i b u t i o n s / po i s son . hpp>
#include<boost /math/ d i s t r i b u t i o n s /normal . hpp>
#include<boost /numeric / ublas /matrix . hpp>
#include<boost /numeric / ublas / vec to r . hpp>
#include<boost /numeric / ublas / i o . hpp>
#include<boost /math/ s p e c i a l f u n c t i o n s /gamma. hpp>
using namespace std ;
using namespace boost : : math ;
14
using namespace boost : : math : : cons tant s ;
stat ic const int g = 7 ;
stat ic const double Pi =
3.1415926535897932384626433832795028841972 ;
stat ic const double p [ g+2] = {0.99999999999980993 , 676.5203681218851 ,
−1259.1392167224028 , 771.32342877765313 , −176.61502916214059 ,
12.507343278686905 , −0.13857109526572012 , 9.9843695780195716 e−6,
1.5056327351493116 e−7};
typedef unsigned long long int VLint ;
typedef boost : : numeric : : ub las : : vector<int> VectorInt ;
typedef boost : : numeric : : ub las : : vector<double> VectorDbl ;
// De f i n i t i on the f a c t o r i a l f unc t i on
double f a c t o r i a l ( VLint n)
{
i f (n ==0 | | n == 1)
return 1 ;
else
return n ∗ f a c t o r i a l (n−1);
}
// De f i n i t i on o f the Combination func t i on
double nCk(VLint n , VLint k )
{
return f a c t o r i a l (n )/ ( f a c t o r i a l ( k ) ∗ f a c t o r i a l (n−k ) ) ;
}
// De f i n i t i on o f the minimum func t i on
15
template<class T> T mmin(T& a , T& b)
{
return ( a<b) ? a : b ;
}
// De f i n i t i on o f the max func t i on
template<class T>T max(T& a , T& b)
{
return ( a<b) ?b : a ;
}
// De f i n i t i on o f the Pnk func t i on
double Pnk(VLint n , VLint k , double eta1 , double eta2 , double p)
{
i f (n < 1)
{
cout<<”n i s equal or g r e a t e r than 1”<<endl ;
}
i f ( k > n)
{
cout<<”k cannot be h igher than n”<<endl ;
}
i f (p<0 | | p>1)
{
cout<< ”p i s a p r obab i l i t y dens i ty funct ion , t h e r e f o r e ” ;
cout<<” l i e s with in the i n t e r v a l 0 and 1”<<endl ;
}
i f ( eta1 <=1)
16
{
cout<< ” eta1 cannot be l e s s than 1”<<endl ;
}
i f ( eta2 <=0)
{
cout<< ” eta2 cannot be l e s s than 0”<<endl ;
}
double Y = 0 . 0 ;
double j d = 0 . 0 ;
for ( VLint i = k ; i<=n−1; i++)
{
j d = static cast<double>( i ) ;
Y += nCk(n−k−1, i−k ) ∗ pow( ( eta1 )/ ( eta1+eta2 ) , i−k ) ∗
pow( ( eta2 )/ ( eta1+eta2 ) , n−i )∗ (pow(p , i ) )∗ ( pow(1−p , n−i ) ) ;
}
return Y;
}
// De f i n i t i on o f the Qnk func t i on
double Qnk(VLint n , VLint k , double eta1 , double eta2 , double p)
{
i f (n < 1)
{
cout<<”n i s equal or g r e a t e r than 1”<<endl ;
}
i f ( k > n)
{
cout<<”k cannot be h igher than n”<<endl ;
17
}
i f (p<0 | | p>1)
{
cout<< ”p i s a p r obab i l i t y dens i ty funct ion , ” ;
cout<<” t h e r e f o r e l i e s with in the i n t e r v a l 0 and 1”<<endl ;
}
i f ( eta1 <=1)
{
cout<< ”lambda1 cannot be l e s s than 1”<<endl ;
}
i f ( eta2 <=0)
{
cout<< ”lambda2 cannot be l e s s than 0”<<endl ;
}
double X = 0 . 0 ;
double j d = 0 . 0 ;
for ( VLint i = k ; i<=n−1; i++)
{
j d = static cast<double>( i ) ;
X += nCk(n−k−1, j d−k ) ∗pow( ( eta1 )/ ( eta1+eta2 ) , n−j d ) ∗
pow( ( eta2 )/ ( eta1+eta2 ) , j d−k )∗ (pow(p , n−j d ) )∗
(pow(1−p , j d ) ) ;
}
return X;
}
/∗Code adapted from the Taylor s e r i e s approximation o f the con f l u en t
hypergeometr ic f unc t i on 1F1(a ; b ; z ) deve loped by John Pearson as Part o f
h i s MSc d i s s e r t a t i o n ’ Computation o f Hypergeometric Functions ’
18
∗/
long double TaylorConf luentHypergeometr ic (double a , double b ,
double z )
{
double t o l = pow(10 ,−15);
// I n i t i a l i s e a1 , v e c t o r o f i n d i v i d u a l s terms ,
// and b1 which s t o r e s the sum
// o f the computed terms up to t ha t po in t
boost : : numeric : : ub las : : vector<double> a1 ( 5 0 0 ) ;
a1 (1 ) = 1 ;
double b1 = 1 . 0 ;
for ( int j =1; j<500;++ j )
{
//Compute the curren t entry o f a1 in terms o f l a s t
a1 ( j +1) = ( a+j −1)/(b+j−1) ∗ z/ j ∗a1 ( j ) ;
//Update the sum of computed terms up to t ha t po in t
b1 = b1+a1 ( j +1);
i f ( f abs ( a1 ( j ) )/ fabs ( b1 ) < t o l && fabs ( a1 ( j +1))/
fabs ( b1)< t o l )
break ;
}
return b1 ;
}
19
// De f i n i t i on o f the Hodgkin − Huxley func t i on
double Hh( const double& n , const int& x)
{
double A = (pow(2 ,(−n/2) ) )∗
s q r t ( boost : : math : : cons tant s : : pi<double>())∗
( exp (pow(x , 2 )∗ −0 . 5 ) ) ;
double B = TaylorConf luentHypergeometr ic ( ( 0 . 5∗ n )+0 .5 , 0 . 5 ,
( 0 . 5∗pow(x , 2 ) ) ) / ( sq r t (2 ) ∗ tgamma(1 + (0 . 5∗n ) ) ) ;
double C = −(x∗( TaylorConf luentHypergeometr ic ( ( 0 . 5∗ n)+1 ,
1 . 5 , ( 0 . 5 ∗pow(x , 2 ) ) ) ) ) / ( tgamma( (0 . 5 )+(0 . 5∗n ) ) ) ;
return A ∗ (B+C) ;
}
// De f i n i t i on o f the In func t i on
double In ( const double& n , const double& c , const double& alpha ,
const double& beta , const double& de l ta1 )
{
// Declare v a r i a b l e s which w i l l ho ld your va l u e s
double r e s u l t 1 = 0 . 0 ;
normal snd ( 0 , 1 ) ;
double j d = 0 . 0 ;
i f ( beta > 0 && alpha != 0)
{
for ( int i = 0 ; i<=n ; i++)
{
j d = static cast<double>( i ) ;
r e s u l t 1 += (pow( beta /alpha , n−j d ) ) ∗
20
Hh( j d , ( beta ∗ c ) − de l ta1 ) +
(pow( ( beta / alpha ) , n+1) ∗
( s q r t (2 ∗ boost : : math : : cons tant s : : pi<double>())/
beta ) ∗ ( exp ( ( ( alpha ∗ de l ta1 )/ ( beta ) ) +
pow( alpha , 2 ) / ( 2 ∗pow( beta , 2 ) ) ) ) ∗
( cd f ( snd ,(− beta ∗ c ) + ( de l t a1 ) +
( alpha /beta ) ) ) ) ;
}
}
i f ( beta < 0 && alpha < 0)
{
for ( int i = 0 ; i !=n ; i++)
{
j d = static cast<double>( i ) ;
r e s u l t 1 += (pow( beta /alpha , n−j d ) ) ∗
Hh( j d , ( beta ∗ c ) − de l ta1 ) − (pow( ( beta / alpha ) , n+1) ∗
( s q r t (2 ∗ boost : : math : : cons tant s : : pi<double>())/ beta ) ∗
( exp ( ( ( alpha ∗ de l ta1 )/ ( beta ) ) + pow( alpha , 2 ) /
(2 ∗pow( beta , 2 ) ) ) ) ∗( cd f ( snd , ( beta ∗ c ) −
( de l t a1 ) − ( alpha /beta ) ) ) ) ;
}
}
return −(exp ( alpha ∗ c )/ alpha ) ∗ r e s u l t 1 ;
}
// De f i n i t i on o f the normal p r o b a b i l i t y d en s i t y f unc t i on
double npdf (double mu, double sigma , double x )
{
return ( 1 . 0 / ( sq r t ( 2 . 0 ∗
boost : : math : : cons tant s : : pi<double>())) ∗
sigma ) ∗ exp (−0.5 ∗ (pow(x−mu, 2 ) /
21
(pow( sigma , 2 ) ) ) ) ;
}
/∗Approximation o f the normal cumulat ive d i s t r i b u t i o n from
Haug .E (1998) ”The Complete Guide to Option Pr ic ing Formulas”
∗/
double Ncdf (double mu, double sigma , double x )
{
double a1 , a2 , a3 , k ;
double r e s u l t = 0 . 0 ;
a1 = 0 .4361836 ;
a2 = −0.1201676;
a3 = 0 .937298 ;
k = 1 .0 / ( 1 . 0 + (0 .33267 ∗ x ) ) ;
i f ( x >= 0)
{
r e s u l t = 1 − npdf (mu, sigma , x ) ∗ ( a1 ∗ k + ( a2 ∗ k ∗ k ) +
( a3 ∗ k ∗ k ∗ k ) ) ;
}
else
{
r e s u l t = 1 − Ncdf (mu, sigma , −x ) ;
}
return r e s u l t ;
}
22
#endif
23
References
Courtois, O. L. and Quittard-Pinon, F. (2008). Fair valuation of participating life
insurance contracts with jump risk. The Geneva Risk and Insurance Review, 33.
Kou, S. (2002). A jump diffusion model for option pricing. Management Science,
48(8):1086–1101.
24