Watching Macro Stress Test of Bank of Japan Using R
Motoharu Dei2012/10/20
Source of Today’s Topic
http://www.boj.or.jp/research/index.htm/
Website of Bank of Japan (BOJ)
“Research & Study” corner
“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
• 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
Flow of the Test
Financial situation ofborrower
(ICR, cash‐to‐current liabilities ratio)
Nominal GDP
Equity price
Long‐term lending interest rate
Negative impact in line with lower growth rate
Transition probability of debtor’s classification* Credit cost
Market Beta Equity valuation gain & loss
Tier I RatioGDP deflator
TOPIX
Long‐term lending interest rate
Real effective foreign
exchange rate
Real GDP
VAR model
Economic forecast ofprivate think tank
Credit cost model
Equity valuation simulation
Income simulation
Lending spread Core business net income
5% probabilityshock
5% probabilityshock
• 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
Flow of the Test
Equity price Market Beta Equity valuation gain & loss
GDP deflator
TOPIX
Long‐term lending interest rate
Real effective foreign
exchange rate
Real GDP
VAR model
Equity valuation simulation
5% probabilityshock
5% probabilityshock
We focus on only this as all is too much.
• 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
Flow of the Test
Equity price Market Beta Equity valuation gain & loss
GDP deflator
TOPIX
Long‐term lending interest rate
Real effective foreign
exchange rate
Real GDP
VAR model
Equity valuation simulation
5% probabilityshock
5% probabilityshock
Analysis using a macro economic index Analysis by bank
• VAR (Vector AutoRegression) model?
Stressing Macro Economyusing a VAR Model
Equity price
GDP
FX
Interest rate
Correlation
t
Equity price
GDP
FX
Interest rate
t -1
Equity price
GDP
FX
Interest rate
t - 2
t -3
t -4
(when k=2 under the illustration)
• VAR (Vector AutoRegression) model?
Stressing Macro Economyusing a VAR Model
Equity price
GDP
FX
Interest rate
Correlation
t
Equity price
GDP
FX
Interest rate
t -1
Equity price
GDP
FX
Interest rate
t - 2
t -3
t -4
(when k=2 under the illustration)
Occurrence of sock!!
• VAR (Vector AutoRegression) model?
Stressing Macro Economyusing a VAR Model
Equity price
GDP
FX
Interest rate
Correlation
t
Equity price
GDP
FX
Interest rate
t -1
Equity price
GDP
FX
Interest rate
t - 2
t -3
t -4
(when k=2 under the illustration)
• VAR (Vector AutoRegression) model?
Stressing Macro Economyusing a VAR Model
Equity price
GDP
FX
Interest rate
Correlation
t
Equity price
GDP
FX
Interest rate
t -1
Equity price
GDP
FX
Interest rate
t - 2
t -3
t -4
(when k=2 under the illustration)
• VAR (Vector AutoRegression) model?
Stressing Macro Economyusing a VAR Model
Equity price
GDP
FX
Interest rate
Correlation
t
Equity price
GDP
FX
Interest rate
t -1
Equity price
GDP
FX
Interest rate
t - 2
t -3
t -4
(when k=2 under the illustration)
Shock Propagation!!
• VAR (Vector AutoRegression) model?
Stressing Macro Economyusing a VAR Model
Shock Propagation!!
• VAR (Vector AutoRegression) model?
Stressing Macro Economyusing a VAR Model
• 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.
Shock Propagation!!
VAR Model on R
Equity price Market Beta Equity valuation gain & loss
GDP deflator
TOPIX
Long‐term lending interest rate
Real effective foreign
exchange rate
Real GDP
VAR model
Equity valuation simulation
5% probabilityshock
5% probabilityshock
• 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 varslibrary(vars)
#Prepare the data in advancedatafile <- read.csv("data.csv")
#Calibrate factors using VAR functionp2ct<-VAR(datafile,p=2,type="both")
#Calculate function of shock propagation using irf functionvar.irf <- irf(p2ct, response=c("EFEXRIND","REGDP","GDPDEF","TOPIX","LPRIMR_LOG"), n.ahead=19, boot=F)
#Shocks on each of the real GDP and TOPIXshock.ByrealGDP <- var.irf$irf$REGDPshock.ByTOPIX <- var.irf$irf$TOPIX
shock <- shock.ByrealGDP + shock.ByTOPIXshockToTOPIX <- shock[,4]
VAR Model on R
#Project future macro indices using predict functionpp2ct <- predict(p2ct,n.ahead=20)
TOPIXfcstn <- pp2ct$fcst$TOPIX[,1]
#Calculate the one applying a 5% shock as an after-the-shock TOPIXTOPIXfcstnAfterShock <- TOPIXfcstn + shockToTOPIX * (-1.64)
TOPIXfcst <- c(datafile[,4],TOPIXfcstn)TOPIXfcstAfterShock <- c(datafile[,4], TOPIXfcstnAfterShock)
#Working on Excel hereafterexcel.w <- function(dat){
write.table(dat, "clipboard", sep="¥t", row.names = FALSE) }
excel.w(TOPIXfcst)#Paste once on Excelexcel.w(TOPIXfcstAfterShock)#Paste again on Excel
VAR Model on R
500
600
700
800
900
1000
1100
1200Sep‐08
Apr‐09
Nov‐09
Jun‐10
Jan‐11
Aug‐11
Mar‐12
Oct‐12
May‐13
Dec‐13
Jul‐1
4
Feb‐15
Sep‐15
Apr‐16
Nov‐16
TOPIX
ショック有
ショック無
w/ shock
w/o shock
Equity Valuation Gain & Loss Analysis by Bank
Equity price Market Beta Equity valuation gain & loss
GDP deflator
TOPIX
Long‐term lending interest rate
Real effective foreign
exchange rate
Real GDP
VAR model
Equity valuation simulation
5% probabilityshock
5% probabilityshock
Analysis by bankAnalysis using a macro economic index
• “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 TOPIX (%)
Change in the objective share (%)
1
1.5
(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
Value of share ①
Value of share ②
Value of share ③
・・・
×
Market beta of each share
Share ①β
Share ②β
Share ③β
・・・
T
× Change in 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 sharefor 2.5 billion yen each.
library(RFinanceYJ)
#Index (TOPIX) 998405ST0 <- quoteStockTsData("998405",since="2007-01-01", time.interval="monthly")#IT share: Yahoo Japan 4689ST1 <- quoteStockTsData("4689",since="2007-01-01", time.interval="monthly")#Infrastructure share: JR East 9020ST2 <- quoteStockTsData("9020",since="2007-01-01", time.interval="monthly")#Manufacturing share: Toyota 7203ST3 <- quoteStockTsData("7203",since="2007-01-01", time.interval="monthly")#Retailing share: Lawson 2651ST4 <- 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 changeIncST <- 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 TOPIXSTVariance <- 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 modelTOPIXvar.1yrAfterShock <- TOPIXfcstAfterShock[nrow(datafile)+4]/datafile$TOPIX[nrow(datafile)]-1
#Valuation loss of equity portfolio of the objective banksSTLoss <- STVariance * TOPIXvar.1yrAfterShock
Equity Valuation Gain & Loss Analysis by Bank
Beta: TOPIX vs. Yahoo Japan Beta: TOPIX vs. JR East
Beta: TOPIX vs. Toyota Beta: TOPIX vs. Lawson
0.59 0.43
1.03 0.14
Equity Valuation Gain & Loss Analysis by Bank
IT share: ¥2.5 billion
Infrastructure: ¥2.5b
Manufacturing: ¥2.5b ×
IT share β
Infrastructure share β
Manufacturing share β
T
×
Retailing share: ¥2.5b Retailing share β
500
600
700
800
900
1000
1100
1200
Sep‐08
Apr‐09
Nov‐09
Jun‐10
Jan‐11
Aug‐11
Mar‐12
Oct‐12
May‐13
Dec‐13
Jul‐1
4
Feb‐15
Sep‐15
Apr‐16
Nov‐16
TOPIX
ショック有
ショック無
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!
0.59
0.43
1.03
0.14
Equity Valuation Gain & Loss Analysis by Bank
w/ shock
w/o shock
Summary of Conclusion
Equity price Market Beta Equity valuation gain & loss
GDP deflator
TOPIX
Long‐term lending interest rate
Real effective foreign
exchange rate
Real GDP
VAR model
Equity valuation simulation
5%probability
shock
5%probability
shock
500
600
700
800
900
1000
1100
1200
Sep‐08
Apr‐09
Nov‐09
Jun‐10
Jan‐11
Aug‐11
Mar‐12
Oct‐12
May‐13
Dec‐13
Jul‐1
4
Feb‐15
Sep‐15
Apr‐16
Nov‐16
TOPIX
ショック有
ショック無
Valuation loss of 1.13 billion yen after 1 year of the shock on the hypothetic bank with equity of 10.0 billion yen