SlideShare una empresa de Scribd logo
1 de 36
Descargar para leer sin conexión
FY2012 Annual Meeting of the Institute of Actuaries of Japan




                  Use of R in Actuarial Work

                               VAR Model
                              Interest Rate

                                         November 6, 2012
                 R Subcommittee, ASTIN Related Study Group
                                 Motoharu Dei, Milliman, Inc.
Table of Contents

   VAR model
       Development of VAR model for stress testing of macro
        economy


   Interest rate
       Interest rate model
       PCA of interest rate changes
       Vasicek model




                                                               1
Development of VAR Model for Stress
Testing of Macro Economy




                                      2
VAR Model
Flow of Stress Test of Macro Economy


•
                                                 Start of stress testing

    Typical flow of the stress test of         (recognize needs, define
                                                        purpose)
                                                                               •Study the past events

    macro economy is shown.                                                    •Opinion of professionals
                                                                               •Subjective view of management

•   Flexibility and rationality are
                                                   1. Trigger event
                                                (shock on an economic
                                                        index)                  •Estimation using macro
    retained by splitting trigger event                                         economy model (VAR model,
                                                                                etc.)
    and spreading effect model.                  2. Sequential event


•
                                              (impact on other economic

    Economic model is converted to
                                                       indices)                 •Projection using linear
                                                                                regression model, etc.

    a risk factor to cope with risk            3. Change in risk factors

    characteristics of the own
                                          (impact on detailed indices, which
                                            impact on value of a company)       •Sensitivity of corporate value

    company.                                                                    to a risk factor ×Width of
                                                                                change in a risk factor


•   Time-series model is used to
                                              4. Fluctuation of value of a
                                                       company
                                                                                •Analysis of results
    allow estimating amount of loss                                             •Consideration of
                                                                                countermeasures
    and its timing of occurrence                 Managerial decision            •Development of a report


    simultaneously.


                                                                                                                  3
VAR Model
VAR(Vector AutoRegression) model and impulse response function 1/2


 •   Definition of VAR model
       X t  C  A1 X t 1  A2 X t  2   Ap X t  p   t
     Macro index at time t
                                            Impact from                   Noise
  (Equity index, GDP, foreign
                                              past X
     exchange rate, etc.)
 •   Definition of impulse response function (= function
     showing reminder of the shock)
     Impact of shock Δ     Expected value of index after n     Expected value of index after
       after n periods        periods with the shock            n periods without the shock


        I n, , t 1  : E  X t  n t  , t 1   E  X t  n t 1 
                             Bn               B is coefficient matrix when inversely
                                                presenting VAR model to VMA model
                                                                                               4
VARモデル
VAR(Vector AutoRegression) model and impulse response function 2/2


 •   Orthogonal impulse response function

     I O n   Bn Pe j
       j


          The jth factor of orthogonal impulse
                    response function

 •   Generalized impulse response function

     I n   
                   1
      G
      j            jj
                      2
                          Bn e j

          The jth factor of generalized impulse
                    response function



                                                                     5
VAR Model
GVAR(Global Vector AutoRegression) model

 •   VARX(VAR with eXogenous variables) model
    (Model by region with exogenous variable (Y: X with
weighted average of region other than i)
X ti  C i  A1i X ti1  A2 X ti2   Aip X ti p  G0Yt k  G1iYt 1   GqYt q   t
                           i                           i             k       i k




Index at time t   Impact of itself in the past          External impact          Noise
                    (endogenous variable)            (exogenous variable)

 •   GVAR model (VAR model consolidating VARX model)
 X t1   0       G0  X t1   A1
                    1              1
                                                 0  X t11   A21
                                                                       0  X t1 2   1 
 2 2               2                         2               2    2    t
 X  G
 t   0          0  X t   0
                      
                        
                                                A1  X t 1   0
                                                   2 
                                                                     A2  X t  2    t 
                                                                        2
                                                                                     
(Case with number of locations: i=1,2, lag of endogenous variable: p=2,
lag of exogenous variable: q=0)
                                                                                                 6
VAR model
Implementation using R – Condition for Implementation

•   Model applied
    •  Both VAR and GVAR are modeled.
    •  Lags assumed are 2 for endogenous and 0 for exogenous.
•   Region and indices applied
    •  Region: Japan, US, Europe
    •  Index: Equity price (NKY225, S&P500, FTSE100),
              Interest rate (10-year LIBOR swap)
•   Data source
    •  Monthly data for the period of 10 years (with 120 data
       points) between March 2002 and February 2012 of
       Bloomberg and MSN Finance is logged and used.

                                                            7
VAR Model
Past Data Used




【Equity Price Index】             【10-year LIBOR Swap Rate】
20,000                           7.000
18,000
                                 6.000
16,000
14,000                           5.000
                       NKY225                                JPY
12,000                           4.000
10,000                 SP500                                 USD

 8,000                 FTSE100   3.000                       EUR
 6,000                           2.000
 4,000
                                 1.000
 2,000
    0                            0.000




                                                                   8
VAR Model
Output of Results ①

•   Package used                          #Specify VAR package
                                          library(vars)
    •   “vars”: A package                 #Obtain data
                                          economic_data <- read.csv("data.csv")
        corresponding to VAR model
•   Coding with R
                                          #Calibrate VAR model (lag is up to 2 periods)
                                          lag<-2

    •
                                          result_var <-
                                          VAR(economic_data,p=lag,type="both",season=NULL,exogen=NULL)
        Reading data
    •   Calibration using function
                                          #Calculate orthogonalized impulse response function (output for the
                                          coming 48 periods)
                                          project_term <- 48
        “VAR”                             result_var_irf <-
                                          irf(result_var,impulse=NULL,response=NULL,n.ahead=project_term,orth
    •   Calculation of impulse            o=TRUE,cumulative=FALSE,boot=FALSE,ci=0.95,runs=1000,seed=1)

                                          #Output VAR coefficient
        response function using           result_var_Bcoef<-Bcoef(result_var)
                                          write.table(result_var_Bcoef,file="var_Bcoef.csv",sep=",",row.names=F
        function “irf” and others         ALSE)

    •   Pasting on Excel sheet upon       #Output orthogonalized impulse response function
                                          write.table(result_var_irf$irf,file="var_irf.csv",sep=",",row.names=FALS
        outputting future estimation,     E)

        impulse response function, etc.


                                                                                                                     9
VAR Model
Output of Results ②

 •   Set up Excel so that desired results can be output
     under the following controllable portion.
     Macro Economic Stress Test

     ○Selection of IRF
             2 1:orthogonalized IRF 2:generalized IRF

     ○Amount of impact
     Equity (variance % from current) Interest Rate (Absolute value of impact in %)
     JPY         US         EU        JPY        US         EU
           -30%          0%        0%       0.00       0.00       0.00

     ○Results to output
             1 1:JPY 2:US 3:EU



 •   Sample result using the above setup
      【Equity Price Index】                                                            【10-year LIBOR Swap Rate (Japan)】




                                                                                                                          10
Interest Rate Model




                      11
Interest Rate Model

• Change in the external environment (convergence to
 the international accounting standards)
⇒Market value of liabilities (insurance & annuity)

 • Estimate of yield curve using Nelson-Siegel model
 • Measure of the interest rate risks
    Risk measure by PCA and measurement of interest rate risks in line with
     product characteristics
    Risk measure using Vasicek Mode




                                                                               12
Interest Rate Model
Estimation of Yield Curve


                                               Develop interest rate data based on
      1. Time-series interest rate data        the information on public & corporate
                                               bonds of Ministry of Finance, Japan
                                               Securities Dealers Association, etc.

                                               Interpolation of spline function and others,
          2. Estimation of spot rate           Estimate of spot rate from final yield



                                               Selection of model for yield curve
            3. Selection of model               Spline polynomial
                                                Nelson-Siegel model



                                               Estimate each of the model parameters
    4. Estimation of parameter (yield curve)   using spot rate values




                                                                                              13
Interest Rate Model
Estimation of Yield Curve


  Estimation of spot rate

           Obtaining interest rate data                                                  redemption/zero yield(2011.12.30)
                                                                            2.5



                                                                                 2

          Maximum term available for
                                                                            1.5
         measure (spline interpolation)
                                                                           利




                                                                          Rate
                                                                           率1


                                                                                                                actual data
                                                                                                                観測値
                                                                            0.5
        Estimation of spot rate from final                                                                      zero yield
                                                                                                                redemption yield
                      yield                                                      0
    n                                    n                                           0       5     10     15     20      25        30
          C                R                      C             R
    (1  r (s)) s  (1  r (n))n
   S 0
                                      
                                        S  0 (1  rr )
                                                        s
                                                          
                                                            (1  rr ) n
                                                                                                         年限
                                                                                                        Term
           z               z
                                                                                 Data: Excerpt fro MOF HP (JGB interest rate information)
    C:coupon R:redemption payment rz:spot rate rr:redemption yield
Interest Rate Model
Estimation of an Yield Curve


  Estimation of yield curve                                              ##Read interest rate data, set up term
                                                                          Data <- read.table("data/kinri_2.csv",header=T,sep=",")
                                                                          Term <- c(1:10,15,20,30)
                 Selection of model                                      -------------------------------------------------
                                                                         <Interpolate by spline function using R function
                                                                         “smooth.spline” in package “stats” >
    Model using basis function (f(t))
                                                                         #spline interpolation
      t   1   a j f j t           t:Discountfactor
                                                                         for (i in 1:nrow(Data)){
                                                                         sp <- smooth.spline(Term ,as.vector(Data[i,2:ncol(Data)]))
           Spline polynomial model                                         round(predict(sp, seq(0.5,30, length=60))[[2]],10) }
           B-Spline model                                                -------------------------------------------------
           Bernstein polynomial model                                    <Estimate parameters in Nelson-Siegel using R function
                                                                         “estim_nss” in package “termstrc” >
    Yield curve model
                                                                         ##Set data in datazeroyields
      Nelson-Siegel model                                                 datazeroyields <- zeroyields(Term, yield, dates)

                                   
      r m    0  1   2  1  e  m     m /     e
                                                            2
                                                                  m    ##Estimation of parameters for Nelson-Siegel, Svensson model
                                                                          ns_res <- estim_nss(datazeroyields,method = "ns",
      r m  : spot   rate                                                                        tauconstr = c(0.2, 6, 0.1))
                                                                          asv_res <- estim_nss(datazeroyields,method = "asv",
                                                                                                    tauconstr = c(0.2, 7, 0.1))
   Estimation of parameter (yield curve)
Interest Rate Model
Estimation of an Yield Curve


      Parameters in Nelson-Siege model                  estimate zero yield (2011.12.30)
                                           2.5



                                                2



                                           1.5


                                         利




                                         Rate
                                         率 1




                                           0.5
                                                                               zero yield

                                                                               estimate zero yeild
                                                0
                                                    0    5       10     15      20          25       30
                                                                       年限
                                                                       Term




                                                                                                          16
PCA of interest rate changes




                               17
PCA of interest rate changes
   PCA is a statistical method to aggregate multi-dimensional
    variables into lower number of dimensions.
   Dissolution of time-series and multi-dimensional interest
    change data into non-correlated common components can
    explain the interest rate variances with lower number of
    variances.
   Interest rate changes can be mostly explained with 3
    principal components: Parallel, Twist and Butterfly.
   R already has the function “prcomp(x)” for PCA, and we
    can take advantage of it.




                                                                 18
PCA of JGB spot rate
      Analysis on JGB spot rate % of variances
      Conditions
          Historical data used:
              Converting JGB yield to spot rates and calculate monthly variances for Jan. 2002~Dec. 2011
          Grid points: Year of 1,2,3,4,5,7,10,15,20,30年



      Results

                                                                                        PCA Result
                                                                  0.6

                 PC1           PC2           PC3                  0.5
                                                                  0.4
Weight
寄与率              74.85%        17.47%         4.16%               0.3
Accm. weight
累積寄与率            74.85%        92.32%        96.48%               0.2                                                PC1
                                                                  0.1                                                PC2
                                                                   0                                                 PC3
                                                                 ‐0.1   1   2   3   4    5   7   10   15   20   30

                                                                 ‐0.2
                                                                 ‐0.3
                                                                 ‐0.4




                                                                                                                           19
Comparison of interest risks by products (1)
   Compared 2 interest risks: risk by PCA (Assumption) and risk by actual interest changes
    (Actual Change), assuming CFs from 2 insurance products

                                                                                 2

                                          PC   (a               CFn  DFn ) 
                                          3
              Risk1( Assumption )               x          x ,n
                                         x 1

              a x , n ::第x成分の neigenvector at x th component and term n
                        Element of 年限の固有ベクトルの 値
              DFn : DiscountFa ctor  (1  rn )  n
              Risk 2( Actual Change )  EVt 1  EVt



   Period Jan. 2007~Dec. 2011 (monthly)
   For PCA, previous 10-year data from valuation date is used
   Risk Resource Distribution of Actual Change into principal components of variances
       Measure weights in Actual Change among each component (PC1,PC2,PC3,Others) by lease square
                                                      リスク量の変動
                                                      Actual Change
        PCz
                           PCy
                                                                                     ActualChan ge     Weight of PCx 
                                                                                                                        2
                                                          weight
                                                      PCzの寄与


                                                    weight
                                                PCyの寄与



                  weight
              PCxの寄与                                               PCx

                                                                                                                            20
Comparison of interest risks by products (1)
   Products
       Whole life lump sum (WLL)
          Entry age: age 30
          Premium payment period :30 years
       Whole life annuity (WLA)
          Entry age: age 30
          Premium payment period :30 years
          Pension commencement age :age 60


    We assume the following CFs from the valuation date

                                                           CF
                          12000
                          10000
                           8000
                           6000
                           4000
                           2000
                              0                                                   WLL
                                                                                 終身保険
                          ‐2000                                                   WLA
                                                                                 終身年金
                          ‐4000
                          ‐6000
                          ‐8000
                                  0   5 10 15 20 25 30 35 40 45 50 55 60 65 70
                                                        Year




                                                                                        21
0.5
                                              1.5
                                                        2.5




                  0
                                    1
                                                    2
                                                              3
     2002/07/01
     2003/02/01
     2003/09/01
     2004/04/01
     2004/11/01
     2005/06/01
     2006/01/01
     2006/08/01
     2007/03/01
                                                                        Historical JGB yield




     2007/10/01
     2008/05/01
                                                                  JGB




     2008/12/01
     2009/07/01
     2010/02/01
     2010/09/01
     2011/04/01
     2011/11/01
                                          JGB 2Y


                      JGB 20Y
                                JGB 10Y




22
0
                  1
                  2
                  3
                  4
                  5
                  6
                  7
                  8
     2002/07/01
     2003/02/01
     2003/09/01
     2004/04/01
     2004/11/01
     2005/06/01
     2006/01/01
     2006/08/01
     2007/03/01
     2007/10/01
     2008/05/01
     2008/12/01
     2009/07/01
     2010/02/01
     2010/09/01
     2011/04/01
     2011/11/01
                                                        Italian Government Bonds
                                                                                   Historical Italian Government Bonds yield




                                            IT Gov 2Y


                  IT Gov 20Y
                               IT Gov 10Y




23
Result (WLL, JGB Yield)
                                                                                          WLL                                                                                                                                                                    Observation
                              Actual Change vs Assumption
25000                                                                                                                                                                                                                                                Assumption returns a constant risk
20000

15000
                                                                                                                                                                                                                                                      amount irrelevant to the timing.
10000
                                                                                                                                                                                                              |Actual Chg|                           ActualChange varies significantly when
 5000

    0
                                                                                                                                                                                                              Assumption
                                                                                                                                                                                                                                                      the histrical rate experiences huge
        2007/01/01

                      2007/07/01

                                        2008/01/01

                                                              2008/07/01

                                                                                   2009/01/01

                                                                                                    2009/07/01

                                                                                                                 2010/01/01

                                                                                                                              2010/07/01

                                                                                                                                                   2011/01/01

                                                                                                                                                                       2011/07/01                                                                     changes.

                                                                                                  Histgram
 0.35

  0.3
                                                                                                                                                                                                                                                     Assumption captures the
 0.25                                                                                                                                                                                                                        Actual/Assumption
  0.2
                                                                                                                                                                                                                             Average       0.11
                                                                                                                                                                                                                                                      ActuarlChange in fairly good manner.
                                                                                                                                                                                                 Actuarl/Assump
 0.15
                                                                                                                                                                                                 NormalDistribution          Stdev         0.87
  0.1

 0.05

   0
        ‐5            ‐4            ‐3               ‐2               ‐1                 0              1         2           3                4                5



                                        Risk Resource Distribution
 100%
  90%
  80%
  70%                                                                                                                                                                                                               Others
  60%
  50%
  40%
                                                                                                                                                                                                                    PC3
                                                                                                                                                                                                                                                     PC1(Parallel) contributes to
                                                                                                                                                                                                                    PC2
  30%
  20%
  10%
                                                                                                                                                                                                                    PC1                               ActualChange largely.
   0%
         2007/01/01

                           2007/07/01

                                                 2008/01/01

                                                                           2008/07/01

                                                                                                2009/01/01

                                                                                                                 2009/07/01

                                                                                                                                  2010/01/01

                                                                                                                                                          2010/07/01

                                                                                                                                                                                    2011/01/01

                                                                                                                                                                                                 2011/07/01
Result (WLA, JGB Yield)
                                                                                          WLA                                                                                                                                                                 Observation
                               Actual Change vs Assumption
90000
80000
                                                                                                                                                                                                                                                  Assumption returns a constant risk
70000
60000                                                                                                                                                                                                                                              amount irrelevant to the timing.
50000
40000
30000
20000
                                                                                                                                                                                                          |Actual Chg|                            ActualChange varies significantly when
10000
    0
                                                                                                                                                                                                          Assumption
                                                                                                                                                                                                                                                   the histrical rate experiences huge
        2007/01/01

                      2007/07/01

                                        2008/01/01

                                                           2008/07/01

                                                                                     2009/01/01

                                                                                                         2009/07/01

                                                                                                                         2010/01/01

                                                                                                                                      2010/07/01

                                                                                                                                                       2011/01/01

                                                                                                                                                                        2011/07/01                                                                 changes.

                                                                                                     Histgram
0.25

 0.2                                                                                                                                                                                                                                              Assumption somewhat underestimates
                                                                                                                                                                                                                         Actual/Assumption
0.15
                                                                                                                                                                                                                         Average      (0.07)
                                                                                                                                                                                                                                                   but captures ActuarlChange in fairly
                                                                                                                                                                                                                                                   good manner.
                                                                                                                                                                                             Actuarl/Assump
 0.1
                                                                                                                                                                                             NormalDistribution          Stdev         1.22
0.05

   0
        ‐5           ‐4            ‐3            ‐2              ‐1                      0                 1            2             3            4                5



                                       Risk Resource Distribution
100%
 90%
 80%
 70%                                                                                                                                                                                                           Others
 60%
 50%
 40%
                                                                                                                                                                                                               PC3
                                                                                                                                                                                                               PC2
                                                                                                                                                                                                                                                  PC2(Twist) contributes to
                                                                                                                                                                                                                                                   ActualChange largely.
 30%
 20%                                                                                                                                                                                                           PC1
 10%
  0%
        2007/01/01

                          2007/07/01

                                              2008/01/01

                                                                        2008/07/01

                                                                                                  2009/01/01

                                                                                                                      2009/07/01

                                                                                                                                      2010/01/01

                                                                                                                                                           2010/07/01

                                                                                                                                                                                2011/01/01

                                                                                                                                                                                             2011/07/01




                                                                                                                                                                                                                                                                                            25
Result (WLL, Italian Government Bonds Yield)
                                                                                        WLL                                                                                                                                                                      Observation
                                       Actual Change/Assumption
60000
50000
                                                                                                                                                                                                                                                     Assumption misses to capture
40000                                                                                                                                                                                                                                                 ActualChange at the time of Euro crisis
                                                                                                                                                                                                                                                      (2011-).
30000
20000                                                                                                                                                                                                        |Actual Chg|
10000                                                                                                                                                                                                        Assumption
   0
        2007/01/01

                      2007/07/01

                                        2008/01/01

                                                             2008/07/01

                                                                                   2009/01/01

                                                                                                      2009/07/01

                                                                                                                     2010/01/01

                                                                                                                                      2010/07/01

                                                                                                                                                        2011/01/01

                                                                                                                                                                          2011/07/01




                                                                                                  Histgram
0.25

                                                                                                                                                                                                                                                     Assumption underestimates the risk.
                                                                                                                                                                                                                            Actual/Assumption
 0.2

0.15                                                                                                                                                                                                                        Average      (0.10)
                                                                                                                                                                                                                            Stdev         1.60
                                                                                                                                                                                                Actuarl/Assump
 0.1
                                                                                                                                                                                                NormalDistribution

0.05

   0
        ‐5           ‐4            ‐3                ‐2             ‐1                  0               1          2              3                 4                5



                                       Risk Resource Distribution
 100%
  90%
  80%

                                                                                                                                                                                                                                                      Like JGB, PC1(Parallel) contributes to
  70%                                                                                                                                                                                                             Others
  60%
  50%                                                                                                                                                                                                             PC3
                                                                                                                                                                                                                                                  
  40%
  30%
  20%
                                                                                                                                                                                                                  PC2                                 the variances most.
                                                                                                                                                                                                                  PC1
  10%
   0%
        2007/01/01

                          2007/07/01

                                                2008/01/01

                                                                          2008/07/01

                                                                                                2009/01/01

                                                                                                                   2009/07/01

                                                                                                                                       2010/01/01

                                                                                                                                                             2010/07/01

                                                                                                                                                                                   2011/01/01

                                                                                                                                                                                                2011/07/01
Result (WLA, Italian Government Bonds Yield)
                                                                                 WLA                                                                                                                                                                                                        Observation
                                  Actual Change vs Assumption
70000
60000
                                                                                                                                                                                                                                                                                Assumption misses to capture
50000
40000
                                                                                                                                                                                                                                                                                 ActualChange at the time of Euro crisis
30000
                                                                                                                                                                                                                                         |Actual Chg|
                                                                                                                                                                                                                                                                                 (2011-).
20000
                                                                                                                                                                                                                                         Assumption
10000
    0
        2007/01/01
                     2007/06/01
                                  2007/11/01
                                                2008/04/01
                                                              2008/09/01
                                                                             2009/02/01
                                                                                            2009/07/01
                                                                                                            2009/12/01
                                                                                                                            2010/05/01
                                                                                                                                             2010/10/01
                                                                                                                                                              2011/03/01
                                                                                                                                                                                2011/08/01
                                                                                                                                                                                                  2012/01/01




                                                                                             Histgram
 0.25
                                                                                                                                                                                                                                                                                Assumption significantly
  0.2
                                                                                                                                                                                                                                                        Actual/Assumption
 0.15                                                                                                                                                                                                                                                   Average       0.31       underestimates the risk.
  0.1
                                                                                                                                                                                                                      Actuarl/Assump                    Stdev         2.83
                                                                                                                                                                                                                      NormalDistribution
 0.05

   0




                                          Risk Resource Distribution
 100%
  90%
  80%
  70%
  60%
  50%
                                                                                                                                                                                                                                               Others
                                                                                                                                                                                                                                               PC3
                                                                                                                                                                                                                                                                                PC2(Twist) and PC3 (Butterfly) largely
  40%
  30%
                                                                                                                                                                                                                                               PC2                               contributes to the variances .
  20%                                                                                                                                                                                                                                          PC1
  10%
   0%
        2007/01/01
                     2007/05/01
                                  2007/09/01
                                               2008/01/01
                                                             2008/05/01
                                                                           2008/09/01
                                                                                          2009/01/01
                                                                                                         2009/05/01
                                                                                                                         2009/09/01
                                                                                                                                         2010/01/01
                                                                                                                                                          2010/05/01
                                                                                                                                                                           2010/09/01
                                                                                                                                                                                             2011/01/01
                                                                                                                                                                                                               2011/05/01
                                                                                                                                                                                                                            2011/09/01
Parameter Estimation of Vasicek Model
And Risk Measurement




                                        28
Vasicek model
Outline
   A representative equilibrium model
   Pros: Manageable because short rate is subject to normal distribution
   Cons: Permit minus interest rate

   Vasicek model formula: represent short rate rt with n state variables
          n
    rt   yit               dyit   i  i  yit dt   i dzit
         i 1


   Calculate zero bond price using model parameters and obtain term
    structure of interest rates
                          i1 Bi ( )yit
                             n
                A( ) 
    P( )  e
                     i Bi ( )     i 2 Bi 2 ( )         ij i j 
                                                                           
                                                                                                                    
                                                                                                                               
                                                                                                                                
                n
                                                                                                        1
     A( )                                                            Bi ( )  B j ( )           1 e i j          
              i 1        i2               4 i  i  j  i j                                   i   j                  
                                                  2        i i   i 2
     Bi ( )  1  e 
                1          
                                         i   i  i 
                                                    
                                                                  
                                                            i  2
                                   i

              i                                                 


                                                                                                                                    29
Vasicek model
Parameter estimation
   Assume the short rate is subject to the following random process and
    estimate model parameters (κ, θ, σ, λ).
    r (tl ) | Ftl 1 ~ N ( { i (1  e  ki t )  e  ki t yi },   (tl )| Ft )
                                                                               l 1
                           i                                    i, j


   One typical solution is to regard the observable shortest interest rate
    as short rate and estimate parameters using maximum-likelihood
    method.
   However, while maximum-likelihood method is efficient to estimate
    short rate, it is known that it is not always applicable to model the
    whole yield curve as it only uses short rate data.
   Using historical “yield curve” information is preferable.

     Express the model in “state space model” and estimate the
    parameters using “Kalman filter technique”


                                                                                      30
Vasicek model
Parameter estimation
1.     Express Vasicek model in “state space model”
2.     Use Kalman filter algorithm and conditioned probability distribution of
       state variables
3.     Calculate the log likelihood
4.     Estimate parameters maximizing log likelihood in 3.
    State space model                                       Predict one period ahead                                         Filter

     yt k  c  F  yt k 1   t k                            yt k |t k 1  c  F  yt k 1 |t k 1                                                            
                                                                                                                                K t k  Vt k |t k 1  H T  H  Vt k |t k 1  H T  R         1


     z t k  a  H  yt k   t k                             Vt k |t k 1  F  Vt k 1 |t k 1  F T  Qt k                                                         
                                                                                                                                     yt k |t k  yt k |t k 1  K t k z t k  a  H  yt k |t k 1   
                                                                                                                                                                 
                                                                                                                                 Vt k |t k  I  K t k  H  Vt k |t k 1
    Log likelihood


     l ( )   mK log 2                                                    z                                 T d t1|t zt                      
                                                                                                                                              zt k |t k 1 
               1                                   K                                   K
                                                          log d t k |t k 1                         z t k |t k 1
               2                                                                                                                                          
                                                                                                                                                            
                                                   k 1                                k 1   tk                            k k 1       k



             ztk |tk 1  A  H  ytk |tk 1   d t k |t k 1  H  Vt k |t k 1  H T  R




                                                                                                                                                                                                     31
Vasicek model
Implementation in R and risk measurement
            Parameter estimate
1.           Calculate coefficients in state space
2.           Calculate log likelihood (using function “fkf” in package “FKF”)
3.           Estimate parameters maximizing log likelihood (using function “optim”)
            Measure interest risk
4.           Generate random variables and yield curves 1 yr later
5.           Calculate changes in PV of CF and percentile amount
             10 samples of yield curves 1 yr later
                1年後のイールドカーブ (10個のサンプル)                                   Histogram of changes in PV of CF
                                                                              現在価値の変動額のヒストグラム
 3.50%                                                         12

 3.00%                                                         10
 2.50%                                                         8
 2.00%                                                         6
 1.50%                                                         4
 1.00%
                                                               2
 0.50%
                                                               0
                                                                      ‐90
                                                                      ‐80
                                                                      ‐70
                                                                      ‐60
                                                                      ‐50
                                                                      ‐40
                                                                      ‐30
                                                                      ‐20
                                                                      ‐10




                                                                      100
                                                                      110
                                                                     ‐110
                                                                     ‐100




                                                                        0
                                                                       10
                                                                       20
                                                                       30
                                                                       40
                                                                       50
                                                                       60
                                                                       70
                                                                       80
                                                                       90



                                                                    次の級
 0.00%
         0       5     10     15     20    25        30   35


                                                                    (Assuming 100 CF in 10 grid points during year 1 - 30)



                                                                                                                             32
Summary

• Even when it is difficult to generate economic
  scenarios from scratch on Excel, R provide packages
  for most economic models. Utilizing them help
  actuaries implement economic models.
   •  We saw that using the package “vars” enables us
      to calibrate the VAR model’s coefficients and
      utilize other functions with a single command.
   •  As to the interest rate model, we saw that R
      command can accelerate our analysis in Nelson-
      Siegel model, PCA and Kalman filter algorithm.



                                                        33
Reference

• VAR model
  •   About generalized impulse response function
       •   M. H. Pesaran and Shin Y (May 1997), “Generalized Impulse
           Response Analysis in Linear Multivariate Models”
  •   About GVAR
       •   O. Castren, S. Dees and Zaher, F (February 2008), “Global
           Macro-Financial Shocks and Expected Default Frequencies in
           the Euro Area”
  •   About vars package
       •   Reference manual ”Package ‘vars’ January2, 2012”




                                                                        34
Reference

• Interest Rate Model
   •   About estimation of yield curve and PCA of interest rate variances
        •   Mark Deacon & Andrew Derry   “Estimating the Term Structure of
            Interest Rates”
        •   田中 周二 「アクチュアリーの統計分析」 朝倉書店
   •   About Vasicek model
        •   大塚裕次朗 「Vasicek/CIR Modelのキャリブレーション手法と日本
            の金利VaR99.5%」 日本アクチュアリー会会報64(1)
        •   Bolder, David “Affine Term Structure Models: Theory and
            Implementation “Bank of Canada Working Paper 2001-15
        •   北川源四郎 「時系列解析入門」 岩波書店




                                                                             35

Más contenido relacionado

Destacado

Oil Prices Modelling
Oil Prices ModellingOil Prices Modelling
Oil Prices ModellingHanan Naser
 
Chapter 2. Multivariate Analysis of Stationary Time Series
 Chapter 2. Multivariate Analysis of Stationary Time Series Chapter 2. Multivariate Analysis of Stationary Time Series
Chapter 2. Multivariate Analysis of Stationary Time SeriesChengjun Wang
 
Dissertation (VAR Models- Financial Risk Management)
Dissertation (VAR Models- Financial Risk Management)Dissertation (VAR Models- Financial Risk Management)
Dissertation (VAR Models- Financial Risk Management)Ece Akbulut
 
Estimation de l'ecart de production et inflation dans la CEMAC
Estimation de l'ecart de production et inflation dans la CEMACEstimation de l'ecart de production et inflation dans la CEMAC
Estimation de l'ecart de production et inflation dans la CEMACUniversité de Dschang
 
Lecture 1 - 23 september 2012
Lecture  1 - 23 september 2012Lecture  1 - 23 september 2012
Lecture 1 - 23 september 2012Nimisha Gupta
 
Déterminants de l'inflation dans la CEMAC: le rôle de la monnaie
Déterminants de l'inflation dans la CEMAC: le rôle de la monnaieDéterminants de l'inflation dans la CEMAC: le rôle de la monnaie
Déterminants de l'inflation dans la CEMAC: le rôle de la monnaieUniversité de Dschang
 
Flevy.com - Financial Derivatives - Forwards/Futures/Options
Flevy.com - Financial Derivatives - Forwards/Futures/OptionsFlevy.com - Financial Derivatives - Forwards/Futures/Options
Flevy.com - Financial Derivatives - Forwards/Futures/OptionsDavid Tracy
 
Risk management models - Core Consulting
Risk management models - Core ConsultingRisk management models - Core Consulting
Risk management models - Core ConsultingCORE Consulting
 
Fm11 ch 23 derivatives and risk management
Fm11 ch 23 derivatives and risk managementFm11 ch 23 derivatives and risk management
Fm11 ch 23 derivatives and risk managementNhu Tuyet Tran
 
Econometrics theory and_applications_with_eviews
Econometrics theory and_applications_with_eviewsEconometrics theory and_applications_with_eviews
Econometrics theory and_applications_with_eviewsDeiven Jesus Palpa
 

Destacado (20)

isi
isiisi
isi
 
Oil Prices Modelling
Oil Prices ModellingOil Prices Modelling
Oil Prices Modelling
 
Cours econométrie des séries temporelles (1)
Cours econométrie des séries temporelles (1)Cours econométrie des séries temporelles (1)
Cours econométrie des séries temporelles (1)
 
Serial correlation
Serial correlationSerial correlation
Serial correlation
 
Chapter 2. Multivariate Analysis of Stationary Time Series
 Chapter 2. Multivariate Analysis of Stationary Time Series Chapter 2. Multivariate Analysis of Stationary Time Series
Chapter 2. Multivariate Analysis of Stationary Time Series
 
Heteroskedasticity
HeteroskedasticityHeteroskedasticity
Heteroskedasticity
 
Dissertation (VAR Models- Financial Risk Management)
Dissertation (VAR Models- Financial Risk Management)Dissertation (VAR Models- Financial Risk Management)
Dissertation (VAR Models- Financial Risk Management)
 
Var Problems
Var ProblemsVar Problems
Var Problems
 
Estimation de l'ecart de production et inflation dans la CEMAC
Estimation de l'ecart de production et inflation dans la CEMACEstimation de l'ecart de production et inflation dans la CEMAC
Estimation de l'ecart de production et inflation dans la CEMAC
 
Lecture 1 - 23 september 2012
Lecture  1 - 23 september 2012Lecture  1 - 23 september 2012
Lecture 1 - 23 september 2012
 
Déterminants de l'inflation dans la CEMAC: le rôle de la monnaie
Déterminants de l'inflation dans la CEMAC: le rôle de la monnaieDéterminants de l'inflation dans la CEMAC: le rôle de la monnaie
Déterminants de l'inflation dans la CEMAC: le rôle de la monnaie
 
7_Credit Derivatives
7_Credit Derivatives7_Credit Derivatives
7_Credit Derivatives
 
Stress Testing
Stress TestingStress Testing
Stress Testing
 
Flevy.com - Financial Derivatives - Forwards/Futures/Options
Flevy.com - Financial Derivatives - Forwards/Futures/OptionsFlevy.com - Financial Derivatives - Forwards/Futures/Options
Flevy.com - Financial Derivatives - Forwards/Futures/Options
 
Risk management models - Core Consulting
Risk management models - Core ConsultingRisk management models - Core Consulting
Risk management models - Core Consulting
 
Credit risk models
Credit risk modelsCredit risk models
Credit risk models
 
Fm11 ch 23 derivatives and risk management
Fm11 ch 23 derivatives and risk managementFm11 ch 23 derivatives and risk management
Fm11 ch 23 derivatives and risk management
 
Presentation on credit risk
Presentation on credit risk Presentation on credit risk
Presentation on credit risk
 
Econometrics theory and_applications_with_eviews
Econometrics theory and_applications_with_eviewsEconometrics theory and_applications_with_eviews
Econometrics theory and_applications_with_eviews
 
Value at Risk
Value at RiskValue at Risk
Value at Risk
 

Similar a Use of R in Actuarial Work

Monte carlo option pricing final v3
Monte carlo option pricing final v3Monte carlo option pricing final v3
Monte carlo option pricing final v3naojan
 
Parameter Estimation for Semiparametric Models with CMARS and Its Applications
Parameter Estimation for Semiparametric Models with CMARS and Its ApplicationsParameter Estimation for Semiparametric Models with CMARS and Its Applications
Parameter Estimation for Semiparametric Models with CMARS and Its ApplicationsSSA KPI
 
An AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security EvaluationAn AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security EvaluationPorfirio Tramontana
 
Condition Monitoring Of Unsteadily Operating Equipment
Condition Monitoring Of Unsteadily Operating EquipmentCondition Monitoring Of Unsteadily Operating Equipment
Condition Monitoring Of Unsteadily Operating EquipmentJordan McBain
 
CBM Variable Speed Machinery
CBM Variable Speed MachineryCBM Variable Speed Machinery
CBM Variable Speed MachineryJordan McBain
 
Christmas Talk07
Christmas Talk07Christmas Talk07
Christmas Talk07Terry Lynch
 
Tanfani testi-alvarez presentation final
Tanfani testi-alvarez presentation finalTanfani testi-alvarez presentation final
Tanfani testi-alvarez presentation finalRene Alvarez
 
Don reinertsen is it time to rethink deming
Don reinertsen   is it time to rethink demingDon reinertsen   is it time to rethink deming
Don reinertsen is it time to rethink demingAGILEMinds
 
Methods and Tools for Studying Discrete Events
Methods and Tools for Studying Discrete EventsMethods and Tools for Studying Discrete Events
Methods and Tools for Studying Discrete EventsAccenture
 
Parametric Survival Analysis in Health Economics
Parametric Survival Analysis   in Health Economics Parametric Survival Analysis   in Health Economics
Parametric Survival Analysis in Health Economics HTAi Bilbao 2012
 
Models Of Modeling
Models Of ModelingModels Of Modeling
Models Of ModelingRoger Smith
 
Dynamic Trading Volume
Dynamic Trading VolumeDynamic Trading Volume
Dynamic Trading Volumeguasoni
 
Bridging marke- credit risk-Modelling the Incremental Risk Charge.pptx
Bridging marke- credit risk-Modelling the  Incremental Risk Charge.pptxBridging marke- credit risk-Modelling the  Incremental Risk Charge.pptx
Bridging marke- credit risk-Modelling the Incremental Risk Charge.pptxGarima Singh Makhija
 
Pres pmi2012 surface_grinding_model_v2
Pres pmi2012 surface_grinding_model_v2Pres pmi2012 surface_grinding_model_v2
Pres pmi2012 surface_grinding_model_v2Marco Leonesio
 
T305 tutorial 4
T305 tutorial 4T305 tutorial 4
T305 tutorial 4hoooma
 
Introduction to Interest Rate Models by Antoine Savine
Introduction to Interest Rate Models by Antoine SavineIntroduction to Interest Rate Models by Antoine Savine
Introduction to Interest Rate Models by Antoine SavineAntoine Savine
 
Kdd12 tutorial-inf-part-iii
Kdd12 tutorial-inf-part-iiiKdd12 tutorial-inf-part-iii
Kdd12 tutorial-inf-part-iiiLaks Lakshmanan
 
A0067927 amit sinha_thesis
A0067927 amit sinha_thesisA0067927 amit sinha_thesis
A0067927 amit sinha_thesisAmit Sinha
 

Similar a Use of R in Actuarial Work (20)

Monte carlo option pricing final v3
Monte carlo option pricing final v3Monte carlo option pricing final v3
Monte carlo option pricing final v3
 
Parameter Estimation for Semiparametric Models with CMARS and Its Applications
Parameter Estimation for Semiparametric Models with CMARS and Its ApplicationsParameter Estimation for Semiparametric Models with CMARS and Its Applications
Parameter Estimation for Semiparametric Models with CMARS and Its Applications
 
An AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security EvaluationAn AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security Evaluation
 
Condition Monitoring Of Unsteadily Operating Equipment
Condition Monitoring Of Unsteadily Operating EquipmentCondition Monitoring Of Unsteadily Operating Equipment
Condition Monitoring Of Unsteadily Operating Equipment
 
CBM Variable Speed Machinery
CBM Variable Speed MachineryCBM Variable Speed Machinery
CBM Variable Speed Machinery
 
Design of Design of Technology Transfer Services
Design of Design of Technology Transfer ServicesDesign of Design of Technology Transfer Services
Design of Design of Technology Transfer Services
 
Christmas Talk07
Christmas Talk07Christmas Talk07
Christmas Talk07
 
Tanfani testi-alvarez presentation final
Tanfani testi-alvarez presentation finalTanfani testi-alvarez presentation final
Tanfani testi-alvarez presentation final
 
Don reinertsen is it time to rethink deming
Don reinertsen   is it time to rethink demingDon reinertsen   is it time to rethink deming
Don reinertsen is it time to rethink deming
 
Methods and Tools for Studying Discrete Events
Methods and Tools for Studying Discrete EventsMethods and Tools for Studying Discrete Events
Methods and Tools for Studying Discrete Events
 
Parametric Survival Analysis in Health Economics
Parametric Survival Analysis   in Health Economics Parametric Survival Analysis   in Health Economics
Parametric Survival Analysis in Health Economics
 
Models Of Modeling
Models Of ModelingModels Of Modeling
Models Of Modeling
 
Dynamic Trading Volume
Dynamic Trading VolumeDynamic Trading Volume
Dynamic Trading Volume
 
Bridging marke- credit risk-Modelling the Incremental Risk Charge.pptx
Bridging marke- credit risk-Modelling the  Incremental Risk Charge.pptxBridging marke- credit risk-Modelling the  Incremental Risk Charge.pptx
Bridging marke- credit risk-Modelling the Incremental Risk Charge.pptx
 
Pres pmi2012 surface_grinding_model_v2
Pres pmi2012 surface_grinding_model_v2Pres pmi2012 surface_grinding_model_v2
Pres pmi2012 surface_grinding_model_v2
 
T305 tutorial 4
T305 tutorial 4T305 tutorial 4
T305 tutorial 4
 
Introduction to Interest Rate Models by Antoine Savine
Introduction to Interest Rate Models by Antoine SavineIntroduction to Interest Rate Models by Antoine Savine
Introduction to Interest Rate Models by Antoine Savine
 
Kdd12 tutorial-inf-part-iii
Kdd12 tutorial-inf-part-iiiKdd12 tutorial-inf-part-iii
Kdd12 tutorial-inf-part-iii
 
Modeling full scale-data(2)
Modeling full scale-data(2)Modeling full scale-data(2)
Modeling full scale-data(2)
 
A0067927 amit sinha_thesis
A0067927 amit sinha_thesisA0067927 amit sinha_thesis
A0067927 amit sinha_thesis
 

Más de 基晴 出井

「ベイズ推定でパラメータリスクを捉える &優れたサンプラーとしてのMCMC」の実装例rstanコード
「ベイズ推定でパラメータリスクを捉える &優れたサンプラーとしてのMCMC」の実装例rstanコード「ベイズ推定でパラメータリスクを捉える &優れたサンプラーとしてのMCMC」の実装例rstanコード
「ベイズ推定でパラメータリスクを捉える &優れたサンプラーとしてのMCMC」の実装例rstanコード基晴 出井
 
ベイズ推定でパラメータリスクを捉える&優れたサンプラーとしてのMCMC
ベイズ推定でパラメータリスクを捉える&優れたサンプラーとしてのMCMCベイズ推定でパラメータリスクを捉える&優れたサンプラーとしてのMCMC
ベイズ推定でパラメータリスクを捉える&優れたサンプラーとしてのMCMC基晴 出井
 
Pioneering Technology, Which (May) Change Management of Insurance Companies
Pioneering Technology, Which (May) Change Management of Insurance CompaniesPioneering Technology, Which (May) Change Management of Insurance Companies
Pioneering Technology, Which (May) Change Management of Insurance Companies基晴 出井
 
A New Approach to Predict Emerging Risks Using Risk DNA Model
A New Approach to Predict Emerging Risks Using Risk DNA ModelA New Approach to Predict Emerging Risks Using Risk DNA Model
A New Approach to Predict Emerging Risks Using Risk DNA Model基晴 出井
 
TokyoR_日銀のマクロストレステストをRで追う
TokyoR_日銀のマクロストレステストをRで追うTokyoR_日銀のマクロストレステストをRで追う
TokyoR_日銀のマクロストレステストをRで追う基晴 出井
 

Más de 基晴 出井 (7)

「ベイズ推定でパラメータリスクを捉える &優れたサンプラーとしてのMCMC」の実装例rstanコード
「ベイズ推定でパラメータリスクを捉える &優れたサンプラーとしてのMCMC」の実装例rstanコード「ベイズ推定でパラメータリスクを捉える &優れたサンプラーとしてのMCMC」の実装例rstanコード
「ベイズ推定でパラメータリスクを捉える &優れたサンプラーとしてのMCMC」の実装例rstanコード
 
ベイズ推定でパラメータリスクを捉える&優れたサンプラーとしてのMCMC
ベイズ推定でパラメータリスクを捉える&優れたサンプラーとしてのMCMCベイズ推定でパラメータリスクを捉える&優れたサンプラーとしてのMCMC
ベイズ推定でパラメータリスクを捉える&優れたサンプラーとしてのMCMC
 
Pioneering Technology, Which (May) Change Management of Insurance Companies
Pioneering Technology, Which (May) Change Management of Insurance CompaniesPioneering Technology, Which (May) Change Management of Insurance Companies
Pioneering Technology, Which (May) Change Management of Insurance Companies
 
A New Approach to Predict Emerging Risks Using Risk DNA Model
A New Approach to Predict Emerging Risks Using Risk DNA ModelA New Approach to Predict Emerging Risks Using Risk DNA Model
A New Approach to Predict Emerging Risks Using Risk DNA Model
 
TokyoR_日銀のマクロストレステストをRで追う
TokyoR_日銀のマクロストレステストをRで追うTokyoR_日銀のマクロストレステストをRで追う
TokyoR_日銀のマクロストレステストをRで追う
 
Test2
Test2Test2
Test2
 
Test
TestTest
Test
 

Use of R in Actuarial Work

  • 1. FY2012 Annual Meeting of the Institute of Actuaries of Japan Use of R in Actuarial Work VAR Model Interest Rate November 6, 2012 R Subcommittee, ASTIN Related Study Group Motoharu Dei, Milliman, Inc.
  • 2. Table of Contents  VAR model  Development of VAR model for stress testing of macro economy  Interest rate  Interest rate model  PCA of interest rate changes  Vasicek model 1
  • 3. Development of VAR Model for Stress Testing of Macro Economy 2
  • 4. VAR Model Flow of Stress Test of Macro Economy • Start of stress testing Typical flow of the stress test of (recognize needs, define purpose) •Study the past events macro economy is shown. •Opinion of professionals •Subjective view of management • Flexibility and rationality are 1. Trigger event (shock on an economic index) •Estimation using macro retained by splitting trigger event economy model (VAR model, etc.) and spreading effect model. 2. Sequential event • (impact on other economic Economic model is converted to indices) •Projection using linear regression model, etc. a risk factor to cope with risk 3. Change in risk factors characteristics of the own (impact on detailed indices, which impact on value of a company) •Sensitivity of corporate value company. to a risk factor ×Width of change in a risk factor • Time-series model is used to 4. Fluctuation of value of a company •Analysis of results allow estimating amount of loss •Consideration of countermeasures and its timing of occurrence Managerial decision •Development of a report simultaneously. 3
  • 5. VAR Model VAR(Vector AutoRegression) model and impulse response function 1/2 • Definition of VAR model X t  C  A1 X t 1  A2 X t  2   Ap X t  p   t Macro index at time t Impact from Noise (Equity index, GDP, foreign past X exchange rate, etc.) • Definition of impulse response function (= function showing reminder of the shock) Impact of shock Δ Expected value of index after n Expected value of index after after n periods periods with the shock n periods without the shock I n, , t 1  : E  X t  n t  , t 1   E  X t  n t 1   Bn  B is coefficient matrix when inversely presenting VAR model to VMA model 4
  • 6. VARモデル VAR(Vector AutoRegression) model and impulse response function 2/2 • Orthogonal impulse response function I O n   Bn Pe j j The jth factor of orthogonal impulse response function • Generalized impulse response function I n    1 G j jj 2 Bn e j The jth factor of generalized impulse response function 5
  • 7. VAR Model GVAR(Global Vector AutoRegression) model • VARX(VAR with eXogenous variables) model (Model by region with exogenous variable (Y: X with weighted average of region other than i) X ti  C i  A1i X ti1  A2 X ti2   Aip X ti p  G0Yt k  G1iYt 1   GqYt q   t i i k i k Index at time t Impact of itself in the past External impact Noise (endogenous variable) (exogenous variable) • GVAR model (VAR model consolidating VARX model)  X t1   0 G0  X t1   A1 1 1 0  X t11   A21 0  X t1 2   1   2 2  2     2     2    2  t  X  G  t   0 0  X t   0     A1  X t 1   0 2    A2  X t  2    t  2     (Case with number of locations: i=1,2, lag of endogenous variable: p=2, lag of exogenous variable: q=0) 6
  • 8. VAR model Implementation using R – Condition for Implementation • Model applied • Both VAR and GVAR are modeled. • Lags assumed are 2 for endogenous and 0 for exogenous. • Region and indices applied • Region: Japan, US, Europe • Index: Equity price (NKY225, S&P500, FTSE100), Interest rate (10-year LIBOR swap) • Data source • Monthly data for the period of 10 years (with 120 data points) between March 2002 and February 2012 of Bloomberg and MSN Finance is logged and used. 7
  • 9. VAR Model Past Data Used 【Equity Price Index】 【10-year LIBOR Swap Rate】 20,000 7.000 18,000 6.000 16,000 14,000 5.000 NKY225 JPY 12,000 4.000 10,000 SP500 USD 8,000 FTSE100 3.000 EUR 6,000 2.000 4,000 1.000 2,000 0 0.000 8
  • 10. VAR Model Output of Results ① • Package used #Specify VAR package library(vars) • “vars”: A package #Obtain data economic_data <- read.csv("data.csv") corresponding to VAR model • Coding with R #Calibrate VAR model (lag is up to 2 periods) lag<-2 • result_var <- VAR(economic_data,p=lag,type="both",season=NULL,exogen=NULL) Reading data • Calibration using function #Calculate orthogonalized impulse response function (output for the coming 48 periods) project_term <- 48 “VAR” result_var_irf <- irf(result_var,impulse=NULL,response=NULL,n.ahead=project_term,orth • Calculation of impulse o=TRUE,cumulative=FALSE,boot=FALSE,ci=0.95,runs=1000,seed=1) #Output VAR coefficient response function using result_var_Bcoef<-Bcoef(result_var) write.table(result_var_Bcoef,file="var_Bcoef.csv",sep=",",row.names=F function “irf” and others ALSE) • Pasting on Excel sheet upon #Output orthogonalized impulse response function write.table(result_var_irf$irf,file="var_irf.csv",sep=",",row.names=FALS outputting future estimation, E) impulse response function, etc. 9
  • 11. VAR Model Output of Results ② • Set up Excel so that desired results can be output under the following controllable portion. Macro Economic Stress Test ○Selection of IRF 2 1:orthogonalized IRF 2:generalized IRF ○Amount of impact Equity (variance % from current) Interest Rate (Absolute value of impact in %) JPY US EU JPY US EU -30% 0% 0% 0.00 0.00 0.00 ○Results to output 1 1:JPY 2:US 3:EU • Sample result using the above setup 【Equity Price Index】 【10-year LIBOR Swap Rate (Japan)】 10
  • 13. Interest Rate Model • Change in the external environment (convergence to the international accounting standards) ⇒Market value of liabilities (insurance & annuity) • Estimate of yield curve using Nelson-Siegel model • Measure of the interest rate risks  Risk measure by PCA and measurement of interest rate risks in line with product characteristics  Risk measure using Vasicek Mode 12
  • 14. Interest Rate Model Estimation of Yield Curve Develop interest rate data based on 1. Time-series interest rate data the information on public & corporate bonds of Ministry of Finance, Japan Securities Dealers Association, etc. Interpolation of spline function and others, 2. Estimation of spot rate Estimate of spot rate from final yield Selection of model for yield curve 3. Selection of model Spline polynomial Nelson-Siegel model Estimate each of the model parameters 4. Estimation of parameter (yield curve) using spot rate values 13
  • 15. Interest Rate Model Estimation of Yield Curve Estimation of spot rate Obtaining interest rate data redemption/zero yield(2011.12.30) 2.5 2 Maximum term available for 1.5 measure (spline interpolation) 利 Rate 率1 actual data 観測値 0.5 Estimation of spot rate from final zero yield redemption yield yield 0 n n 0 5 10 15 20 25 30 C R C R  (1  r (s)) s  (1  r (n))n S 0  S  0 (1  rr ) s  (1  rr ) n 年限 Term z z Data: Excerpt fro MOF HP (JGB interest rate information) C:coupon R:redemption payment rz:spot rate rr:redemption yield
  • 16. Interest Rate Model Estimation of an Yield Curve Estimation of yield curve ##Read interest rate data, set up term Data <- read.table("data/kinri_2.csv",header=T,sep=",") Term <- c(1:10,15,20,30) Selection of model ------------------------------------------------- <Interpolate by spline function using R function “smooth.spline” in package “stats” > Model using basis function (f(t)) #spline interpolation  t   1   a j f j t   t:Discountfactor  for (i in 1:nrow(Data)){ sp <- smooth.spline(Term ,as.vector(Data[i,2:ncol(Data)])) Spline polynomial model round(predict(sp, seq(0.5,30, length=60))[[2]],10) } B-Spline model ------------------------------------------------- Bernstein polynomial model <Estimate parameters in Nelson-Siegel using R function “estim_nss” in package “termstrc” > Yield curve model ##Set data in datazeroyields Nelson-Siegel model datazeroyields <- zeroyields(Term, yield, dates)  r m    0  1   2  1  e  m   m /     e 2 m  ##Estimation of parameters for Nelson-Siegel, Svensson model ns_res <- estim_nss(datazeroyields,method = "ns", r m  : spot rate tauconstr = c(0.2, 6, 0.1)) asv_res <- estim_nss(datazeroyields,method = "asv", tauconstr = c(0.2, 7, 0.1)) Estimation of parameter (yield curve)
  • 17. Interest Rate Model Estimation of an Yield Curve Parameters in Nelson-Siege model estimate zero yield (2011.12.30) 2.5 2 1.5 利 Rate 率 1 0.5 zero yield estimate zero yeild 0 0 5 10 15 20 25 30 年限 Term 16
  • 18. PCA of interest rate changes 17
  • 19. PCA of interest rate changes  PCA is a statistical method to aggregate multi-dimensional variables into lower number of dimensions.  Dissolution of time-series and multi-dimensional interest change data into non-correlated common components can explain the interest rate variances with lower number of variances.  Interest rate changes can be mostly explained with 3 principal components: Parallel, Twist and Butterfly.  R already has the function “prcomp(x)” for PCA, and we can take advantage of it. 18
  • 20. PCA of JGB spot rate  Analysis on JGB spot rate % of variances  Conditions  Historical data used:  Converting JGB yield to spot rates and calculate monthly variances for Jan. 2002~Dec. 2011  Grid points: Year of 1,2,3,4,5,7,10,15,20,30年  Results PCA Result 0.6 PC1 PC2 PC3 0.5 0.4 Weight 寄与率 74.85% 17.47% 4.16% 0.3 Accm. weight 累積寄与率 74.85% 92.32% 96.48% 0.2 PC1 0.1 PC2 0 PC3 ‐0.1 1 2 3 4 5 7 10 15 20 30 ‐0.2 ‐0.3 ‐0.4 19
  • 21. Comparison of interest risks by products (1)  Compared 2 interest risks: risk by PCA (Assumption) and risk by actual interest changes (Actual Change), assuming CFs from 2 insurance products 2  PC   (a  CFn  DFn )  3 Risk1( Assumption )  x x ,n x 1 a x , n ::第x成分の neigenvector at x th component and term n Element of 年限の固有ベクトルの 値 DFn : DiscountFa ctor  (1  rn )  n Risk 2( Actual Change )  EVt 1  EVt  Period Jan. 2007~Dec. 2011 (monthly)  For PCA, previous 10-year data from valuation date is used  Risk Resource Distribution of Actual Change into principal components of variances  Measure weights in Actual Change among each component (PC1,PC2,PC3,Others) by lease square リスク量の変動 Actual Change PCz PCy ActualChan ge   Weight of PCx  2 weight PCzの寄与 weight PCyの寄与 weight PCxの寄与 PCx 20
  • 22. Comparison of interest risks by products (1)  Products  Whole life lump sum (WLL)  Entry age: age 30  Premium payment period :30 years  Whole life annuity (WLA)  Entry age: age 30  Premium payment period :30 years  Pension commencement age :age 60 We assume the following CFs from the valuation date CF 12000 10000 8000 6000 4000 2000 0 WLL 終身保険 ‐2000 WLA 終身年金 ‐4000 ‐6000 ‐8000 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 Year 21
  • 23. 0.5 1.5 2.5 0 1 2 3 2002/07/01 2003/02/01 2003/09/01 2004/04/01 2004/11/01 2005/06/01 2006/01/01 2006/08/01 2007/03/01 Historical JGB yield 2007/10/01 2008/05/01 JGB 2008/12/01 2009/07/01 2010/02/01 2010/09/01 2011/04/01 2011/11/01 JGB 2Y JGB 20Y JGB 10Y 22
  • 24. 0 1 2 3 4 5 6 7 8 2002/07/01 2003/02/01 2003/09/01 2004/04/01 2004/11/01 2005/06/01 2006/01/01 2006/08/01 2007/03/01 2007/10/01 2008/05/01 2008/12/01 2009/07/01 2010/02/01 2010/09/01 2011/04/01 2011/11/01 Italian Government Bonds Historical Italian Government Bonds yield IT Gov 2Y IT Gov 20Y IT Gov 10Y 23
  • 25. Result (WLL, JGB Yield) WLL Observation Actual Change vs Assumption 25000  Assumption returns a constant risk 20000 15000 amount irrelevant to the timing. 10000 |Actual Chg|  ActualChange varies significantly when 5000 0 Assumption the histrical rate experiences huge 2007/01/01 2007/07/01 2008/01/01 2008/07/01 2009/01/01 2009/07/01 2010/01/01 2010/07/01 2011/01/01 2011/07/01 changes. Histgram 0.35 0.3  Assumption captures the 0.25 Actual/Assumption 0.2 Average 0.11 ActuarlChange in fairly good manner. Actuarl/Assump 0.15 NormalDistribution Stdev 0.87 0.1 0.05 0 ‐5 ‐4 ‐3 ‐2 ‐1 0 1 2 3 4 5 Risk Resource Distribution 100% 90% 80% 70% Others 60% 50% 40% PC3  PC1(Parallel) contributes to PC2 30% 20% 10% PC1 ActualChange largely. 0% 2007/01/01 2007/07/01 2008/01/01 2008/07/01 2009/01/01 2009/07/01 2010/01/01 2010/07/01 2011/01/01 2011/07/01
  • 26. Result (WLA, JGB Yield) WLA Observation Actual Change vs Assumption 90000 80000  Assumption returns a constant risk 70000 60000 amount irrelevant to the timing. 50000 40000 30000 20000 |Actual Chg|  ActualChange varies significantly when 10000 0 Assumption the histrical rate experiences huge 2007/01/01 2007/07/01 2008/01/01 2008/07/01 2009/01/01 2009/07/01 2010/01/01 2010/07/01 2011/01/01 2011/07/01 changes. Histgram 0.25 0.2  Assumption somewhat underestimates Actual/Assumption 0.15 Average (0.07) but captures ActuarlChange in fairly good manner. Actuarl/Assump 0.1 NormalDistribution Stdev 1.22 0.05 0 ‐5 ‐4 ‐3 ‐2 ‐1 0 1 2 3 4 5 Risk Resource Distribution 100% 90% 80% 70% Others 60% 50% 40% PC3 PC2  PC2(Twist) contributes to ActualChange largely. 30% 20% PC1 10% 0% 2007/01/01 2007/07/01 2008/01/01 2008/07/01 2009/01/01 2009/07/01 2010/01/01 2010/07/01 2011/01/01 2011/07/01 25
  • 27. Result (WLL, Italian Government Bonds Yield) WLL Observation Actual Change/Assumption 60000 50000  Assumption misses to capture 40000 ActualChange at the time of Euro crisis (2011-). 30000 20000 |Actual Chg| 10000 Assumption 0 2007/01/01 2007/07/01 2008/01/01 2008/07/01 2009/01/01 2009/07/01 2010/01/01 2010/07/01 2011/01/01 2011/07/01 Histgram 0.25  Assumption underestimates the risk. Actual/Assumption 0.2 0.15 Average (0.10) Stdev 1.60 Actuarl/Assump 0.1 NormalDistribution 0.05 0 ‐5 ‐4 ‐3 ‐2 ‐1 0 1 2 3 4 5 Risk Resource Distribution 100% 90% 80% Like JGB, PC1(Parallel) contributes to 70% Others 60% 50% PC3  40% 30% 20% PC2 the variances most. PC1 10% 0% 2007/01/01 2007/07/01 2008/01/01 2008/07/01 2009/01/01 2009/07/01 2010/01/01 2010/07/01 2011/01/01 2011/07/01
  • 28. Result (WLA, Italian Government Bonds Yield) WLA Observation Actual Change vs Assumption 70000 60000  Assumption misses to capture 50000 40000 ActualChange at the time of Euro crisis 30000 |Actual Chg| (2011-). 20000 Assumption 10000 0 2007/01/01 2007/06/01 2007/11/01 2008/04/01 2008/09/01 2009/02/01 2009/07/01 2009/12/01 2010/05/01 2010/10/01 2011/03/01 2011/08/01 2012/01/01 Histgram 0.25  Assumption significantly 0.2 Actual/Assumption 0.15 Average 0.31 underestimates the risk. 0.1 Actuarl/Assump Stdev 2.83 NormalDistribution 0.05 0 Risk Resource Distribution 100% 90% 80% 70% 60% 50% Others PC3  PC2(Twist) and PC3 (Butterfly) largely 40% 30% PC2 contributes to the variances . 20% PC1 10% 0% 2007/01/01 2007/05/01 2007/09/01 2008/01/01 2008/05/01 2008/09/01 2009/01/01 2009/05/01 2009/09/01 2010/01/01 2010/05/01 2010/09/01 2011/01/01 2011/05/01 2011/09/01
  • 29. Parameter Estimation of Vasicek Model And Risk Measurement 28
  • 30. Vasicek model Outline  A representative equilibrium model  Pros: Manageable because short rate is subject to normal distribution  Cons: Permit minus interest rate  Vasicek model formula: represent short rate rt with n state variables n rt   yit dyit   i  i  yit dt   i dzit i 1  Calculate zero bond price using model parameters and obtain term structure of interest rates i1 Bi ( )yit n A( )  P( )  e   i Bi ( )     i 2 Bi 2 ( )   ij i j          n 1 A( )         Bi ( )  B j ( )  1 e i j  i 1  i2 4 i  i  j  i j   i   j  2  i i   i 2 Bi ( )  1  e  1    i   i  i    i  2 i i   29
  • 31. Vasicek model Parameter estimation  Assume the short rate is subject to the following random process and estimate model parameters (κ, θ, σ, λ). r (tl ) | Ftl 1 ~ N ( { i (1  e  ki t )  e  ki t yi },   (tl )| Ft ) l 1 i i, j  One typical solution is to regard the observable shortest interest rate as short rate and estimate parameters using maximum-likelihood method.  However, while maximum-likelihood method is efficient to estimate short rate, it is known that it is not always applicable to model the whole yield curve as it only uses short rate data.  Using historical “yield curve” information is preferable. Express the model in “state space model” and estimate the parameters using “Kalman filter technique” 30
  • 32. Vasicek model Parameter estimation 1. Express Vasicek model in “state space model” 2. Use Kalman filter algorithm and conditioned probability distribution of state variables 3. Calculate the log likelihood 4. Estimate parameters maximizing log likelihood in 3.  State space model  Predict one period ahead  Filter yt k  c  F  yt k 1   t k yt k |t k 1  c  F  yt k 1 |t k 1  K t k  Vt k |t k 1  H T  H  Vt k |t k 1  H T  R 1 z t k  a  H  yt k   t k Vt k |t k 1  F  Vt k 1 |t k 1  F T  Qt k  yt k |t k  yt k |t k 1  K t k z t k  a  H  yt k |t k 1    Vt k |t k  I  K t k  H  Vt k |t k 1  Log likelihood l ( )   mK log 2    z T d t1|t zt   zt k |t k 1  1 K K log d t k |t k 1  z t k |t k 1 2   k 1 k 1 tk k k 1 k ztk |tk 1  A  H  ytk |tk 1 d t k |t k 1  H  Vt k |t k 1  H T  R 31
  • 33. Vasicek model Implementation in R and risk measurement  Parameter estimate 1. Calculate coefficients in state space 2. Calculate log likelihood (using function “fkf” in package “FKF”) 3. Estimate parameters maximizing log likelihood (using function “optim”)  Measure interest risk 4. Generate random variables and yield curves 1 yr later 5. Calculate changes in PV of CF and percentile amount 10 samples of yield curves 1 yr later 1年後のイールドカーブ (10個のサンプル) Histogram of changes in PV of CF 現在価値の変動額のヒストグラム 3.50% 12 3.00% 10 2.50% 8 2.00% 6 1.50% 4 1.00% 2 0.50% 0 ‐90 ‐80 ‐70 ‐60 ‐50 ‐40 ‐30 ‐20 ‐10 100 110 ‐110 ‐100 0 10 20 30 40 50 60 70 80 90 次の級 0.00% 0 5 10 15 20 25 30 35 (Assuming 100 CF in 10 grid points during year 1 - 30) 32
  • 34. Summary • Even when it is difficult to generate economic scenarios from scratch on Excel, R provide packages for most economic models. Utilizing them help actuaries implement economic models. • We saw that using the package “vars” enables us to calibrate the VAR model’s coefficients and utilize other functions with a single command. • As to the interest rate model, we saw that R command can accelerate our analysis in Nelson- Siegel model, PCA and Kalman filter algorithm. 33
  • 35. Reference • VAR model • About generalized impulse response function • M. H. Pesaran and Shin Y (May 1997), “Generalized Impulse Response Analysis in Linear Multivariate Models” • About GVAR • O. Castren, S. Dees and Zaher, F (February 2008), “Global Macro-Financial Shocks and Expected Default Frequencies in the Euro Area” • About vars package • Reference manual ”Package ‘vars’ January2, 2012” 34
  • 36. Reference • Interest Rate Model • About estimation of yield curve and PCA of interest rate variances • Mark Deacon & Andrew Derry “Estimating the Term Structure of Interest Rates” • 田中 周二 「アクチュアリーの統計分析」 朝倉書店 • About Vasicek model • 大塚裕次朗 「Vasicek/CIR Modelのキャリブレーション手法と日本 の金利VaR99.5%」 日本アクチュアリー会会報64(1) • Bolder, David “Affine Term Structure Models: Theory and Implementation “Bank of Canada Working Paper 2001-15 • 北川源四郎 「時系列解析入門」 岩波書店 35