SlideShare a Scribd company logo
Economic Scenarios Generation for Insurance: ESG 
package and other tools (Pt. I : ESG) 
Rmetrics Workshop on R in Finance and Insurance 2014, Paris 
Thierry Moudiki, Frederic Planchet 
June 27, 2014 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :1E/SG2)2
ESG 
R package ESG was designed to provide a minimal Economic 
Scenarios Generator (ESG) for valuation and capital requirements 
calculations in Solvency II. 
Currently : projections of risk factors in a risk-neutral world. 
Available risk factors are : nominal rates, equity returns, property 
returns, corporate bonds returns. 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :2E/SG2)2
ESG 
ESG current structure 
Nominal rates 
Equity prices Property returns 
Corporate bonds 
returns 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :3E/SG2)2
ESG 
Available risk factors 
Let (Wt )t0 be a standard brownian motion. 
nominal rates : Hull-White Extended Vasicek (HW) 
drt = ((t) − art ) dt + dW(r) 
t 
equity prices : Geometric Brownian motion with stochastic 
Hull-White interest rates (BSHW) 
dSt = rtStdt + StdW(E) 
t 
dW(E) 
t dW(r) 
t = dt 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :4E/SG2)2
ESG 
Available risk factors (cont’d) 
property returns : Geometric Brownian motion with stochastic 
Hull-White interest rates 
dSt = rtStdt + StdW(P) 
t 
corporate bonds returns : HW + intensity of default + liquidity 
spread = Longstaff-Mithal-Neis (LMN) 
Intensity of default 
dt = ( −
t )dt +  
p 
tdW() 
t 
Additional liquidity spread 
dt = tdW() 
t 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :5E/SG2)2
ESG 
Simulation/discretization 
Example : Vasicek model. 
Most simple and intuitive way : Euler scheme (1st order Ito-Taylor 
development) : 
pti+1 − ti 
rti+1 − rti = a( − rti )(ti+1 − ti ) +  
Another way : 2nd order development, Milstein scheme. More precise. 
But When  is constant, not necessary. More complicated formula. 
Third way : exact simulation of the transition distribution between 
ti+1 and ti : 
s 
1 − e−a(ti+1−ti ) 
rti+1 = e−a(ti+1−ti )rti + (1 − e−a(ti+1−ti )) +  
2a 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :6E/SG2)2
ESG 
0.012 0.013 0.014 0.015 0.016 0.017 0.018 
0 100 200 300 400 500 
Visualizing discretization bias (t = 2) on the example, through densities 
N = 500 Bandwidth = 0.0002482 
Density 
Euler simulation 
Exact simulation 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :7E/SG2)2
ESG 
The package’s structure 
An S4 object-oriented architecture, around 2 classes : ParamsScenarios 
and Scenarios, with associated getter and setter methods. 
ParamsScenarios Scenarios 
horizon A ParamsScenarios attribute 
n ForwardRates slot 
HW, BSHW, LMN parameters ZCRates slot 
Equity/short rate correlation One slot for each model path 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :8E/SG2)2
ESG 
Using the package : 2 ways 
Step by step approach : Using successive getter and setter 
methods, to know exactly what is done at each step 
set/get*Params*Scenarios* 
set/getForwardRates 
set/getZCRates 
set/get*Paths 
Through an interface wrapping the successive getter and setter 
methods, which is easier but also safer 
rShortRate : nominal rates (HW) 
rStock : equity (BSHW) 
rDefaultSpread + rLiquiditySpread : credit (LMN) 
rRealEstate : property (BSHW) 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :9E/SG2)2
Examples of use of ESG 
# loading ESG 
library(ESG) 
# needed for yield curve interpolation 
library(ycinterextra) 
# yield to maturities 
txZC - c(0.01422,0.01309,0.01380,0.01549,0.01747,0.01940, 
0.02104,0.02236,0.02348,0.02446,0.02535,0.02614, 
0.02679,0.02727,0.02760,0.02779,0.02787,0.02786, 
0.02776,0.02762,0.02745,0.02727,0.02707,0.02686, 
0.02663,0.02640,0.02618,0.02597,0.02578,0.02563) 
# maturities 
u - 1:30 
# the yield curve must be interpolated on a monthly basis 
ZC - fitted(ycinter(yM = txZC, matsin = u, 
matsout = seq(1, 30, by = 1/12), 
method = SW)) 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:0E/SG2)2
Examples of use of ESG : Step by step approach 
# object creation 
objScenario - new(Scenarios) 
# Setting the basic scenario's parameters 
objScenario - setParamsBaseScenarios(objScenario, 
horizon = 5, 
nScenarios = 100) 
# Parameters for BSHW 
objScenario - setRiskParamsScenariosS(objScenario, 
vol = .1, 
k = .2, 
volStock = .2, 
stock0 = 100, 
rho= .5) 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:1E/SG2)2
Examples of use of ESG : Step by step approach (cont’d) 
# Setting the forward rates 
objScenario - setForwardRates(objScenario, ZC = ZC, 
horizon = 5) 
# Simulation, setting the Paths' slots 
objScenario - customPathsGeneration(objScenario, 
type=stock) 
y.step - getstockPaths(objScenario) 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:2E/SG2)2
Examples of use of ESG : Through the interface 
# only one function is called, instead of 6 
y.interface - rStock(horizon = 5, 
nScenarios = 100, 
ZC = ZC, 
vol = .1, 
k = .2, 
volStock = .2, 
stock0 = 100, 
rho= .5) 
# visualizing the results : 
par(mfrow=c(2, 2)) 
matplot(t(y.step$shortRatePaths), type = 'l') 
matplot(t(y.step$stockPaths), type = 'l') 
matplot(t(y.interface$shortRatePaths), type = 'l') 
matplot(t(y.interface$stockPaths), type = 'l') 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:3E/SG2)2
0 1 2 3 4 5 
−0.4 −0.2 0.0 0.2 0.4 
HW short rate (step by step) 
time 
values 
0 1 2 3 4 5 
0 200 600 1000 
BSHW equity (step by step) 
time 
values 
0 1 2 3 4 5 
−0.2 0.0 0.2 0.4 
HW short rate (direct) 
time 
values 
0 1 2 3 4 5 
0 200 400 600 800 
BSHW equity (direct) 
time 
values 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:4E/SG2)2
Example of Best Estimate Liability calculation 
We consider an insurance company, offering a unit-linked contract 
The insured party pays a premium equal to 1. 
The premium is invested in a stock : the unit 
Maturity : 10 years 
Systematic surrender rate : 2% (unavoidable) 
Economic surrender rate : 5% (depends on the economic situation). 
Added to systematic surrender rate whenever the unit-link falls below 
the initial value invested in it, which is 1 
The contract is entirely redeemed at maturity =) surrender rate 
at maturity : 100% 
In Solvency II, the Best Estimate liability related to the contract is equal 
to the average discounted value of its future cash-flows 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:5E/SG2)2
Example of Best Estimate Liability calculation (cont’d) 
r(s) : the systematic surrender rate (2%) 
r(e) : the economic surrender rate (5%) 
8i = 1, . . . , 10 
r(total) 
i := 
0 
@r(s) + r(e)11 
Si 
Si−1 
1 
 
1 
A11(i9) + 100% × 11(i=10) 
(rt )t0 : the instantaneous short rate (HW) 
(St )t0 : the value of the unit (BSHW) 
Resi = Resi−1 × Si 
Si−1 
 
1 − r(total) 
i 
 
; Res0 = 1 : the reserves 
The Best Estimate liability associated to the contract is equal to : 
BEL = E 
X10 
i=1 
e− 
R i 
0 ruduResi 
# 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:6E/SG2)2
Example of Best Estimate Liability calculation (cont’d) 
No close formula for the BEL. . . 
. . . Or difficult to derive =) Monte Carlo simulation with ESG 
An R function, calculFlux, is defined for the calculation of ALM 
cash-flows. calculFlux depends on projected short rates, projected 
values of the unit, and the surrender rates, depending on the latter 
Parameters for ALM projection : 
k - 0.12 # short rates' mean-reversion speed 
sTaux - 0.05 # volatility of short rates 
sUC - .16 # volatility of the unit 
rho_rS - .5 # correlation unit vs short rates 
H - 10 # maturity of the contract 
nSimulations - 1000 # number of simulations 
tauxRachatS - .02 # systematic surrender rates 
tauxRachatC - .05 # economic surrender rates 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:7E/SG2)2
Example of Best Estimate Liability calculation (cont’d) 
set.seed(10) 
# Simulation of the unit and of short rates with rStock 
traj - rStock(horizon=H, nScenarios=nSimulations, ZC=ZC, 
vol=sTaux, k=k, volStock=sUC, stock0=1, 
rho=rho_rS) 
# Short rates 
trajectoiresTaux - traj$shortRatePaths 
# Unit (a stock) 
trajectoiresUC - traj$stockPaths 
# Future cash-flows and discount factors 
Flux_futurs - calculFlux(trajectoiresTaux,trajectoiresUC, 
tauxRachatS,tauxRachatC) 
# discounted cash-flows 
ActuFlux_futurs - Flux_futurs$flux*Flux_futurs$actu 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:8E/SG2)2
# Future distribution of the reserves 
Res - t(apply(Flux_futurs$PM, 2, 
function(x) summary(x))[c(-1,-6), ]) 
rownames(Res) - paste0(Year , 0:10) 
## 1st Qu. Median Mean 3rd Qu. 
## Year 0 1.000 1.000 1.000 1.00 
## Year 1 0.864 0.980 0.995 1.10 
## Year 2 0.756 0.929 0.974 1.14 
## Year 3 0.668 0.901 0.986 1.23 
## Year 4 0.609 0.883 1.000 1.28 
## Year 5 0.555 0.849 1.020 1.33 
## Year 6 0.487 0.833 1.050 1.41 
## Year 7 0.430 0.821 1.110 1.47 
## Year 8 0.392 0.783 1.180 1.63 
## Year 9 0.360 0.774 1.270 1.69 
## Year 10 0.000 0.000 0.000 0.00 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:9E/SG2)2
0 2 4 6 8 10 
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 
95% c.i on the projection of reserves 
time 
Reserves 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I2:0E/SG2)2
(BestEstimate - sum(ActuFlux_futurs)/nSimulations) 
## [1] 0.9912 
Best Estimate liability convergence 
0 200 400 600 800 1000 0.7 0.8 0.9 1.0 1.1 
Number of simulations Best Estimate 
Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I2:1E/SG2)2

More Related Content

Similar to Introducing R package ESG at Rmetrics Paris 2014 conference

Inventory Model with Different Deterioration Rates under Exponential Demand, ...
Inventory Model with Different Deterioration Rates under Exponential Demand, ...Inventory Model with Different Deterioration Rates under Exponential Demand, ...
Inventory Model with Different Deterioration Rates under Exponential Demand, ...
inventionjournals
 
presentation
presentationpresentation
presentation3ashmawy
 
Quantitative Methods for Counterparty Risk
Quantitative Methods for Counterparty RiskQuantitative Methods for Counterparty Risk
Quantitative Methods for Counterparty Risk
Volatility
 
Risk modeling prortfolio diversification 4.0
Risk modeling prortfolio diversification 4.0Risk modeling prortfolio diversification 4.0
Risk modeling prortfolio diversification 4.0
Nikhil Shrivastava, MS, SAFe PMPO
 
How to use R in different professions: R for Car Insurance Product (Speaker: ...
How to use R in different professions: R for Car Insurance Product (Speaker: ...How to use R in different professions: R for Car Insurance Product (Speaker: ...
How to use R in different professions: R for Car Insurance Product (Speaker: ...
Zurich_R_User_Group
 
Application of Q-Measure in a Real Time Fuzzy System for Managing Financial A...
Application of Q-Measure in a Real Time Fuzzy System for Managing Financial A...Application of Q-Measure in a Real Time Fuzzy System for Managing Financial A...
Application of Q-Measure in a Real Time Fuzzy System for Managing Financial A...
ijsc
 
Asian basket options
Asian basket optionsAsian basket options
Asian basket options
Victor Bontemps
 
1635 variance portfolio
1635 variance portfolio1635 variance portfolio
1635 variance portfolio
Dr Fereidoun Dejahang
 
Is the Macroeconomy Locally Unstable and Why Should We Care?
Is the Macroeconomy Locally Unstable and Why Should We Care?Is the Macroeconomy Locally Unstable and Why Should We Care?
Is the Macroeconomy Locally Unstable and Why Should We Care?
ADEMU_Project
 
Bid and Ask Prices Tailored to Traders' Risk Aversion and Gain Propension: a ...
Bid and Ask Prices Tailored to Traders' Risk Aversion and Gain Propension: a ...Bid and Ask Prices Tailored to Traders' Risk Aversion and Gain Propension: a ...
Bid and Ask Prices Tailored to Traders' Risk Aversion and Gain Propension: a ...
Waqas Tariq
 
Financial Regulation Lecture 9Based on notes by Marlena El.docx
Financial Regulation Lecture 9Based on notes by Marlena El.docxFinancial Regulation Lecture 9Based on notes by Marlena El.docx
Financial Regulation Lecture 9Based on notes by Marlena El.docx
ericn8
 
Introduction to lifecontingencies R package
Introduction to lifecontingencies R packageIntroduction to lifecontingencies R package
Introduction to lifecontingencies R package
Giorgio Alfredo Spedicato
 
Cf final ppt
Cf final pptCf final ppt
Cf final ppt
Mahaveer Singh
 
A kernel-free particle method: Smile Problem Resolved
A kernel-free particle method: Smile Problem ResolvedA kernel-free particle method: Smile Problem Resolved
A kernel-free particle method: Smile Problem Resolved
Kaiju Capital Management
 
NIPS2017 Few-shot Learning and Graph Convolution
NIPS2017 Few-shot Learning and Graph ConvolutionNIPS2017 Few-shot Learning and Graph Convolution
NIPS2017 Few-shot Learning and Graph Convolution
Kazuki Fujikawa
 
Relevance of Particle Swarm Optimization Technique for the Solution of Econom...
Relevance of Particle Swarm Optimization Technique for the Solution of Econom...Relevance of Particle Swarm Optimization Technique for the Solution of Econom...
Relevance of Particle Swarm Optimization Technique for the Solution of Econom...
IRJET Journal
 
Composable Energy Modeling for ML-Driven Drone Applications
Composable Energy Modeling for ML-Driven Drone ApplicationsComposable Energy Modeling for ML-Driven Drone Applications
Composable Energy Modeling for ML-Driven Drone Applications
Demetris Trihinas
 

Similar to Introducing R package ESG at Rmetrics Paris 2014 conference (20)

Inventory Model with Different Deterioration Rates under Exponential Demand, ...
Inventory Model with Different Deterioration Rates under Exponential Demand, ...Inventory Model with Different Deterioration Rates under Exponential Demand, ...
Inventory Model with Different Deterioration Rates under Exponential Demand, ...
 
presentation
presentationpresentation
presentation
 
Quantitative Methods for Counterparty Risk
Quantitative Methods for Counterparty RiskQuantitative Methods for Counterparty Risk
Quantitative Methods for Counterparty Risk
 
Risk modeling prortfolio diversification 4.0
Risk modeling prortfolio diversification 4.0Risk modeling prortfolio diversification 4.0
Risk modeling prortfolio diversification 4.0
 
Master_Thesis_Harihara_Subramanyam_Sreenivasan
Master_Thesis_Harihara_Subramanyam_SreenivasanMaster_Thesis_Harihara_Subramanyam_Sreenivasan
Master_Thesis_Harihara_Subramanyam_Sreenivasan
 
How to use R in different professions: R for Car Insurance Product (Speaker: ...
How to use R in different professions: R for Car Insurance Product (Speaker: ...How to use R in different professions: R for Car Insurance Product (Speaker: ...
How to use R in different professions: R for Car Insurance Product (Speaker: ...
 
Application of Q-Measure in a Real Time Fuzzy System for Managing Financial A...
Application of Q-Measure in a Real Time Fuzzy System for Managing Financial A...Application of Q-Measure in a Real Time Fuzzy System for Managing Financial A...
Application of Q-Measure in a Real Time Fuzzy System for Managing Financial A...
 
Asian basket options
Asian basket optionsAsian basket options
Asian basket options
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
Stephens-L
Stephens-LStephens-L
Stephens-L
 
1635 variance portfolio
1635 variance portfolio1635 variance portfolio
1635 variance portfolio
 
Is the Macroeconomy Locally Unstable and Why Should We Care?
Is the Macroeconomy Locally Unstable and Why Should We Care?Is the Macroeconomy Locally Unstable and Why Should We Care?
Is the Macroeconomy Locally Unstable and Why Should We Care?
 
Bid and Ask Prices Tailored to Traders' Risk Aversion and Gain Propension: a ...
Bid and Ask Prices Tailored to Traders' Risk Aversion and Gain Propension: a ...Bid and Ask Prices Tailored to Traders' Risk Aversion and Gain Propension: a ...
Bid and Ask Prices Tailored to Traders' Risk Aversion and Gain Propension: a ...
 
Financial Regulation Lecture 9Based on notes by Marlena El.docx
Financial Regulation Lecture 9Based on notes by Marlena El.docxFinancial Regulation Lecture 9Based on notes by Marlena El.docx
Financial Regulation Lecture 9Based on notes by Marlena El.docx
 
Introduction to lifecontingencies R package
Introduction to lifecontingencies R packageIntroduction to lifecontingencies R package
Introduction to lifecontingencies R package
 
Cf final ppt
Cf final pptCf final ppt
Cf final ppt
 
A kernel-free particle method: Smile Problem Resolved
A kernel-free particle method: Smile Problem ResolvedA kernel-free particle method: Smile Problem Resolved
A kernel-free particle method: Smile Problem Resolved
 
NIPS2017 Few-shot Learning and Graph Convolution
NIPS2017 Few-shot Learning and Graph ConvolutionNIPS2017 Few-shot Learning and Graph Convolution
NIPS2017 Few-shot Learning and Graph Convolution
 
Relevance of Particle Swarm Optimization Technique for the Solution of Econom...
Relevance of Particle Swarm Optimization Technique for the Solution of Econom...Relevance of Particle Swarm Optimization Technique for the Solution of Econom...
Relevance of Particle Swarm Optimization Technique for the Solution of Econom...
 
Composable Energy Modeling for ML-Driven Drone Applications
Composable Energy Modeling for ML-Driven Drone ApplicationsComposable Energy Modeling for ML-Driven Drone Applications
Composable Energy Modeling for ML-Driven Drone Applications
 

Recently uploaded

Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 

Recently uploaded (20)

Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 

Introducing R package ESG at Rmetrics Paris 2014 conference

  • 1. Economic Scenarios Generation for Insurance: ESG package and other tools (Pt. I : ESG) Rmetrics Workshop on R in Finance and Insurance 2014, Paris Thierry Moudiki, Frederic Planchet June 27, 2014 Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :1E/SG2)2
  • 2. ESG R package ESG was designed to provide a minimal Economic Scenarios Generator (ESG) for valuation and capital requirements calculations in Solvency II. Currently : projections of risk factors in a risk-neutral world. Available risk factors are : nominal rates, equity returns, property returns, corporate bonds returns. Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :2E/SG2)2
  • 3. ESG ESG current structure Nominal rates Equity prices Property returns Corporate bonds returns Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :3E/SG2)2
  • 4. ESG Available risk factors Let (Wt )t0 be a standard brownian motion. nominal rates : Hull-White Extended Vasicek (HW) drt = ((t) − art ) dt + dW(r) t equity prices : Geometric Brownian motion with stochastic Hull-White interest rates (BSHW) dSt = rtStdt + StdW(E) t dW(E) t dW(r) t = dt Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :4E/SG2)2
  • 5. ESG Available risk factors (cont’d) property returns : Geometric Brownian motion with stochastic Hull-White interest rates dSt = rtStdt + StdW(P) t corporate bonds returns : HW + intensity of default + liquidity spread = Longstaff-Mithal-Neis (LMN) Intensity of default dt = ( −
  • 6. t )dt + p tdW() t Additional liquidity spread dt = tdW() t Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :5E/SG2)2
  • 7. ESG Simulation/discretization Example : Vasicek model. Most simple and intuitive way : Euler scheme (1st order Ito-Taylor development) : pti+1 − ti rti+1 − rti = a( − rti )(ti+1 − ti ) + Another way : 2nd order development, Milstein scheme. More precise. But When is constant, not necessary. More complicated formula. Third way : exact simulation of the transition distribution between ti+1 and ti : s 1 − e−a(ti+1−ti ) rti+1 = e−a(ti+1−ti )rti + (1 − e−a(ti+1−ti )) + 2a Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :6E/SG2)2
  • 8. ESG 0.012 0.013 0.014 0.015 0.016 0.017 0.018 0 100 200 300 400 500 Visualizing discretization bias (t = 2) on the example, through densities N = 500 Bandwidth = 0.0002482 Density Euler simulation Exact simulation Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :7E/SG2)2
  • 9. ESG The package’s structure An S4 object-oriented architecture, around 2 classes : ParamsScenarios and Scenarios, with associated getter and setter methods. ParamsScenarios Scenarios horizon A ParamsScenarios attribute n ForwardRates slot HW, BSHW, LMN parameters ZCRates slot Equity/short rate correlation One slot for each model path Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :8E/SG2)2
  • 10. ESG Using the package : 2 ways Step by step approach : Using successive getter and setter methods, to know exactly what is done at each step set/get*Params*Scenarios* set/getForwardRates set/getZCRates set/get*Paths Through an interface wrapping the successive getter and setter methods, which is easier but also safer rShortRate : nominal rates (HW) rStock : equity (BSHW) rDefaultSpread + rLiquiditySpread : credit (LMN) rRealEstate : property (BSHW) Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package andJuonthee2r7t,o2o0ls1(4Pt. I :9E/SG2)2
  • 11. Examples of use of ESG # loading ESG library(ESG) # needed for yield curve interpolation library(ycinterextra) # yield to maturities txZC - c(0.01422,0.01309,0.01380,0.01549,0.01747,0.01940, 0.02104,0.02236,0.02348,0.02446,0.02535,0.02614, 0.02679,0.02727,0.02760,0.02779,0.02787,0.02786, 0.02776,0.02762,0.02745,0.02727,0.02707,0.02686, 0.02663,0.02640,0.02618,0.02597,0.02578,0.02563) # maturities u - 1:30 # the yield curve must be interpolated on a monthly basis ZC - fitted(ycinter(yM = txZC, matsin = u, matsout = seq(1, 30, by = 1/12), method = SW)) Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:0E/SG2)2
  • 12. Examples of use of ESG : Step by step approach # object creation objScenario - new(Scenarios) # Setting the basic scenario's parameters objScenario - setParamsBaseScenarios(objScenario, horizon = 5, nScenarios = 100) # Parameters for BSHW objScenario - setRiskParamsScenariosS(objScenario, vol = .1, k = .2, volStock = .2, stock0 = 100, rho= .5) Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:1E/SG2)2
  • 13. Examples of use of ESG : Step by step approach (cont’d) # Setting the forward rates objScenario - setForwardRates(objScenario, ZC = ZC, horizon = 5) # Simulation, setting the Paths' slots objScenario - customPathsGeneration(objScenario, type=stock) y.step - getstockPaths(objScenario) Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:2E/SG2)2
  • 14. Examples of use of ESG : Through the interface # only one function is called, instead of 6 y.interface - rStock(horizon = 5, nScenarios = 100, ZC = ZC, vol = .1, k = .2, volStock = .2, stock0 = 100, rho= .5) # visualizing the results : par(mfrow=c(2, 2)) matplot(t(y.step$shortRatePaths), type = 'l') matplot(t(y.step$stockPaths), type = 'l') matplot(t(y.interface$shortRatePaths), type = 'l') matplot(t(y.interface$stockPaths), type = 'l') Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:3E/SG2)2
  • 15. 0 1 2 3 4 5 −0.4 −0.2 0.0 0.2 0.4 HW short rate (step by step) time values 0 1 2 3 4 5 0 200 600 1000 BSHW equity (step by step) time values 0 1 2 3 4 5 −0.2 0.0 0.2 0.4 HW short rate (direct) time values 0 1 2 3 4 5 0 200 400 600 800 BSHW equity (direct) time values Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:4E/SG2)2
  • 16. Example of Best Estimate Liability calculation We consider an insurance company, offering a unit-linked contract The insured party pays a premium equal to 1. The premium is invested in a stock : the unit Maturity : 10 years Systematic surrender rate : 2% (unavoidable) Economic surrender rate : 5% (depends on the economic situation). Added to systematic surrender rate whenever the unit-link falls below the initial value invested in it, which is 1 The contract is entirely redeemed at maturity =) surrender rate at maturity : 100% In Solvency II, the Best Estimate liability related to the contract is equal to the average discounted value of its future cash-flows Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:5E/SG2)2
  • 17. Example of Best Estimate Liability calculation (cont’d) r(s) : the systematic surrender rate (2%) r(e) : the economic surrender rate (5%) 8i = 1, . . . , 10 r(total) i := 0 @r(s) + r(e)11 Si Si−1 1 1 A11(i9) + 100% × 11(i=10) (rt )t0 : the instantaneous short rate (HW) (St )t0 : the value of the unit (BSHW) Resi = Resi−1 × Si Si−1 1 − r(total) i ; Res0 = 1 : the reserves The Best Estimate liability associated to the contract is equal to : BEL = E X10 i=1 e− R i 0 ruduResi # Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:6E/SG2)2
  • 18. Example of Best Estimate Liability calculation (cont’d) No close formula for the BEL. . . . . . Or difficult to derive =) Monte Carlo simulation with ESG An R function, calculFlux, is defined for the calculation of ALM cash-flows. calculFlux depends on projected short rates, projected values of the unit, and the surrender rates, depending on the latter Parameters for ALM projection : k - 0.12 # short rates' mean-reversion speed sTaux - 0.05 # volatility of short rates sUC - .16 # volatility of the unit rho_rS - .5 # correlation unit vs short rates H - 10 # maturity of the contract nSimulations - 1000 # number of simulations tauxRachatS - .02 # systematic surrender rates tauxRachatC - .05 # economic surrender rates Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:7E/SG2)2
  • 19. Example of Best Estimate Liability calculation (cont’d) set.seed(10) # Simulation of the unit and of short rates with rStock traj - rStock(horizon=H, nScenarios=nSimulations, ZC=ZC, vol=sTaux, k=k, volStock=sUC, stock0=1, rho=rho_rS) # Short rates trajectoiresTaux - traj$shortRatePaths # Unit (a stock) trajectoiresUC - traj$stockPaths # Future cash-flows and discount factors Flux_futurs - calculFlux(trajectoiresTaux,trajectoiresUC, tauxRachatS,tauxRachatC) # discounted cash-flows ActuFlux_futurs - Flux_futurs$flux*Flux_futurs$actu Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:8E/SG2)2
  • 20. # Future distribution of the reserves Res - t(apply(Flux_futurs$PM, 2, function(x) summary(x))[c(-1,-6), ]) rownames(Res) - paste0(Year , 0:10) ## 1st Qu. Median Mean 3rd Qu. ## Year 0 1.000 1.000 1.000 1.00 ## Year 1 0.864 0.980 0.995 1.10 ## Year 2 0.756 0.929 0.974 1.14 ## Year 3 0.668 0.901 0.986 1.23 ## Year 4 0.609 0.883 1.000 1.28 ## Year 5 0.555 0.849 1.020 1.33 ## Year 6 0.487 0.833 1.050 1.41 ## Year 7 0.430 0.821 1.110 1.47 ## Year 8 0.392 0.783 1.180 1.63 ## Year 9 0.360 0.774 1.270 1.69 ## Year 10 0.000 0.000 0.000 0.00 Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I1:9E/SG2)2
  • 21. 0 2 4 6 8 10 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 95% c.i on the projection of reserves time Reserves Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I2:0E/SG2)2
  • 22. (BestEstimate - sum(ActuFlux_futurs)/nSimulations) ## [1] 0.9912 Best Estimate liability convergence 0 200 400 600 800 1000 0.7 0.8 0.9 1.0 1.1 Number of simulations Best Estimate Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I2:1E/SG2)2
  • 23. ESG Future versions More flexibility on the interpolation of zero-rates (not only monthly frequency required) Projection is annual =) impossible to obtain correct estimations of discount factors =) add an option for changing the sampling frequency Adding correlation/dependence between the risk factors Adding real world models ESGtoolkit, will be used in ESG Thierry Moudiki, Frederic Planchet Economic Scenarios Generation for Insurance: ESG package anJdunoeth2e7r,to20o1ls4(Pt. I2:2E/SG2)2