SlideShare a Scribd company logo
1 of 27
Download to read offline
Watching Macro Stress Test of Bank of 
          Japan Using R

            Motoharu Dei
             2012/10/20
Source of Today’s Topic
Website of Bank of Japan (BOJ)
                             “Research & Study” corner




                                      http://www.boj.or.jp/research/index.htm/


                “Financial System Report”
Financial System Report
• Published twice a year since 2005
• Studying & evaluating the stability of 
  financial system in Japan

• We focus on “Macro Stress Test” under 
  Chapter 5 “Risk resistance of the 
  Financial System” this time.
What is Stress Test?
• A test to simulate the level of damages and/or 
  mitigation plans under the assumed “exceptional but 
  plausible” stress scenarios
   – For example, “ Is the financial system OK, if a stock plunge 
     event at the level of Lehman shock happens again?”
   – Check a vague concern “If it is OK when a major shock 
     happens?” or “What to do?” by actually projecting it.

• We recently saw the word on the newspaper:
   – Stress test for banks in EU countries at Greek economic 
     crisis
   – Stress test for nuclear power plant
Macro Stress Test by BOJ
• Calculate the impact of macro economy stress to each of the 
  following risks on the equity capital ratio (Tier1) of banks.
   – Credit risk of bank lending + Equity risk of cross‐shareholdings
       ←Simultaneous shock of real GDP and TOPIX with 5% probability (once a 20 
        periods event) on bank lending and bank’s portfolio stocks
   – Interest rising risk
       ←3 types of interest rising shocks on interest income decline and price decline of 
        securities held by banks
   – Market value loss risk of securities against shock in overseas market
       ←Shock of European equity price and German government bond interest rate 
        with 1% probability on securities price held by banks
   – Foreign currency liquidity risk
       ←Malfunction for the period of 1 month of foreign currency swap market, repo 
        market and CD&CP market
   – Loss enlargement risk due to interaction of financial capital market 
     and real economy in case of a shock in overseas market
Flow of the Test
   • Calculate the impact of macro economy stress to each of the 
     following risks on the equity capital ratio (Tier1) of banks.
            – Credit risk of bank lending + Equity risk of cross‐shareholdings

                                                                                                                 Credit cost model
                  Real effective                                 Financial situation of
                     foreign                                           borrower                    Transition probability of 
                                                                                                                                        Credit cost
                  exchange rate                                  (ICR, cash‐to‐current              debtor’s classification*
                                                                    liabilities ratio)
5% probability       Real GDP
    shock                                     Negative impact in line with lower growth rate


                   GDP deflator                                     Nominal GDP                                                                       Tier I  Ratio
                                                                                                          Equity valuation simulation

5% probability        TOPIX                                          Equity price              Market Beta         Equity valuation gain & loss
    shock
                                                                                                                Income simulation
                 Long‐term lending 
                   interest rate                                Long‐term lending 
                                                                                               Lending spread        Core business net income
                                                                  interest rate

                   VAR model
                                    Economic forecast of
                                     private think tank
Flow of the Test
   • Calculate the impact of macro economy stress to each of the 
     following risks on the equity capital ratio (Tier1) of banks.
            – Credit risk of bank lending + Equity risk of cross‐shareholdings


                  Real effective 
                     foreign 
                  exchange rate
                                          We focus on only this as all is too much.
5% probability       Real GDP
    shock

                   GDP deflator
                                                                      Equity valuation simulation

5% probability        TOPIX                  Equity price   Market Beta       Equity valuation gain & loss
    shock

                 Long‐term lending 
                   interest rate


                   VAR model
Flow of the Test
    • Calculate the impact of macro economy stress to each of the 
      following risks on the equity capital ratio (Tier1) of banks.
            – Credit risk of bank lending + Equity risk of cross‐shareholdings


                  Real effective 
                     foreign 
                  exchange rate

5% probability       Real GDP
    shock

                   GDP deflator
                                                                    Equity valuation simulation

5% probability        TOPIX                Equity price   Market Beta       Equity valuation gain & loss
    shock

                 Long‐term lending 
                   interest rate


                   VAR model

      Analysis using a macro economic index                    Analysis by bank
Stressing Macro Economy
                    using a VAR Model
• VAR (Vector AutoRegression) model?

                                          Equity 
                                           price

                               GDP            Interest 
      Equity                                    rate
       price     Correlation
                                     FX                                      t -3
GDP             Interest 
                  rate               t -1
        FX                                          Equity 
                                                     price
                                                               Interest                      t -4
         t                                  GDP                  rate

                                                          FX

                                                      t-2              (when k=2 under the illustration)
Stressing Macro Economy
                    using a VAR Model
• VAR (Vector AutoRegression) model?

                                          Equity 
                                           price

                               GDP            Interest 
      Equity                                    rate                       Occurrence of sock!!
       price     Correlation
                                     FX                                         t -3
GDP             Interest 
                  rate               t -1
        FX                                          Equity 
                                                     price
                                                               Interest                           t -4
         t                                  GDP                  rate

                                                          FX

                                                      t-2              (when k=2 under the illustration)
Stressing Macro Economy
                    using a VAR Model
• VAR (Vector AutoRegression) model?

                                          Equity 
                                           price

                               GDP            Interest 
      Equity                                    rate
       price     Correlation
                                     FX                                      t -3
GDP             Interest 
                  rate               t -1
        FX                                          Equity 
                                                     price
                                                               Interest                      t -4
         t                                  GDP                  rate

                                                          FX

                                                      t-2              (when k=2 under the illustration)
Stressing Macro Economy
                    using a VAR Model
• VAR (Vector AutoRegression) model?

                                          Equity 
                                           price

                               GDP            Interest 
      Equity                                    rate
       price     Correlation
                                     FX                                      t -3
GDP             Interest 
                  rate               t -1
        FX                                          Equity 
                                                     price
                                                               Interest                      t -4
         t                                  GDP                  rate

                                                          FX

                                                      t-2              (when k=2 under the illustration)
Stressing Macro Economy
                     using a VAR Model
• VAR (Vector AutoRegression) model?

                                           Equity 
Shock Propagation!!                         price

                                GDP            Interest 
       Equity                                    rate
        price     Correlation
                                      FX                                      t -3
 GDP             Interest 
                   rate               t -1
         FX                                          Equity 
                                                      price
                                                                Interest                      t -4
          t                                  GDP                  rate

                                                           FX

                                                       t-2              (when k=2 under the illustration)
Stressing Macro Economy
               using a VAR Model
• VAR (Vector AutoRegression) model?


Shock Propagation!!
Stressing Macro Economy
               using a VAR Model
• VAR (Vector AutoRegression) model?


Shock Propagation!!




• It can simulate how a shock occurred in a certain macro 
  index at a certain timing is transmitted to other macro 
  indices toward the future.
VAR Model on R
                  Real effective 
                     foreign 
                  exchange rate

5% probability       Real GDP
    shock

                   GDP deflator
                                                                    Equity valuation simulation

5% probability        TOPIX                Equity price   Market Beta       Equity valuation gain & loss
    shock

                 Long‐term lending 
                   interest rate


                   VAR model




       • In R, the package “vars” can solve major parts of technical difficulties
         in VAR model
       • Just one command in R script outputs such as coefficient matrix A1 and
         shock propagation function (impulse response function) Ij(n)
VAR Model on R
• Example of implementation
• Data should be gathered in advance from a package of 
  RFinanceYJ, and website of the BOJ and the Cabinet Office.

 #Package vars
 library(vars)

 #Prepare the data in advance
 datafile <- read.csv("data.csv")

 #Calibrate factors using VAR function
 p2ct<-VAR(datafile,p=2,type="both")

 #Calculate function of shock propagation using irf function
 var.irf <- irf(p2ct, response=c("EFEXRIND","REGDP","GDPDEF","TOPIX","LPRIMR_LOG"), n.ahead=19, boot=F)

 #Shocks on each of the real GDP and TOPIX
 shock.ByrealGDP <- var.irf$irf$REGDP
 shock.ByTOPIX <- var.irf$irf$TOPIX

 shock <- shock.ByrealGDP + shock.ByTOPIX
 shockToTOPIX <- shock[,4]
VAR Model on R
#Project future macro indices using predict function
pp2ct <- predict(p2ct,n.ahead=20)

TOPIXfcstn <- pp2ct$fcst$TOPIX[,1]

#Calculate the one applying a 5% shock as an after-the-shock TOPIX
TOPIXfcstnAfterShock <- TOPIXfcstn + shockToTOPIX * (-1.64)

TOPIXfcst <- c(datafile[,4],TOPIXfcstn)
TOPIXfcstAfterShock <- c(datafile[,4], TOPIXfcstnAfterShock)

#Working on Excel hereafter
excel.w <- function(dat){
   write.table(dat, "clipboard", sep="¥t", row.names = FALSE)
 }
excel.w(TOPIXfcst)
#Paste once on Excel
excel.w(TOPIXfcstAfterShock)
#Paste again on Excel
500
                600
                      700
                            800
                                  900
                                        1000
                                                     1100
                                                                 1200
Sep‐08
Apr‐09
Nov‐09
Jun‐10
Jan‐11
Aug‐11
Mar‐12
Oct‐12
                                                                        TOPIX




May‐13
Dec‐13
 Jul‐14
Feb‐15
Sep‐15
                                                                                VAR Model on R




Apr‐16
                                                      w/ shock

                                         w/o shock




Nov‐16
                                         ショック無
                                                      ショック有
Equity Valuation Gain & Loss 
                                          Analysis by Bank

                  Real effective 
                     foreign 
                  exchange rate

5% probability       Real GDP
    shock

                   GDP deflator
                                                                     Equity valuation simulation

5% probability        TOPIX                 Equity price   Market Beta       Equity valuation gain & loss
    shock

                 Long‐term lending 
                   interest rate


                   VAR model

      Analysis using a macro economic index                     Analysis by bank
Equity Valuation Gain & Loss 
                      Analysis by Bank
• “Market Beta” is an index showing relative size of a 
  change in price of a share to the change of the 
  benchmark.
   – When the benchmark (TOPIX) increases 10% and the share 
     increases 15% on average, the market beta of the share is 
     1.5.
           Change in the objective share (%)
                                                                1.5

                                                            1


                                               Change in TOPIX (%)




                                                   (For illustration purpose, return on risk-free asset is
                                                   assumed to be zero hereinafter)
Equity Valuation Gain & Loss 
                          Analysis by Bank
• Calculation of valuation gain & loss of equity 
  portfolio by bank
   – Calculate the amount of change in valuation gain & loss of 
      equity by bank through the following calculation by bank.
 Equity portfolio of Bank A T Market beta of each share

     Value of share ①            Share ①β

     Value of share ②            Share ②β
                        ×                     ×       Change in
     Value of share ③            Share ③β              TOPIX

           ・                         ・
           ・                         ・                Result of the
           ・                         ・                VAR model
Equity Valuation Gain & Loss 
                               Analysis by Bank
• Example of implementation
• As it is too cumbersome to check the actual portfolio of banks, 
  the shock is applied to a hypothetic bank holding IT share, 
  infrastructure share, manufacturing share and retailing share
  for 2.5 billion yen each.
 library(RFinanceYJ)

 #Index (TOPIX) 998405
 ST0 <- quoteStockTsData("998405",since="2007-01-01", time.interval="monthly")
 #IT share: Yahoo Japan 4689
 ST1 <- quoteStockTsData("4689",since="2007-01-01", time.interval="monthly")
 #Infrastructure share: JR East 9020
 ST2 <- quoteStockTsData("9020",since="2007-01-01", time.interval="monthly")
 #Manufacturing share: Toyota 7203
 ST3 <- quoteStockTsData("7203",since="2007-01-01", time.interval="monthly")
 #Retailing share: Lawson 2651
 ST4 <- quoteStockTsData("2651",since="2007-01-01", time.interval="monthly")

 ST <-data.frame(ST0=ST0[,5],ST1=ST1[,7],ST2=ST2[,7],ST3=ST3[,7],ST4=ST4[,7])

 #Calculation of rate of change
 IncST <- ST[2:70,]/ST[1:69,]-1
Equity Valuation Gain & Loss 
                                Analysis by Bank
#Calculate each β
ST1.lm <- lm(ST1~ST0, data=IncST)
ST1.beta <- ST1.lm$coefficients[2]
ST2.lm <- lm(ST2~ST0, data=IncST)
ST2.beta <- ST2.lm$coefficients[2]
ST3.lm <- lm(ST3~ST0, data=IncST)
ST3.beta <- ST3.lm$coefficients[2]
ST4.lm <- lm(ST4~ST0, data=IncST)
ST4.beta <- ST4.lm$coefficients[2]

ST.beta <- rbind(ST1.beta, ST2.beta, ST3.beta, ST4.beta)

#Calculate the amount of change in the asset of a hypothetic bank (holding shares of ST1-ST4 for 2.5 billion each
with total of 10.0 billion) to the shock 1 on TOPIX
STVariance <- as.numeric( 10^10 * t(as.matrix(rep(0.25,4)))%*%as.matrix(ST.beta))

#Drop rate of TOPIX after 1 year (after 4 quarters) since the shock under the VAR model
TOPIXvar.1yrAfterShock <- TOPIXfcstAfterShock[nrow(datafile)+4]/datafile$TOPIX[nrow(datafile)]-1

#Valuation loss of equity portfolio of the objective banks
STLoss <- STVariance * TOPIXvar.1yrAfterShock
Equity Valuation Gain & Loss 
                    Analysis by Bank


                             0.59                             0.43



Beta: TOPIX vs. Yahoo Japan         Beta: TOPIX vs. JR East




                             1.03                             0.14



    Beta: TOPIX vs. Toyota          Beta: TOPIX vs. Lawson
Equity Valuation Gain & Loss 
                           Analysis by Bank
                         T
                                                                                                                    TOPIX
                                                       1200
IT share: ¥2.5 billion         IT share β              1100                                                                                                                  ショック有
                                                                                                                                                                             w/ shock
                                            0.59                                                                                                                             ショック無
                                                                                                                                                                             w/o shock
                                                       1000
                             Infrastructure 
Infrastructure: ¥2.5b            share β 0.43
                                                       900

                                                       800


Manufacturing: ¥2.5b     ×   Manufacturing 
                                 share β 1.03
                                                   ×   700

                                                       600

                                                       500
                               Retailing 




                                                                       Apr‐09




                                                                                                                                                                                   Apr‐16
                                                              Sep‐08




                                                                                                                                                                 Feb‐15
                                                                                                                                                                          Sep‐15
                                                                                         Jun‐10




                                                                                                                                                        Jul‐14
                                                                                                                    Mar‐12




                                                                                                                                               Dec‐13
                                                                                                           Aug‐11


                                                                                                                             Oct‐12
                                                                                Nov‐09


                                                                                                  Jan‐11




                                                                                                                                                                                            Nov‐16
                                                                                                                                      May‐13
Retailing share: ¥2.5b
                               share β      0.14


                                                                          Drop of 20.6% after 1 year


                              Result of calculation:
          Valuation loss of 1.13 billion yen is generated after 1 year of
            the shock on the equity portfolio of 10.0 billion yen of the
                                 hypothetic bank!
Summary of Conclusion
                                                                                                 TOPIX
                                    1200

                                    1100                                                                                                                 ショック有
                                                                                                                                                         ショック無
                                    1000

                                    900

                                    800

                                    700

                                    600
                Real effective      500




                                                    Apr‐09




                                                                                                                                                                Apr‐16
                                           Sep‐08




                                                                                                                                              Feb‐15
                                                                                                                                                       Sep‐15
                                                                      Jun‐10




                                                                                                                                     Jul‐14
                                                                                                 Mar‐12




                                                                                                                            Dec‐13
                                                                                        Aug‐11


                                                                                                          Oct‐12
                                                             Nov‐09


                                                                               Jan‐11




                                                                                                                                                                         Nov‐16
                   foreign 




                                                                                                                   May‐13
                exchange rate

   5%             Real GDP
probability
  shock
                 GDP deflator
                                                                                                                                                                                  Equity valuation simulation

   5%               TOPIX                                                       Equity price                                                                                Market Beta         Equity valuation gain & loss
probability
  shock
              Long‐term lending 
                interest rate


                VAR model

                                                                                                                                              Valuation loss of 1.13 billion yen after 1
                                                                                                                                                year of the shock on the hypothetic
                                                                                                                                                bank with equity of 10.0 billion yen

More Related Content

More from 基晴 出井

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基晴 出井
 
Use of R in Actuarial Works
Use of R in Actuarial WorksUse of R in Actuarial Works
Use of R in Actuarial Works基晴 出井
 
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で追う基晴 出井
 

More from 基晴 出井 (6)

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
 
Use of R in Actuarial Works
Use of R in Actuarial WorksUse of R in Actuarial Works
Use of R in Actuarial Works
 
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
 

Tokyo R "Watching Macro Stress Test of Bank of Japan Using R"

  • 1. Watching Macro Stress Test of Bank of  Japan Using R Motoharu Dei 2012/10/20
  • 2. Source of Today’s Topic Website of Bank of Japan (BOJ) “Research & Study” corner http://www.boj.or.jp/research/index.htm/ “Financial System Report”
  • 3. Financial System Report • Published twice a year since 2005 • Studying & evaluating the stability of  financial system in Japan • We focus on “Macro Stress Test” under  Chapter 5 “Risk resistance of the  Financial System” this time.
  • 4. What is Stress Test? • A test to simulate the level of damages and/or  mitigation plans under the assumed “exceptional but  plausible” stress scenarios – For example, “ Is the financial system OK, if a stock plunge  event at the level of Lehman shock happens again?” – Check a vague concern “If it is OK when a major shock  happens?” or “What to do?” by actually projecting it. • We recently saw the word on the newspaper: – Stress test for banks in EU countries at Greek economic  crisis – Stress test for nuclear power plant
  • 5. Macro Stress Test by BOJ • Calculate the impact of macro economy stress to each of the  following risks on the equity capital ratio (Tier1) of banks. – Credit risk of bank lending + Equity risk of cross‐shareholdings ←Simultaneous shock of real GDP and TOPIX with 5% probability (once a 20  periods event) on bank lending and bank’s portfolio stocks – Interest rising risk ←3 types of interest rising shocks on interest income decline and price decline of  securities held by banks – Market value loss risk of securities against shock in overseas market ←Shock of European equity price and German government bond interest rate  with 1% probability on securities price held by banks – Foreign currency liquidity risk ←Malfunction for the period of 1 month of foreign currency swap market, repo  market and CD&CP market – Loss enlargement risk due to interaction of financial capital market  and real economy in case of a shock in overseas market
  • 6. Flow of the Test • Calculate the impact of macro economy stress to each of the  following risks on the equity capital ratio (Tier1) of banks. – Credit risk of bank lending + Equity risk of cross‐shareholdings Credit cost model Real effective  Financial situation of foreign  borrower Transition probability of  Credit cost exchange rate (ICR, cash‐to‐current  debtor’s classification* liabilities ratio) 5% probability Real GDP shock Negative impact in line with lower growth rate GDP deflator Nominal GDP Tier I  Ratio Equity valuation simulation 5% probability TOPIX Equity price Market Beta Equity valuation gain & loss shock Income simulation Long‐term lending  interest rate Long‐term lending  Lending spread Core business net income interest rate VAR model Economic forecast of private think tank
  • 7. Flow of the Test • Calculate the impact of macro economy stress to each of the  following risks on the equity capital ratio (Tier1) of banks. – Credit risk of bank lending + Equity risk of cross‐shareholdings Real effective  foreign  exchange rate We focus on only this as all is too much. 5% probability Real GDP shock GDP deflator Equity valuation simulation 5% probability TOPIX Equity price Market Beta Equity valuation gain & loss shock Long‐term lending  interest rate VAR model
  • 8. Flow of the Test • Calculate the impact of macro economy stress to each of the  following risks on the equity capital ratio (Tier1) of banks. – Credit risk of bank lending + Equity risk of cross‐shareholdings Real effective  foreign  exchange rate 5% probability Real GDP shock GDP deflator Equity valuation simulation 5% probability TOPIX Equity price Market Beta Equity valuation gain & loss shock Long‐term lending  interest rate VAR model Analysis using a macro economic index Analysis by bank
  • 9. Stressing Macro Economy using a VAR Model • VAR (Vector AutoRegression) model? Equity  price GDP Interest  Equity  rate price Correlation FX t -3 GDP Interest  rate t -1 FX Equity  price Interest  t -4 t GDP rate FX t-2 (when k=2 under the illustration)
  • 10. Stressing Macro Economy using a VAR Model • VAR (Vector AutoRegression) model? Equity  price GDP Interest  Equity  rate Occurrence of sock!! price Correlation FX t -3 GDP Interest  rate t -1 FX Equity  price Interest  t -4 t GDP rate FX t-2 (when k=2 under the illustration)
  • 11. Stressing Macro Economy using a VAR Model • VAR (Vector AutoRegression) model? Equity  price GDP Interest  Equity  rate price Correlation FX t -3 GDP Interest  rate t -1 FX Equity  price Interest  t -4 t GDP rate FX t-2 (when k=2 under the illustration)
  • 12. Stressing Macro Economy using a VAR Model • VAR (Vector AutoRegression) model? Equity  price GDP Interest  Equity  rate price Correlation FX t -3 GDP Interest  rate t -1 FX Equity  price Interest  t -4 t GDP rate FX t-2 (when k=2 under the illustration)
  • 13. Stressing Macro Economy using a VAR Model • VAR (Vector AutoRegression) model? Equity  Shock Propagation!! price GDP Interest  Equity  rate price Correlation FX t -3 GDP Interest  rate t -1 FX Equity  price Interest  t -4 t GDP rate FX t-2 (when k=2 under the illustration)
  • 14. Stressing Macro Economy using a VAR Model • VAR (Vector AutoRegression) model? Shock Propagation!!
  • 15. Stressing Macro Economy using a VAR Model • VAR (Vector AutoRegression) model? Shock Propagation!! • It can simulate how a shock occurred in a certain macro  index at a certain timing is transmitted to other macro  indices toward the future.
  • 16. VAR Model on R Real effective  foreign  exchange rate 5% probability Real GDP shock GDP deflator Equity valuation simulation 5% probability TOPIX Equity price Market Beta Equity valuation gain & loss shock Long‐term lending  interest rate VAR model • In R, the package “vars” can solve major parts of technical difficulties in VAR model • Just one command in R script outputs such as coefficient matrix A1 and shock propagation function (impulse response function) Ij(n)
  • 17. VAR Model on R • Example of implementation • Data should be gathered in advance from a package of  RFinanceYJ, and website of the BOJ and the Cabinet Office. #Package vars library(vars) #Prepare the data in advance datafile <- read.csv("data.csv") #Calibrate factors using VAR function p2ct<-VAR(datafile,p=2,type="both") #Calculate function of shock propagation using irf function var.irf <- irf(p2ct, response=c("EFEXRIND","REGDP","GDPDEF","TOPIX","LPRIMR_LOG"), n.ahead=19, boot=F) #Shocks on each of the real GDP and TOPIX shock.ByrealGDP <- var.irf$irf$REGDP shock.ByTOPIX <- var.irf$irf$TOPIX shock <- shock.ByrealGDP + shock.ByTOPIX shockToTOPIX <- shock[,4]
  • 18. VAR Model on R #Project future macro indices using predict function pp2ct <- predict(p2ct,n.ahead=20) TOPIXfcstn <- pp2ct$fcst$TOPIX[,1] #Calculate the one applying a 5% shock as an after-the-shock TOPIX TOPIXfcstnAfterShock <- TOPIXfcstn + shockToTOPIX * (-1.64) TOPIXfcst <- c(datafile[,4],TOPIXfcstn) TOPIXfcstAfterShock <- c(datafile[,4], TOPIXfcstnAfterShock) #Working on Excel hereafter excel.w <- function(dat){ write.table(dat, "clipboard", sep="¥t", row.names = FALSE) } excel.w(TOPIXfcst) #Paste once on Excel excel.w(TOPIXfcstAfterShock) #Paste again on Excel
  • 19. 500 600 700 800 900 1000 1100 1200 Sep‐08 Apr‐09 Nov‐09 Jun‐10 Jan‐11 Aug‐11 Mar‐12 Oct‐12 TOPIX May‐13 Dec‐13 Jul‐14 Feb‐15 Sep‐15 VAR Model on R Apr‐16 w/ shock w/o shock Nov‐16 ショック無 ショック有
  • 20. Equity Valuation Gain & Loss  Analysis by Bank Real effective  foreign  exchange rate 5% probability Real GDP shock GDP deflator Equity valuation simulation 5% probability TOPIX Equity price Market Beta Equity valuation gain & loss shock Long‐term lending  interest rate VAR model Analysis using a macro economic index Analysis by bank
  • 21. Equity Valuation Gain & Loss  Analysis by Bank • “Market Beta” is an index showing relative size of a  change in price of a share to the change of the  benchmark. – When the benchmark (TOPIX) increases 10% and the share  increases 15% on average, the market beta of the share is  1.5. Change in the objective share (%) 1.5 1 Change in TOPIX (%) (For illustration purpose, return on risk-free asset is assumed to be zero hereinafter)
  • 22. Equity Valuation Gain & Loss  Analysis by Bank • Calculation of valuation gain & loss of equity  portfolio by bank – Calculate the amount of change in valuation gain & loss of  equity by bank through the following calculation by bank. Equity portfolio of Bank A T Market beta of each share Value of share ① Share ①β Value of share ② Share ②β × × Change in Value of share ③ Share ③β TOPIX ・ ・ ・ ・ Result of the ・ ・ VAR model
  • 23. Equity Valuation Gain & Loss  Analysis by Bank • Example of implementation • As it is too cumbersome to check the actual portfolio of banks,  the shock is applied to a hypothetic bank holding IT share,  infrastructure share, manufacturing share and retailing share for 2.5 billion yen each. library(RFinanceYJ) #Index (TOPIX) 998405 ST0 <- quoteStockTsData("998405",since="2007-01-01", time.interval="monthly") #IT share: Yahoo Japan 4689 ST1 <- quoteStockTsData("4689",since="2007-01-01", time.interval="monthly") #Infrastructure share: JR East 9020 ST2 <- quoteStockTsData("9020",since="2007-01-01", time.interval="monthly") #Manufacturing share: Toyota 7203 ST3 <- quoteStockTsData("7203",since="2007-01-01", time.interval="monthly") #Retailing share: Lawson 2651 ST4 <- quoteStockTsData("2651",since="2007-01-01", time.interval="monthly") ST <-data.frame(ST0=ST0[,5],ST1=ST1[,7],ST2=ST2[,7],ST3=ST3[,7],ST4=ST4[,7]) #Calculation of rate of change IncST <- ST[2:70,]/ST[1:69,]-1
  • 24. Equity Valuation Gain & Loss  Analysis by Bank #Calculate each β ST1.lm <- lm(ST1~ST0, data=IncST) ST1.beta <- ST1.lm$coefficients[2] ST2.lm <- lm(ST2~ST0, data=IncST) ST2.beta <- ST2.lm$coefficients[2] ST3.lm <- lm(ST3~ST0, data=IncST) ST3.beta <- ST3.lm$coefficients[2] ST4.lm <- lm(ST4~ST0, data=IncST) ST4.beta <- ST4.lm$coefficients[2] ST.beta <- rbind(ST1.beta, ST2.beta, ST3.beta, ST4.beta) #Calculate the amount of change in the asset of a hypothetic bank (holding shares of ST1-ST4 for 2.5 billion each with total of 10.0 billion) to the shock 1 on TOPIX STVariance <- as.numeric( 10^10 * t(as.matrix(rep(0.25,4)))%*%as.matrix(ST.beta)) #Drop rate of TOPIX after 1 year (after 4 quarters) since the shock under the VAR model TOPIXvar.1yrAfterShock <- TOPIXfcstAfterShock[nrow(datafile)+4]/datafile$TOPIX[nrow(datafile)]-1 #Valuation loss of equity portfolio of the objective banks STLoss <- STVariance * TOPIXvar.1yrAfterShock
  • 25. Equity Valuation Gain & Loss  Analysis by Bank 0.59 0.43 Beta: TOPIX vs. Yahoo Japan Beta: TOPIX vs. JR East 1.03 0.14 Beta: TOPIX vs. Toyota Beta: TOPIX vs. Lawson
  • 26. Equity Valuation Gain & Loss  Analysis by Bank T TOPIX 1200 IT share: ¥2.5 billion IT share β 1100 ショック有 w/ shock 0.59 ショック無 w/o shock 1000 Infrastructure  Infrastructure: ¥2.5b share β 0.43 900 800 Manufacturing: ¥2.5b × Manufacturing  share β 1.03 × 700 600 500 Retailing  Apr‐09 Apr‐16 Sep‐08 Feb‐15 Sep‐15 Jun‐10 Jul‐14 Mar‐12 Dec‐13 Aug‐11 Oct‐12 Nov‐09 Jan‐11 Nov‐16 May‐13 Retailing share: ¥2.5b share β 0.14 Drop of 20.6% after 1 year Result of calculation: Valuation loss of 1.13 billion yen is generated after 1 year of the shock on the equity portfolio of 10.0 billion yen of the hypothetic bank!
  • 27. Summary of Conclusion TOPIX 1200 1100 ショック有 ショック無 1000 900 800 700 600 Real effective  500 Apr‐09 Apr‐16 Sep‐08 Feb‐15 Sep‐15 Jun‐10 Jul‐14 Mar‐12 Dec‐13 Aug‐11 Oct‐12 Nov‐09 Jan‐11 Nov‐16 foreign  May‐13 exchange rate 5% Real GDP probability shock GDP deflator Equity valuation simulation 5% TOPIX Equity price Market Beta Equity valuation gain & loss probability shock Long‐term lending  interest rate VAR model Valuation loss of 1.13 billion yen after 1 year of the shock on the hypothetic bank with equity of 10.0 billion yen