9.8.15.thesis

91
Measuring Systemic Risk via Copula functions between Banks and Insurance Companies in the UK during different time horizons of UK GDP growth. By:Peter Nicholas Allen Supervisor: Dr. Eric A. Beutner Submitted on: 12th June 2015

Upload: peter-nicholas-allen

Post on 19-Aug-2015

86 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 9.8.15.thesis

Measuring Systemic Risk via Copulafunctions between Banks and Insurance

Companies in the UK during different timehorizons of UK GDP growth.

By:Peter Nicholas Allen

Supervisor: Dr. Eric A. Beutner

Submitted on: 12th June 2015

Page 2: 9.8.15.thesis

Acknowledgement

I would like to thank my supervisor Dr. Eric Beutner who helped me during challenging pointsof my thesis.

i

Page 3: 9.8.15.thesis

Abstract

In this thesis we explore how different time horizons connected to sharp changes in the UK GDP %growth effect our constructed systemic risk models between the major UK banks and Insurancecompanies. In particular we apply copula functions to calculate vine copulas to illustrate thenetwork of dependence.

ii

Page 4: 9.8.15.thesis

Contents

Acknowledgement i

Abstract ii

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Questions of Our Investigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 The data 3

3 Methods 63.1 Time Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.1.1 Time series preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.1.2 ARMA Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.1.3 GARCH Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.1.4 Model Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.2 Dependence Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.3 Copulae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.4 Vine Copula Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.5 Vine Copula Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

4 Application 444.1 Fitting Time Series Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444.2 Constructing the Vine Copulae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564.3 The Vine Copula Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5 Conclusion 64

A Additional figures - Time Series Modelling 65

B Additional figures - Vine Copula Modelling 69B.1 Scatter and Contour Matrix of Full Copula Data Set: 2008 . . . . . . . . 69B.2 R-Vine Copula Decomposition, Copula Selection and Parameter Matrices 70B.3 Remaining Vine Tree Comparisons C-Vines . . . . . . . . . . . . . . . . . . 71B.4 Remaining R-Vine Tree Comparisons . . . . . . . . . . . . . . . . . . . . . . 74

C R-code 78C.1 Fitting GARCH Models and Preparing Copula Data - 2008 Data . . . . 78C.2 Example Simulation Code X1 = HSBC Specific - 2008 Data . . . . . . . . 84C.3 Example H-Functions Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

Page 5: 9.8.15.thesis

1 Introduction

1.1 Background

There is no need to enumerate definitions etc yourself. TeX can do that for you. Just googlenewtheorem to see how it works.

The interest of this paper is to analyse systemic risk measures and graphical models ofinterdependence risk between a specified collection of banks and insurance companies. However,we plan to ascertain and comment on any changes in these measures when we re-sample from2008 and 2009. We would expect to see that the dependence amongst the institution is far greaterduring 2008 compared to 2009 as the GDP growth rate (see Google reference) increases sharplyimplying the economy is beginning to recover in some sense.

During financial turmoil flight-to-quality is a financial market phenomenon which characterisesthe sudden selling of risky assets such as equities and reinvestment into safer alternative investmentssuch as bonds and securities. As a result private investors, banks, insurance companies, hedgefunds and other institutions supplement a surge of transactions, offloading these risky assets andmoving this liquidity somewhere else. We believe is is a fair hypothesis that during financialturmoil the dependence amongst equities will be greater given the cautious and nervous natureof investors.

Whilst this paper looks at the individual importance of one particular financial system as awhole, we think it is important for the reader to consider the wider applications of these differentrisk measures used to analyse the interdependency between a group of risky assets. Especially interms of how one (hedge fund, private investor, risk manager, insurance company, bank etc) wouldact during and post a financial recession. Institutions are spending more time and money on activerisk management and we believe risk managers should be cognizant of the level of dependenceand interlinks between any portfolio of risks.

The mathematical tools we use to model the dependence structure are copulae and vinecopula pairwise constructions. essentially we aim to model the joint distribution of our portfolioof institutions in which case........ Before we begin construction the R Vines we need to removeany autocorrelation from the financial time series so we fit..............

Using this still to be decided[To measure the risk of our system we will consider an evolvedtraditional value-at-risk(VaR) and instead look at the conditional value at risk (CoVaR) wherewe condition on a particular asset which is in distress. ] To analyse the

1

Page 6: 9.8.15.thesis

1.2 Questions of Our Investigation

In the subsection we just outline what it is we would like to investigate. We hope to get answersto the following questions:

(i) Our first question is, what does the dependence structure look like between the top four?UK Banks and Insurance Companies? Is there one particular institution which seems to standout amongst the eight in terms of the level of dependence with the rest?

(ii) Secondly, we would like to see how the dependence structure changes given that we apply ashock to each individual company i.e. significant drop in share price? Which institution hasmost dramatic effect on the system given a shock is applied to its share price?

(iii)Thirdly we redo-question (i) but with the data from 2009 as opposed to 2008, do we believethere is a link between the significance of dependence within our system of institutions and thechange in percentage GDP for the UK?

(iv) Finally we re-do question (ii) but again with the 2009 as opposed to 2008, does this periodof increased percentage GDP suggest dependence is not as high and do shocks to individualinstitutions have less of a domino affect on the remaining institutions?

Now that we know what it is we are looking to investigate we introduce the data we will beusing.

2

Page 7: 9.8.15.thesis

2 The data

The first thing we need to do when we conduct our experiment is collect and prepare our data setfor use. We have sourced the data from Yahoo Finance (http://finance.yahoo.com/) which allowsyou to download stock market data from any given time period within the companies lifetime onthe stock market. As we are looking at systemic risk the UK institutions chosen are deamed to bethe top 4 in terms of market capitalisation (MC), on the London Stock Exchange (LSE). BelowI have indicated the companies selected with their respective MC in £Billions:

Company Name Stock Symbol £MC

HSBC Holdings PLC HSBA.L 109BnLloyds Banking Group plc LLOY.L 56.7BnBarclays PLC BARC.L 30.8BnStandard Chartered PLC STAN.L 26.6Bn

Table 1: List of Bank Stocks from LSE

Company Name Stock Symbol £MC

Prudential PLC PRU.L 42.7BnLegal & General Group LGEN.L 16.4BnAviva plc AV.L 16.0BnOld Mutual PLC OML.L 11Bn

Table 2: List of Insurance Company Stocks from LSE

The UK banking industry is notorious for being heavily dependent on a handful of banks.Unlike the German banking industry for example where there are hundreds of different banksmaking a thoroughly diversified banking industry, the UK is too dependent upon the stabilityand continued success of the above institutions. After the 2008-2009 financial melt down,stricter regulation had to be introduced in order to prevent another financial crisis. Critics saidthat despite the existence of the Financial Services Authority (FSA) nobody knew who to assignthe blame of the crisis thus three new bodies were created. Financial Policy Committee (FPC)which would take overall responsibility for financial regulation in the UK from 2013. PrudentialRegulation Authority (PRA) take over responsibility for supervising the safety and soundness ofindividual financial firms. Finally, the Financial Conduct Authority (FCA), which was taskedwith protecting consumers from sharp practices, and making sure that workers in the financialservices sector comply with rules. With banks and insurance companies having their balancesheets closely monitored by these authorities; the emphasis being on the capital held in relationto exposure to risk. We expect the banking system to become more robust and stable.

3

Page 8: 9.8.15.thesis

When calculating our risk measures we aim to conduct the experiment from two different timehorizons, the re-sample will take into account two different sharp changes in the UK GDP %growth, we took 2008 and 2009 as our data sets for re-sampling, as in 2008 we saw a dramaticdecline and 2009 we saw a reverse incline. We hope to see some interesting results in order toinvestigate how the change in GDP growth may affect the dependency between the major financialinstitutions. Please see figure 1 below:

Figure 1: UK % Change in GDP

GDP is commonly used as an indicator of the economic health of a country, as well as to gaugea country’s standard of living. This is why we try to make the link in this thesis between level ofrisk dependence and the change in GDP growth. As implied in our introduction we would expectto see a higher level of dependence in a negative growth in the GDP as this indicator impliesthe economy is in a worse position than before and thus investors may become more sceptical,business may reduce with banks and overall consumption may decrease which would have a knockon affect to the institutions overall performance and financial strength.

Once our data was downloaded we had to check the quality of the data and make any necessaryadjustments. Where there were missing values on the same days for more than one company weremoved the entire row for those particular days. After converting the data into log return form

rt = log(St)− log(St−1)

where rt, is the log return for a particular stock, St.

4

Page 9: 9.8.15.thesis

Finishing this process we had a sample Xn1, ..., Xn8 of stocks each obtaining n = 253 observationsfor 2008 and similarly for 2009 we had n = 252 observations. Please note in the StandardChartered 2009 data we had to replace 2 consecutive observations as they were disrupting anyform of GARCH model fitting, it consisted off one extreme positive value followed by one extremenegative value. We replaced them with the average of the observations before and then for thesecond value the average of the remaining observations going forward. This method was alsoimplemented for AVIVA which had a severe drop in share price on one particular day. Whilst weappreciate this reduces the accuracy of our tests going forward if this step is not taken, meaningmodels can not be fit. This is because we need independent and identically distributed residualsbefore moving onto the copula modelling. Below is a graph to illustrate an example of HSBA.Lin this format:

Figure 2: HSBC 2008: Top - Raw data & Bottem - Log return

When starting the application of the copula construction to our data i.e. fitting the Vine Copulatree structure and fitting the appropriate pairwise copula distributions we will need to adjustour innovations (obtained from fitting the GARCH model). This process is called probabilityintegral transformation and will ensure all our data belongs to the interval [0,1] propertynecessary for our marginal distributions, once this transformation has occurred we will refer tothe data as copula data, this process is discussed fully in section 4.1.

5

Page 10: 9.8.15.thesis

3 Methods

The order of topics in the methods runs parallel with the order in which the application will occur.Hopefully the reader will find this easier to follow as a whole. In section 3.1 we look at fitting timeseries models to best describe the dynamics of the return, specialising towards GARCH models.Section 3.2 we take a introductory look at copulae. Then in 3.3 we look at the construction ofvine copula models and finally in section 3.4 we look at simulation vine copulae.

3.1 Time Series

In order to conduct our Copula construction in section 3 we need to ensure our data sets areindependent and identically distributed. To achieve this we will ultimately fit GARCH models,see section 3.1.3, which will remove trends, seasonality, and serial dependence from the data.Then the reader should be able to understand the application of our GARCH models in section4.2.

3.1.1 Time series preliminaries

As we are modelling time series data which is random we need to introduce the definition of astochastic process.

Definition 3.01 - Stochastic ProcessA stochastic process is a collection of random variables (Xt)t∈T defined on a probability space(Ω,F , P ). That is for each index t ∈ T , Xt is a random variable. Where T is our time domain.As our data is recorded on a daily basis we associate our stochastic process with a discrete timestochastic process. The data is a set of integer time steps so we set T = N. A time series isa set of observations (xt)t∈T , where each observation is recorded at time t and comes from agiven trajectory of the random variable Xt. We use the term time series and stochastic processinterchangeably.

For this thesis we shall use two time series models which very popular in the financial industry,ARMA and GARACH models.

Reminder - Continuing on from our data section where we defined the log return. This is alsoa stochastic process, where, rt, is the log return for a particular stock, St:

rt =log(St)

log(St−1)= log(St)− log(St−1), ∀t ∈ Z (3.1)

In the financial markets the prices are directly observable but it is common practice to use thelog return as it depicts the relative changes in the specific investment/asset. The log return alsopossesses some useful time series characteristics which we will see later on in this section. Pleasesee figure 2 from the data section to view both the market prices and log return of HSBC.

6

Page 11: 9.8.15.thesis

In order to determine the dependence structure within a stochastic process we introduce theconcept of autocovariance and autocorrelation functions.

Definition 3.02 - Autocovariance FunctionLet (Xt)t∈Z be a stochastic process with E[X2

t ] <∞∀t ∈ Z. Then the autocovariance funtction,γX ,of (Xt)t∈Z is defined as

γX(r, s) = Cov(Xr, Xs), r, s ∈ Z

Definition 3.03 - Autocorrelation Function (ACF)The autocorrelation function (ACF), ρX , of (Xt)t∈Z is defined as:

ρX(r, s) = Corr(Xr, Xs) = γX(r,s)√γX(r,r)

√γX(s,s)

, r, s ∈ Z

In order to fit appropriate models to our time series sample (x1, ..., xn) we need to make someunderlying assumptions. One of the most important ones is the idea of stationarity, whichessentially means the series is well behaved ourtypoa given time horizon i.e. a bounded variance. Although there are several forms of stationarity,for the purposes of this thesis, we need only define wide sense (or covariance stationarity). Formore detail please see J. Davidson [2000].

Definition 3.04 - Wide Sense StationarityA stochastic process (Xt)t∈Z is said to be stationary in the wide sense if the mean, variance andjth-order autocovariances for j¿0 are all independent of t . And:

(a) E[X2t ] <∞ ∀t ∈ Z

(b) E[Xt] = m, ∀t ∈ Z and m ∈ R, and(c) γX(r, s) = γX(r + j, s+ j),∀r, s, j ∈ Z

The above definition implies that the covariance of (Xr) and (Xs) only depends on |s−r|, becauseγX(j) := γX(j, 0) = Cov(Xt+j , Xt), t, j ∈ Z. We therefore must redefinebetter to write can simplifythe autocovariance function of a stationary time series as

γX(j) := γX(j, 0) = Cov(Xt+j , Xt), t, j ∈ Z

where j is called the lag.You define it for j. So it would be good to also give the range of j; see also below.Similarly, the autocorrelation function of a stationary time series with lag j is defined as

ρX(j) := γX(j)γX(0) = Corr(Xt+j , Xt), t, j ∈ Z

7

Page 12: 9.8.15.thesis

In empirical analysis of the time series data we will need to estimate both of these functions, thisis done via the sample autocovariance function and sample autocorrelation function.

Definition 3.05 - Sample Autocovariance FunctionFor a stationary time series (Xt)t∈Z the sample autocovariance function is defined as

γ(j) :=1

n

n−j∑i=1

(xi+j − x)(xi − x), |j| < n,

where x =∑n

i=1 xi is the sample mean. Why absolute value of j?

Definition 3.06 - Sample Autocorrelation FunctionFor a time series (Xt)t∈Z the sample autocorrelation function is defined as

ρ(j) :=γ(j)

γ(0), |j| < n.

We’ve mentioned ACF previously, well another tool we use to explore dependence and helpascertain the order in our ARMA models is the partial autocorrelation function (PACF).

Definition 3.07 - Partial Autocorrelation Function (PACF)The PACF at lag j, ψ(j), of a stationary time series (Xt)t∈Z is defined as

ψX(j) =

Corr(Xt+1, Xt) = ρX(1), forj = 1

Corr(Xt+j − Pt,j(Xt+j), Xt − Pt,j(Xt), forj ≥ 2

where Pt,j(X) denotes the projection of X onto the space spanned by (Xt+1, ..., Xt+j−1).The PACF measures the correlation between Xt and its lagged terms lets say Xt+j forj ∈ Z\0, without the effect of observations (Xt+1, ..., Xt+j−1). Similar to before we denotedthe PACF as ψ(j) for which there are multiple algorithms, for which we refer the reader toBrockwell and Davis [1991] for further information.

Figure 3: ACF and PACF for log return HSBC 2008 data set, lag = 18

8

Page 13: 9.8.15.thesis

The graphs in the previous page were intended to give the reader some graphical representationof the above functions applied to real data. We have inserted the ACF and PACF for HSBC.This particular pair of graphs are very useful in immediately determining any signs ofautocorrelation, if we find that the bars are escaping the two horizontal bounds we can be surethat their is some form of autocorrelation and we should include some lagged terms in ourARMA model (explained further section 3.1.2) to remove this. If we find like in the above thatthe majority, if not all of the bars are contained within the bounds we can proceed on theassumption that there is no sign of autocorrelation, like white noise, see definition below.

Definition 3.08 - White NoiseLet (Zt)t∈Z be a stationary stochastic process with E[Zt] = 0 ∀t ∈ Z and autocovariance function

γZ(j) =

σ2Z , forj = 0,

0, forj 6= 0,

with σ2Z > 0. Then (Zt) is called white noise process with mean 0 and variance σ2Z , thus,(Zt)t∈Z ∼WN(0, σ2Z).

Now that we have introduced the fundamentals we can bring in the more specific time seriesmodels, before we do this, the general time series framework will be outlined so that the readercan always refer back to it for reference.

Definition 3.09 - Generalised Time Series ModelWe use a time series model to describe the dynamic movements of a stochastic process, inparticular we will be concentrating on the log return process (rt)t ∈ Z. It has the followingframework:

rt = µt + εt (3.2)

εt = σtZt

The conditional mean, µt, and the conditional variance, σ2t , are defined as follows

µt := E[rt|Ft−1] and (3.3)

σ2t := E[(rt − µt)2|Ft−1], (3.4)

where Ft is the filtration representing the information set available at time t. The Zt’s areassummed to follow a white noise representation. We call equation 3.2 the return equation, it ismade up of the following constituent parts:

(i) Conditional mean, µt, (ii) Conditional variance, σ2t ,(iii) residuals [observed minus fitted], εt and (iv) white noise, Zt

9

Page 14: 9.8.15.thesis

Distribution of the Zt’sMore often than not the distributions of the Zt’s are assumed to be standard normal. This isbecause it makes modelling and inference more tractable. However, in real life application thiscannot be assumed, especially with financial data. It is well known that financial data oftenpertains negative skewness and leptokurtosis (other wise known as fat tails or heavy tails). Weshall there for consider the use of the following distributions in our time series model fitting,please note they are all standardized:

(a) Standard Normal Distribution (NORM) is given by

fZ(z) =1√2π

exp

(−z2

2

),

with mean of 0 and variance = 1. This is the simplest distribution used to model the residuals.But doesn’t model fat tailed or skewed data.

(b) Student-t distribution (STD) is given by

fZ(z) =

Γ

(ν + 1

2

2

)√(ν − 2)π

[1 +

z2

ν − 2

]−( ν+12

)

,

with ν > 2 being the shape parameter and Γ(.) the Gamma function. For large sample this willtend closer to the normal distribution. It also has the property of fat tails which make it auseful distribution to model financial data. It should also be noted that the t-distribution is aspecial case of the generalised hyperbolic distribution.

(c) Generalised Error Distribution (GED) is given by

fZ(z) =

ν exp

[− 1

2 |zλ |ν

]

λ2

(1+

1

ν

(1

ν

) ,

with shape parameter 0 < ν ≤ ∞, λ =

√2−2ν Γ( 1ν )Γ( 3ν ), and Γ(.) again denotes the Gamma

function. NB: The normal distribution is a special case of the GED (for ν = 2). Thedistribution is able to account for light tails as well as heavy tails depending on whether ν > 2for heavy tails and ν < 2 for light tails.

10

Page 15: 9.8.15.thesis

(d) Generalised Hyperbolic Distribution (GHYP) is given by

fZ(z) =

(κδ

)λexp(β(z − µ))

√2πKλ(δκ)

Kλ− 12

(α√δ2 + (z − µ)2

)(√δ2 + (z − µ)2

α

)λ− 12

,

with κ :=√α2 − β2, 0 ≤ |β| < α, µ, λ ∈ R, δ > 0, and Kλ(.) being the modified function of the

second kind with index λ please see Barndorff-Nielsen [2013] for further details on this.δ is calledthe scale parameter.As we are looking at the standardised version with mean 0 and variance 1, we use anotherparametrisation with ν = β

α and ζ = δ√α2 − β2, shape and skewness parameters, respectively.

This distribution is mainly applied to areas that require sufficient probability of far-fieldbehaviour, which it can model due to its semi-heavy tails, again a property often required forfinancial market data.

(e) Normal Inverse Gaussian distribution (NIG) is given by

fZ(z) =αδK1(α

√δ2 + (z − µ)2)

π√δ2 + (z − µ)

exp[δκ+ β(z − µ)],

with κ :=√α2 − β2, 0 ≤ |β| ≤ α, µ,∈ R, δ > 0, and K1(.) being the modified Bessel function of

the second kind of index 1. See Anders Eriksson [2009] for further detail. Note that the NIGdistribution is a special case of the GHYP distribution with (λ = −1

2 ). As above we use theparametrisation with ζ and ν. The class of NIG distributions is a flexible system of distributionsthat includes fat-tailed and skewed distributions which is exactly the kind of distribution we arelooking to implement.

11

Page 16: 9.8.15.thesis

3.1.2 ARMA Models

In this section we introduce univariate autoregressive moving average (ARMA) processes whichmodel the dynamics of a time series with a linear collection of past observations and white noiseresidual terms. For a more comprehensive look in ARMA models please see J. Hamilton [1994].

Definition 3.10 - MA(q) processA q-th order moving average process, MA(q), is characterised by

Xt = µ+ εt + η1εt−1 + ...+ ηqεt−q,

where εt is white noise mentioned in definition 2.08 such that εt ∼WN(0, σ2ε ). Also the elementsof (η1, ..., ηq) can be any real number, R. And q ∈ N\0.

Figure 4: MA(1), η = 0.75 with 750 observations

Definition 3.11 - AR(p) processA p-th order autoregression, AR(p), is characterised by

Xt = µ+ φ1Xt−1 + ...+ φpXt−p + εt,

similarly to the above definition εt ∼WN(0, σ2ε ), φi ∈ R and p ∈ N\0.

Figure 5: AR(1), φ = 0.75 with 750 observations

Combining these two processes will make a ARMA(p,q) model thus.

12

Page 17: 9.8.15.thesis

Definition 3.12 - ARMA(p,q) ProcessA ARMA(p,q) process includes both of the above processes thus we characterise it as follows

Xt − φ1Xt−1 − ...− φpXt−p = εt + η1εt−1 + ...+ ηqεt−q,

where the same criteria applies as in definition 2.11 and 2.12.

Figure 6: ARMA(1,1), φ & η = 0.75 with 750 observations

In the context of our log return equation see equation 3.1. Our ARMA(p,q) should look asfollows, essentially we replace the Xt’s with rt’s:

rt − φ1rt−1 − ...− φprt−p = εt + η1εt−1 + ...+ ηqεt−q,

Now that we have chosen a model type for our return we need to determine the orders of pand q, before fitting the model. As you will see in my R-code appendix C.1, there is a usefulfunction auto.arima which we use to automatically determine the orders of p and q, through ainformation criteria selection of ”aic” or ”bic”, further detail on these tests in section 3.1.4 - ModelDiagnostics. However, should the reader wish to do this manually, there is a popular graphicalapproach. For this we refer to a series of step by step notes put together by Robert Nau fromFuqua School of Business, Duke University, see R. Nau.

To give a brief outline we have put in a series of shortened steps:(i) Assuming the time series is statioanry we must determine the number of AR or MA terms areneeded to correct any autocorrelation that remains in the series.(ii) By looking at the ACF and PACF plots of the series, you can tentatively identify the numbersof AR and/or MA terms that are needed.NB: ACF plot: Is a bar chart of the coefficients of correlation between a time series and lags ofitself. The PACF plot is a plot of the partial correlation coefficients between the series and lagsof itself. See figure 7 below for illustration.

13

Page 18: 9.8.15.thesis

Figure 7: ARMA(0,2), Old Mutual PLC

So in figure 7 below we can see that there are two spikes escaping the lower horizontal bandindicating the presence of correlation in the MA lagged terms. When you then look at thePACF you can see these two spikes more clearly indicating that a AR(0) and MA(2) wouldcollectively be the most suited model i.e. ARMA(0,2).

(iii) As we’ve discussed above when analysing the ACF and PACF the reader should firstly belooking for a series of bars in the ACF escaping the horizontal bounds to indicate some form ofautocorrelation. Then when looking at the PACF, if bars outside of the upper horizontal boundwe are looking at AR terms and if we see this occurring below the lower horizontal bound wehave MA terms.(iv) Once this is done we recommend that the chosen model is fitted and compared with anysimilar models against the log likelihood measure and AIC measure. Again see section 3.1.4 forfurther details.

The ARMA processes are modelled under the assumption that the variance, σ2ε ,is constant. As we can see from the figure 2 in the data section, this is not a realistic assumptionas there are clearly signs of different sized volatility clusters.The argument should be formulated differently, because the variance of a GARCH process is alsoconstant (depending on the parameters); see your result 3.14.For these reasons we now look to model volatility conditionally on time and past observations,using GARCH Models.

14

Page 19: 9.8.15.thesis

3.1.3 GARCH Models

A good reference for GARCH processes is the book by Francq and Zakoian (GARCH...). It shouldbe available from the library.In this section we introduce univariate generalized autoregressive conditional heteroskedastic(GARCH) processes which are an extension to the Autogressive Conditional heteroscedastic(ARCH) processes. The GARCH model essentially models the conditional variance of a stochasticprocess via a linear combination of previous squared volatilities and previous squared values ofthe process.

There are multiple types of GARCH models and Extended GARCH models. For the purpose ofthis thesis we shall cover the basic models and finally the Exponential- GARCH model as it wasused most during my application. However, we do recommend that the reader tests differentmodels if they are to apply this method. See J. Hamilton [1994] and A. Ghalanos [2014] fortheory and coding respectively. Please note also we consider GARCH(1,1) models only anddon’t cover the order of GARCH models for simplicity.

Definition 3.13 - GARCH(p,q) ProcessGiven a stochastic process (εt)t∈Z and that we have i.i.d sequence of random variables (Zt)t∈Z

with mean 0 and variance equal to 1.Then εt ∼ GARCH(p, q) if E[εt|Ft−1] = 0 and, for every t,it satisfies

εt = σtZt (3.5)

V ar[εt|Ft−1] := σ2t = ω +

q∑i=1

αiε2t−i +

p∑j=1

βjσ2t−j

with p ≥ 0, q ≥ 0, ω > 0, and α1, ..., αq, β1, ..., βp ≥ 0.

Result 3.14 - Stationarity of GARCH(1,1) Processεt ∼ GARCH(1, 1) is given by

εt = σtZt

σ2t = ω + αε2t−1 + βσ2t−1

with p ≥ 0, q ≥ 0, ω > 0, and (Zt)t∈Z as in definition 2.11, is stationary iff α+ β < 1. The(unconditional) variance of the process is then given by

V ar[εt|Ft−1] := σ2t =ω

1− α− β

For a more extensive review of this result and more, please see page 666 of J. Hamilton [1994].

Coming back to the general model again, in equation 3.5 we are assuming that the mean isconstant i.e. ∀tµ = µt. However, we would like to remove this modelling restriction by combing ourpreviously discussed ARMA(p,q) model and the GARCH(1,1), to give a ARMA(p,q)-GARCH(1,1)model. This should allow us more than enough modelling tools to model our returns.

15

Page 20: 9.8.15.thesis

Definition 3.15 - ARMA(1,1)-GARCH(1,1) ProcessCombining the ARMA(p,q) and GARCH(1,1) process we get a ARMA(p,q)-GARCH(1,1)process. Here we illustrate specifically the process with (p,q) = (1,1) giving the following timeseries

rt = µ+ φrt−1 + ηεt−1 + εt

εt = σtZt

σ2t = ω + αε2t−1 + βσ2t−1,

where φ, η ∈ R, ω > 0 and α, β ≥ 0. The distribution of the (Zt)t∈Z’s are chosen among thosedetailed in section 3.1.1. The standard residuals of the above model are given by

Zt =1

σt

(rt − µ− φrt−1 − ησt−1Zt−1

)where σ, φ, η and µ are all estimated.

How are the parameters estimated? σt which does depend on the parameters is not observed.

Extensions on Standard GARCH ModelsAs we touched at the beginning of this section their are various different extension to thestandard GARCH model. Each different extension is suppose to capture an inherent empiricalcharacteristic property of the financial data. For example the GARCH-M or GARCH-in-Meanmodel was introduced to pick up on correlation between the risk and expected return thus aconditional volatility term was added into the return equation as an exogenous factor, see I.Panait and E. Slavescu [2012] for further details. Other models include: Integrated GARCH,GJR GARCH, Component sGARCH and Absolute Value GARCH etc, see A. Ghalanos [2014]for more detail. As we found the exponential GARCH to be most applicable for our data weshall outline its structure.

Definition 3.16 - Exponential GARCH (eGARCH) ModelThe conditional variance equation in the eGARCH model is given by

log(σ2t ) = ω +

q∑i=1

g(zt−i) +

p∑j=1

βjlog(σ2t−j), (3.6)

whereg(zt) = γi(|zt| − E[|zt|]) + αizt

the function g(zt) covers two effects of the lagged shocks zt = εt−iσt−j

zt also depends on i and jon the conditional variance: where the γi defines the size effect, αi defines the sign effect. Bothof these effects address the asymmetric behaviour due to the leverage effect. Note how thisalpha differs from standard GARCH models. Additionally, a useful characteristic of this modelis there are no parameter restrictions compared to other GARCH models, so, α, β and γ can beany real number, this is due to the logarithmic transformation ensuring the positivity of theconditional variance. Importantly it can be shown that the process is stationary if and only if(iff)

∑pj=1 βj = 1. See D. Nelson [1991] for further detail on the EGARCH model.

16

Page 21: 9.8.15.thesis

NB: Standard GARCH models assume that positive and negative error terms have a symmetriceffect on the volatility. In other words, good and bad news have the same effect on the volatilityin the model. In practice this assumption is frequently violated, in particular by stock returns,in that the volatility increases more after bad news than after good news, this is known asleveraged effect.

17

Page 22: 9.8.15.thesis

3.1.4 Model Diagnostics

Once the models has been fitted to each univariate data set we must carry out a series of test tocompare the models selected (it is not always obvious which model to select between others),and also check for goodness-of-fit. There are series of test we carry out which we shall outline inthis section. Please not that some of these tests will overlap with the vine copula diagnostics.

AIC Criteria:The Akaike information criterion (AIC) is a very popular criteria used to compare and select thebest model. The measure is defined as follows

AIC := 2k − 2n∑i=1

logf(xi|θ),

where the xi’s refer to the observations, i = 1, ..., n.θ is the maximum likelihood estimator forthe parameter vector (θ1, ..., θk)

′ =, k being the number of parameters in the model. As you cansee the measure penalises the model with many parameters and gives more merit to a modelwith a higher log likelihood value (a good indicator for goodness-of-fit). So when deciding whichmodel to select we are looking for the model with the lowest value of AIC and highest value forthe log likelihood.

BIC Criteria:The Bayesian information criterion (BIC) is very similar and is defined as

BIC := 2log(n)− 2

n∑i=1

logf(xi|θ),

the difference here is the number of observations acts as a penalty instead of the number ofparameters. Again we are looking for the smaller BIC value when choosing between models.Both the AIC and BIC measures are used when looking at: fitting ARMA and GARCH modelsand finally when looking at the vine copula density models.

NB: The next series of goodness-of-fit tests and techniques are based on the standardisedresiduals (Zt)t ∈ Z of the fitted models. These tests are to see whether the fitted residuals areindependently and identically distributed according to the assumed distribution chosen i.e.distribution selected from section 3.1.1 - Distribution of the Zt’s

QQ plot:The most popular and easiest way to determine whether the underlying distribution follows thestandardised residuals is by analysing the quantile-quantile-plots, more commonly known asQ-Q plots. If the underlying distribution is a correct suitor, most of the points in the Q-Q Plotshould lie on a straight line, usually at forty-five degrees but this is not always the case. A hasother useful properties such as comparing the shapes of distributions, providing a graphical viewof how properties such as location, scale, and skewness are similar or different in the twodistributions. Please see example of Q-Q Plot below.

18

Page 23: 9.8.15.thesis

Figure 8: QQ Plot of HSBC - Underlying Distribution GHYP

As you can see aside from a few outliers the majority of the points nest on top of a line atapproximately forty-five degrees. This indicates that the underlying distribution is a good fit tothe standardised fitted residuals.

Ljung-Box Standardised Residuals:To test whether or not the standardised residuals of our fitted model still exhibit serialcorrelation we perform the Ljung-Box test. The null hypothesis is that the residuals behave likewhite noise and the alternative is that they don’t i.e. they exhibit some sort of serial correlation.Test statistic is as follows

Qm(ρ) = n(n+ 2)

m∑j=1

ρ2jn− j

,

where the sample autocorrelation of (Zt)t = 1, ..., n is

ρj =

∑nt=j+1 ZtZt−j∑n

t=1 Z2t

for lags j = 1, ..., n. We reject the null at the α% level if Qm(ρ) > χ2m−s,1−α (equivalent to the

p-value being smaller than α), here m− s is the number of degrees of freedom for χ2

distribution and s = number of parameters estimated in the mdoel. For more details on this testplease see Ljung and Box [1978].

In the illustration on the next page, we have included the printed results from our HSBA fittedtime series model, which was conducted in R. As you can see all of our p-values are highindicating there is sufficient evidence to suggest there is no serial correlation.

19

Page 24: 9.8.15.thesis

Weighted Ljung-Box Test on Standardized Residuals for HSBC

------------------------------------

statistic p-value

Lag[1] 0.3228 0.5699

Lag[2*(p+q)+(p+q)-1][2] 0.3658 0.7602

Lag[4*(p+q)+(p+q)-1][5] 0.8907 0.8839

d.o.f=0

H0 : No serial correlation

Ljung-Box Squared Standardised Residuals:In this test we aim to test for independence. This is achieved when we apply the above test tothe squared standardised residuals. Using the same data and model as used in the illustrationabove we obtained the following:

Weighted Ljung-Box Test on Standardized Squared Residuals for HSBC

------------------------------------

statistic p-value

Lag[1] 7.714e-07 0.9993

Lag[2*(p+q)+(p+q)-1][5] 7.714e-01 0.9089

Lag[4*(p+q)+(p+q)-1][9] 3.047e+00 0.7511

which as above indicates that we keep the null hypothesis and their is sufficient evidence tosuggest we have independent residuals.Note: The robustness of the Ljung-Box test applied in this context is frequently discussed inliterature and several modified versions have been made. But this detail is not required for thepurpose of this thesis. See P. Burns [2002] for further information.

ARCH Lagrange-Multiplier (LM) test:The purpose of this procedure is to see whether there exists any ARCH effects. This is done byregressing the squared error terms ε2t on their own lags, so we perform a linear regression, thus,

ε2t = c0 + c1ε2t−1 + ...+ cpε

2t−p

with H0: c0 = c1 = ... = cp and H1: c0 ≥ 0, c1 ≥ 0, ..., cp ≥ 0, if we keep the null then there iswhite noise amongst the error terms. If we reject the null, the error terms have ARCHcharacteristics modelled by a ARCH(p). Performing this test on the standardised squaredresiduals of the model, a high p-value will indicate the model has removed any ARCH effects.Below I have given a practical example from my HSBC data as you can see the model seems tobe adequate (no ARCH effects present) given the large p-values. For more detail on this see R.Engle [1982].

Weighted ARCH LM Tests for HSBC

------------------------------------

Statistic Shape Scale P-Value

ARCH Lag[3] 0.008469 0.500 2.000 0.9267

ARCH Lag[5] 1.584654 1.440 1.667 0.5703

ARCH Lag[7] 2.970199 2.315 1.543 0.5192

20

Page 25: 9.8.15.thesis

Sign Bias test:The sign bias test is another test introduced by R. Engle [1993] which tests the presence ofdifferent leverage effects (or asymmetry effects) as mentioned in the eGARCH definition. Againour test is based on the standardised squared residuals and should indicate whether our GARCHmodel is misspecified. If we reject the null then we should assume the model is misspecified andtry eGARCH model or others see R. Engle [1993] for different model specifics. Similar to theabove except we now regress the squared residuals on the lagged shocks, thus we have,

Z2t = d0 + d11Zt−1<0 + d21Zt−1<0Zt−1 + d31Zt−1≥0Zt−1 + et,

where 1 is the indicator function. This means it takes the value +1 if the subscript constraint issatisfied, 0 otherwise. et is the error term.We perform four simultaneous tests, written as follows:

Sign Bias test: H0 : d1 = 0

Negative Size Bias test: H0 : d2 = 0

Positive Size Bias test: H0 : d3 = 0

Joint Effect test: H0 : d1 = d2 = d3 = 0

The first three tests come in the form of a standard t-test but the last one is a standard F-test.As the null hypothesis eludes to we are looking to see whether our selected model can explainthe effects of positive and negative shocks on the conditional variance. Additionally whether,the effects of large and small positive (or negative) shocks impact on the conditional variance.See C. Brooks [2008] for more detail.To illustrate the test we have included the test carried out for HSBC below:

Sign Bias Test for HSBC

------------------------------------

t-value prob sig

Sign Bias 0.42780 0.6692

Negative Sign Bias 1.09064 0.2765

Positive Sign Bias 0.01427 0.9886

Joint Effect 1.22214 0.7477

As you can see from the illustration the model has large p-values indicating that there does notseem to be any evidence in the data of leverage effects.

21

Page 26: 9.8.15.thesis

3.2 Dependence Measures

Within this section we look to introduce dependence measures which form the foundation of thisthesis and play a crucial role throughout the application in section 4. We will describe twoparticular and frequently used measures Kendall tau and Spearman’s rho. Towards the end weshall include the theory necessary to understand out first system plot of dependence between theinstitutions chosen.Pearson’s product moment correlation coefficient is the most popular measure, however, it hasdrawbacks which limit its scope for us. Thus we move onto so called measures of associationwhich allow us to avoid the limitations of the Pearson Correlation such as: only measures lineardependence, not invariant under non-linear, strictly increasing transformations and is undefinedfor non-finite variance. See N. Chok [2008] for more information.

Measures of AssociationBefore we continue we must must define a core component which is used both measures ofassociation. The following definitions have been sourced from R. Nelson [2006].

Definition 3.17 - ConcordanceIf we take two independent pairs of observations (xi, xj) and (yi, yj) for i, j = 1, ..., n from thecontinuous random variables (X,Y ) then they are concordant if

(xi − xj)(yi − yj) > 0

i.e. xi < xj and yi < yj . This looks to see whether large (small) value of one random variablesimultaneously correspond to large (small) values of the other. Analogues for discordant,

(xi − xj)(yi − yj) < 0

which looks to see whether large (small) value of one random variable simultaneously correspondto small (large) values of the other.These measures give rise to Kendall tau.

Definition 3.18 - Kendall’s tauKendall’s tau is essentially the probability of concordance minus the probability of discordance.Formally defined as: let (Xi, Yi), (Xj , Yj) ∈ (X,Y ) for i, j = 1, ..., n be two independent andidentically distributed copies of (X,Y ). Then Kendall’s tau is written as

τ(X,Y ) = P ((Xi −Xj)(Yi − Yj) > 0)− P ((Xi −Xj)(Yi − Yj) < 0)

As we work with real data we need to use a empirical version τ(X,Y ) which takes on valuesbetween [-1,1] when we have a high number of concordant pairs the value of tau will be close to+1 and when we have a high number of discordant pairs the value will be close to -1.

22

Page 27: 9.8.15.thesis

The empirical version of Kendall tau

τ(X,Y ) =Ncon −Ndis√

Ncon +Ndis +Ntie,x

√Ncon +Ndis +Ntie,y

(3.7)

Ncon = Number of concordant pairsNdis = Number of discordant pairsNtie,x = Number of tied pairs for x, see note below for further explanationNtie,y = Number of ties pairs for y, see note below for further explanation

NB: A pair (xi, yi), (xj , yj) is said to be tied if xi = xj or yi = yj ; a tied pair is neitherconcordant nor discordant.

Given the model you assume there is no need to consider the possibility of tied pairs?

Definition 3.19 - Spearman’s RhoSimilar to Kendall, Spearman’s rho makes use of concordance and discordance. We use the sameterminology as before except we now have three i.i.d copies of (X,Y) say(Xi, Yi), (Xj , Yj)&(Xk, Yk) we write Spearman’s rho as follows:

ρs(X,Y ) = 3[P ((Xi −Xj)(Yi − Yk) > 0)− P ((Xi −Xj)(Yi − Yk) < 0)].

The empirical version of Spearman’s rho is defined as

ρs(X,Y ) =

∑i(r(xi)− rx)(r(yi)− ry)√

(∑

i(r(xi)− rx)2√

(∑

i(r(xi)− ry)2, i = 1, ..., n, (3.8)

where r(xi) is the rank of xi and rx = 1n

∑ni=1 r(xi).

Multidimensional ScalingTo accompany the results we will obtain from the above dependence measures we find it is usefulto get a pictorial view of the dependence between our institutions. Thus we use multidimensionalscaling which allows us to convert the representation of the dependence measure between anytwo institutions into a distance on a [-1,1]x[-1,1] plot. This distance is known as dissimilarity i.e.the bigger the less dependence between the two data sets. We define it as follows

dij := 1− τ(Xi, Xj).

To find a set of points such that the distances between these are approximately equal to thedissimilarities dij in our data, we use Kruskal-Shephard scaling method which seeks valuesz1, ..., zd ∈ R2 such that the following is minimised∑

i 6=j(dij − ||zi − zj ||)2.

||.|| denoting the Euclidean distance in R2. The plot is shown in section 4, figure 21.

23

Page 28: 9.8.15.thesis

As we are about to begin discusses Copulae it is important to mention the connection both ofthese measures have with Copula functions.

Result 3.20 - Link with Copulae: Kendall and Spearman Let X and Y be two contniuostyporandom variables with copula C. Then we have that

τ(X,Y ) = 4

∫[0,1]2

C(u, c)dC(u, v)− 1

and

ρs(X,Y ) = 12

∫[0,1]2

uv dC(u, v)− 3

The little c in the above displayed formula does not seem to be correct. Moreover, there issomething remarkable about the two formulas. Can you find it?

Tail DependenceAlthough Kendall’s tau and Spearman’s rho describe the dependence between two randomvariables over the whole space [0, 1]2. As our study is looking into the occurrence of extremeevents we must look into this into more detail i.e. dependence between two extreme values ofour random variables. The idea of dependence between extreme values is still based onconcordance but we specifically look at the lower left and upper right quadrant of the unitsquare. This again follows the book of Nelson [2006].

Definition 3.21 - Upper and Lower Tail DependenceLet X and Y be two continuous random variables with distribution functions F and G,respectively. We have the upper tail dependence parameter, λu, is the limit of the probability(assuming its existence) that Y is greater than the 100-th percentile of G given that X is greaterthan 100-th percentile of F as t approaches 1, so in math speak we have

λu = limt→1−

P (Y > G−1(t)|X > F−1(t)). (3.9)

And for lower tail dependence parameter, λl, is defined as so

λl = limt→0+

P (Y ≤ G−1(t)|X ≤ F−1(t)). (3.10)

As with Kendall and Spearman we can relate these definitions to copulae.

Result 3.22 - Upper and Lower Tail DependenceLet X and Y be as above but with copula C. If the limits to equations 3.9 and 3.10 exist then weget

λu = limt→1−

1− 2t+ C(t, t)

1− tand

λl = limt→0+

C(t, t)

t.

24

Page 29: 9.8.15.thesis

3.3 Copulae

Copulae have become more and more popular in finance, especially the subsection of risk management.The reason for this is they have the unique capability of decomposing a joint probability distributioninto its univariate marginal distributions and what is called a copula function, these describe thedependence structure between variables. In this section we aim to define a copula function, givesome examples of pair-copula decomposition and detail different copula functions to be used invine copula construction, for use in section 3.4. The majority of the content comes from R. Nelson[2006], K.Aas [2006] and K. Hendrich [2012].

Definition 3.23 - CopulaA copula is a multivariate distribution, C, with uniformly distributed marginals U(0,1) on [0,1].More formally we define a copula as follows via R. Nelson [2006].

A d-dimensional copula is a fucntion C : [0, 1]d → [0, 1] with the following properties:(i) For every u = (u1, ..., ud)

′ ∈ [0, 1]d, C(u) = 0 if at least one coordiante of u is 0.(ii) ∀j = 1, ..., d, it holds that C(1, ..., 1, uj , 1, ..., 1) = uj(iii) C is d-increasing.What is d increasing and why is it important?

Result 3.24 - Sklar’s TheoremFor this result let X = (X1, ..., Xd) be a vector of d random variables with joint density functionf and cumulative function F . Additionally let f1, ..., fd be corresponding marginal densities andF1, ..., Fd the strictly increasing and continuous marginal dstribtuiontypofunctions of X1, ..., Xd. Sklar’s theorem states that every multivariate distribution F withmarginals F1, ..., Fd can be written as

F (x1, ..., xd) = C(F1(x1), ..., Fd(xd)). (3.11)

If F1, ..., Fd are all continuous then C is unique. And conversely if C is a d-dimensional copulaand F1, ..., Fd are distribution functions, then the function F defined by (3.9) is a d-dimensionaldistribution function with margins F1, ..., Fd.Inverting the above allows us to isolate the copula function which is the aim of this thesis i.e.isolate dependence structure which is why sklar’s theorem is so important and vital. So we get

C(u) = C(u1, ..., ud) = F (F−1(x1), ..., F−1(xd)). (3.12)

This now allows us to derive the density copula function, c, through partial differentiation,

f(x) =∂dC(F1(x1), ..., Fd(xd))

∂x1 · · · ∂xd=∂dC(F1(x1), ..., Fd(xd))

∂F1(x1) · · · ∂Fd(xd)f1(x1) · · · fd(xd) (3.13)

Does it follow from the above that C is differentiable?therefore,

c(F1(x1), ..., Fd(xd)) :=∂dC(F1(x1), ..., Fd(xd))

∂F1(x1) · · · ∂Fd(xd)=

f(x)

f1(x1) · · · fd(xd)(3.14)

Now that we have described what a copula function is and how it exists with the marginals andjoint probability function, we move onto discuss how to break down a joint probability function,into the constituent parts necessary to fit copulae.

25

Page 30: 9.8.15.thesis

Pair Copula Decomposition of Multivariate DistributionsFor this subsection we follow K.Aas [2006] and consider d-dimensional joint density as describedin the copula section above. The aim of this section is to describe how we can decompose outjoint density into marginals and pairwise densities in which we can eventually fit the copulae.If we take the density f(x1, ..., xd) we can factorise it into the following constituent parts

f(x1, ..., xd) = f(xd) · f(xd−1|xd) · f(xd−2|xd−1, xd) · ... · f(x1|x2, ..., xd−2, xd−1, xd) (3.15)

Did you define f(xd−1|xd) etc.? Moreover, without saying what f(xd) and f(xd−1|xd) are, I donot see that the decomposition is unique.and this decomposition is unique upto the relabelling of the variables. If we now link what wehave defined in Sklar’s theorem we can re-write our joint density as follows

f(x1, ..., xd) = c12...d(F1(x1), ..., Fd(xd)) · f1(x1) · · · fd(xd) (3.16)

for some uniquely d-variate copula density c12...d. In the bi-variate case we have

f(x1, x2) = c12(F1(x1), F2(x2)) · f1(x1) · f2(x2)

where c12 is an appropriate pair-copula density to describe the pair of transformed variablesF1(x1) and F2(x2). For the conditional density it follows that

f(x1|x2) = c12(F1(x1), F2(x2)) · f1(x1) (3.17)

for the same pair copula. For example if we go back to our main core equation 3.15 we candecompose our second term f(xd−1|xd) into the pair copula c(d−1)d(Fd−1(xd−1), Fd(xd)) and amarginal density fn(xn). For three random variables we construct the following

f(x1|x2, x3) = c12|3(F1|3(x1|x3), F2|3(x2|x3)) · f(x1|x3) (3.18)

for the appropriate pair-copula c12|3,Did you define c12|3 before?applied to transformed variables F (x1|x3) and F (x2|x3), however, this is not unique we can alsorepresent it as follows

f(x1|x2, x3) = c13|2(F1|2(x1|x2), F3|2(x3|x2)) · f(x1|x2)

where the pair-copula c13|2 is different from the c12|3 above.Could you work out an example to demonstrate this?Now we can substitute f(x1|x2) into the equation above giving

f(x1|x2, x3) = c13|2(F1|2(x1|x2), F3|2(x3|x2)) · f(x1|x2) · c12(F1(x1), F2(x2)) · Ff1(x1).

Now generalising this decomposing pair-copula pattern we can say that from equation 3.15 wecan decompose each term into the appropriate pair-copula times a conditional marginal density,using

f(xj |xB) = cjv|B−v(F (xj |xB−v), F (xv|xB−v)) · f(x|xB−v), j = 1, ..., d. (3.19)

Delete the dot after the d

26

Page 31: 9.8.15.thesis

where B ⊂ 1, ..., d\j, xB is a |B|-dimensional sub vector of x. xv is an randomly selectedrandomly selected does not seem to be the appropriate wording.element of xB, therefore, xB−v denotes the (|B| − 1)-dimensional vector when xv is absent fromxB, more simply B−v := B\v. Essentially v determines the type of corresponding copula, sothe obtained constructions are not unique. So we an deduce that, under the appropriateregularity conditions, any equation of the form in 3.15, can be expressed as a product ofpair-copulae, acting on several different conditional distributions. We can also see that theprocess is iterative in nature, and given a specific factorisation, there are still many differentparametrisations.For completeness lets finish our example of our tri-variate case where we get

f(x1, x2, x3) = f(x3) · f(x2|x3) · f(x1|x2, x3)= f(x3) · c23(F2(x2), F3(x3)) · f(x2) · f(x1|x2, x3)= f(x3) · c23(F2(x2), F3(x3)) · f(x2)

· c12|3(F1|3(x1|x3), F2|3(x2|x3)) · f(x1|x3)= f(x3) · c23(F2(x2), F3(x3)) · f(x2)

· c12|3(F1|3(x1|x3), F2|3(x2|x3)) · c13(F1(x1), F3(x3)) · f(x1)

We conducted the factorisation above using equation 3.15 followed by using 3.17 except here wehave f(x2, x3) instead of f(x1, x2) (same method applies) and finally we use 3.18. Tiding upterms gives us,

f(x1, x2, x3) = f(x1) · f(x2) · f(x3)

· c13(F1(x1), F3(x3)) · c23(F2(x2), F3(x3))

· c12|3(F1|3(x1|x3), F2|3(x2|x3)),

like we’ve discussed above please note this factorisation is not unique we could also have thefollowing

f(x1, x2, x3) = f(x1) · f(x2) · f(x3)

· c12(F1(x1), F2(x2)) · c23(F2(x2), F3(x3))

· c13|2(F1|2(x1|x2), F3|2(x3|x2)).

Either way after decomposing our multivariate distribution we finish with the product ofmarginal distributions and pair-copulae.

To finish off this section we return to where we left off in equation 3.19. We need to discuss thenature of the marginal conditional distributions of the for F (xj |xB).of the for?J. Harry [1996] showed that for every, v ∈ B

F (xj |xB) =∂Cjv|B−v(F (xj |xB−v), F (xv,xB−v))

∂F (xv,xB−v)(3.20)

where Cij|k is a bivariate copula distribution function. When we look at the univariate case ofB = v note that we have

F (xj |xv) =∂Cjv(F (xj), F (xv))

∂F (xv)

27

Page 32: 9.8.15.thesis

In section 3.5 we will make use of the so called h-function, h(x, v,Θ), to represent theconditional distribution function when x & v are uniform, i.e. f(xj) = f(xv) = 1 andF (xj) = xj and F (xv) = xv. This means we have,

h(xj |xv,Θjv) := F (xj |xv) =∂Cjv(F (xj), F (xv))

∂F (xv)=∂Cjv(xj , xv)

∂xv, (3.21)

where xv corresponds to the conditioning variable and Θjv relates to the set of parameters forthe copula of the joint distribution function of x and v. Finally, let h−1(xj |xv,Θjv) be theinverse of the h-function w.r.t to the first variable xj , or equivalently the inverse of theconditional distribution function F (xj |xB).Now that we have finished decomposing our joint density into its marginals and pairwise-copulaewe need to look at the possible copula distributions to fit in order to build our vine copula’s inthe next section.

The Copula Family of FunctionsIn this section we will outline the different copula functions available to us, which we will lateruse for the vine copula models. When choosing which copula model to use we usually look to seewhether the data shows positive or negative dependence, the different copula models will becharacterised by the shape they exhibit amongst the data clustering. For this section we followHendrich [2012] as it details the copula families very clearly.

GaussianThe single parameter Gaussian copula became well known for its use in the valuation ofstructured products during the financial crisis of 2007 and 2008. Its popularity stems from thefact that it is easy to parametrise and work with. See for more detail C. Meyer [2009].The bivariate Gaussian copula with correlation parameter ρ ∈ (−1, 1) is defined to be

C(u1, u2) = Φρ(Φ−1(u1),Φ

−1(u2)),

where Φρ(·, ·) represents the bivariate cumulative distribution function of two standardGaussian distributed random variables with correlation ρ. Φ−1(·) is the inverse of the univariatestandard Gaussian distributed function. The related copula density is given by

c(u1, u2) =1√

1− ρ2exp

(− ρ2(x21 + x22)− 2ρx1x2

2(1− ρ2)

)

where we have x1 = −1(u1) and similarly for x2. Although for ρ→ 1 (ρ→ −1) the Gaussiancopula shows complete positive (negative) dependence, we have the independent copula if ρ = 0.

In order to give the reader some idea of this copulas graphical properties we have plotted scatterand contour plots for three different value of τ which illustrate the three different levels ofdependence τ = 0.8 which is high positive dependence, τ = −0.8 which is high negativedependence and finally τ = 0.3 which is quite neutral in terms of dependence. If the readerwishes to see the same plots for different copula we recommend looking at Hendrich [2012].Please see the next page.

28

Page 33: 9.8.15.thesis

Figure 9: Bivariate Normal Copula: τ = 0.8

Figure 10: Bivariate Normal Copula: τ = -0.8

Figure 11: Bivariate Normal Copula: τ = 0.3

29

Page 34: 9.8.15.thesis

t Copulat copula a two parametric copula function is defined as

C(u1, u2) = tρ,ν(t−1ν (u1), t−1ν (u2)),

where tρ,ν represents the bivariate cumulative distribution function of two standard student-tdistributed random variables with correlation parameter ρ ∈ (−1, 1) and ν > 0 degrees offreedom. We let t−1ν (·) be the quantile function of the univariate standard student-t distributionfunction with ν degrees of freedom. Copula density is given by

c(u1, u2) =Γ(ν + 1

2

)/Γ(ν2

)νπdtν(x1)dtν(x2)

√1− ρ2

(1 +

x21 + x22 − 2ρx1x2ν(1− ρ2)

)− ν+22

,

where xi = t−1ν (ui), i = 1, 2, and dtν(xi) is the density of the univariate standard Student-tdistribution with ν degrees of freedom, so

dtν(xi) =Γ(ν + 1

2

)Γ(ν2

)√πν

(1 +

x2iν

)− ν+22

, i = 1, 2.

The t copula differs from the Gaussian copula in the sense that it exhibits fatter tails, however,for increasing degrees of freedom the t copula does approach the Gaussian copula. As before forρ→ 1 (ρ→ −1) the t copula shows complete positive (negative) dependence.

Figure 12: t-Student Copula contour plots ν = 4: τ = 0.8, 0.3 &− 0.8, respectively

Over the page we look at how the contours shape the dependence given a fixed τ = 0.3 andvarying degrees of freedom ν = 3, 7 &11. What we see is that as ν gets larger we get closer andcloser to the elliptical shape of the Gaussian copula.

30

Page 35: 9.8.15.thesis

Figure 13: t-Student Copula contour plots τ = 0.3: ν = 3, 7 &11, respectively

We now look at introducing a different family of copulae called Archimedean copulae. They arevery popular as they model dependence of arbitrarily high dimensions with only one parameterto indicate the strength of dependence.

Frank CopulaThe Frank Copula distribution is given by

C(u1, u2) = −1

θlog

(1 +

[e(−θu1) − 1

][e(−θu2) − 1

]e(−θ) − 1

),

and the single parameter θ ∈ R\0. The copula density is as follows

c(u1, u2) = θ(eθ − 1)e−θ(u1+u2)(

e−θ − 1 +(e−θu1 − 1

)(e−θu2 − 1

))2 .similar to Gaussian and t copula in the sense that we ascertain complete positive dependence forθ → +∞, independence θ → 0 and finally complete negative dependence for θ → −∞.

Figure 14: Frank Copula contour plots τ = 0.8, 0.3 &− 0.8, respectively

In figure 14 above we have illustrated the contour plots for the Frank copula with varying valuesof τ similar to previous plots, note the difference with shape of the contours compared to theGaussian and t-Student , here we have a significant heavy tail dependence.

31

Page 36: 9.8.15.thesis

Clayton CopulaThe Clayton copula distribution is given by

C(u1, u2) =(u−θ1 + u−θ2 − 1

)− 1θ ,

with the following density

c(u1, u2) = (1 + θ)(u1u2)−1−θ(u−θ1 + u−θ2 − 1)−

1θ−2.

As θ > 0, we are limited to model only positive dependence. Hence the Clayton only exhibitscomplete positive dependence for θ → +∞ and independence for θ → 0.

Figure 15: Clayton Copula contour plots τ = 0.8 & 0.3, respectively

In figure 15 above we can see, in general the Clayton illustrates a considerable heavy taildependence in the upper right quadrant indicating heavy upper tail dependence.

Gumbel CopulaThe Gumbel copula distribution is given by

C(u1, u2) = exp(−[(− log u1)

θ + (− log u2)θ] 1θ

),

with single parameter θ ≥ 1. Density is as follows

c(u1, u2) = C(u1, u2)

[1 + (θ − 1)Q

]Q−2+

(u1u2)(log u1 log u2)1−θ,

withQ =

[(− log u1)

θ + (− log u2)θ].

So with θ = 1 we have independence and we have complete positive dependence for θ → +∞.

32

Page 37: 9.8.15.thesis

Figure 16: Gumbel Copula contour plots τ = 0.8 & 0.3, respectively

Note in figure 16 the similarities to the Clayton copula function essentially we now have heavydependence in the lower left quadrant illustrating significant lower tail dependence.

Note: We can see that both the Clayton and Gumbel copula distributions don’t exhibitnegative dependence. In order to get around this restriction so that we can still utilise thefundamental characteristics of these copulas we introduce rotations of the original functions.This the allows us to model data with negative dependence properties with the Clayton andGumbel. We don’t go into detail with this subsection of copula’s but if the reader wishes topursue this further we recommend reading Hendrich [2012] starting page 13.

Now that we have discussed the possible copula functions available to us to for model fittingpurposes. We need to detail how we go about building the pairwise-copula model structure.This leads us into our next section on Vine Copula Construction.

33

Page 38: 9.8.15.thesis

3.4 Vine Copula Construction

When considering a joint density with a high number of dimensions we find that there exists aconsiderable amount of possible pair-copulae constructions. With the work done by Bedford andCooke [2001] we are now able to organise different possible decompositions into a graphicalstructure. In this section we explore the two subcategories of the general regular vine (R-vines)those are conical vine (C-vine) and (D-Vine). These particular vine types are becomingincreasingly popular with a considerable surge of work going into risk management in financeand insurance. As we are using R-software during the application process we recommend thereader also follows E. Brechmann and U. Schepsmeier [2013] to learn the programming tools.After discussing the theory of C & D-vines we will look at how we select a model and thegoodness-of-fit criteria used to make comparisons between the different model selections.

D-vinesThe D-vine is probably the most simplistic subgroup of R-vines and offers a good place to start.We shall follow the work of K. Aas [2006], who brought the advancement of statistical inferenceinto the C & D-vine model fitting. The graphical representation is straight forward as can beseen in figure 17 below. Each edge corresponds to a pair copula, where by the edge labelrepresents the relative copula density subscript i.e. 1, 3|2 represents c13|2(·). The wholedecomposition can be described by d(d− 1)/2 edges and the d marginals for the respective dcontinuous random variables. T ′is i = 1, ..., 4 are the trees which describe the break down of thepairwise copula construction. It was also shown that there are d!/2 possible vines from ad-dimensional joint probability density.

Figure 17: D-Vine tree for (X1, .., X5)

34

Page 39: 9.8.15.thesis

Density of the D-vine copula in figure 17 looks as follows:

f(x1, x2, x3, x4, x5) = f(x1) · f(x2) · f(x3) · f(x4) · f(x5)

· c12(F (x1), F (x2)) · c23(F (x2), F3(x3)) · c34(F (x3), F (x4)) · c45(F (x4), F (x5))

· c13|2(F (x1|x3), F (x3|x2)) · c24|3(F (x2|x3), F (x4|x3)) · c35|4(F (x3|x4), F (x5|x4))· c14|23(F (x1|x2, x3), F (x4|x2, x3)) · c25|34(F (x2|x3, x4), F (x5|x3, x4))· c15|234(F (x1|x2, x3, x4), F (x5|x2, x3, x4))

We can generalise the above for the joint probability density f(x1, ..., xd) which gives us

d∏k=1

f(xk)

d−1∏j=1

d−j∏i=1

ci,i+j|i+1,...,i+j−1(F (xi|xi+1, ..., xi+j−1), F (xi+j |xi+1, ..., xi+j−1)

)(3.22)

Conical Vines (C-vines)With the conical vine the structure is formatted as follows. For the first tree, the dependencewith respect to one particular variable, the first root node, is modeled using bivariate copulas foreach pair. Conditioned on this variable, pairwise dependencies with respect to a second variableare modeled, the second root node. In general, a root node is chosen in each tree and all pairwisedependencies with respect to this node are modeled conditioned on all previous root nodes, i.e.,C-vine trees have a star structure. As defined by E. Brechmann and U. Schepsmeier [2013]. KWe again take an example of a five dimensional joint probability density with decomposition asfollows

f(x1, x2, x3, x4, x5) = f(x1) · f(x2) · f(x3) · f(x4) · f(x5)

· c12(F (x1), F (x2)) · c13(F (x1), F3(x3)) · c14(F (x1), F (x4)) · c15(F (x1), F (x5))

· c23|1(F (x2|x1), F (x3|x1)) · c24|1(F (x2|x1), F (x4|x1)) · c25|1(F (x2|x1), F (x5|x1))· c34|12(F (x3|x1, x2), F (x4|x1, x2)) · c35|12(F (x3|x1, x2), F (x5|x1, x2))· c45|123(F (x4|x1, x2, x3), F (x5|x1, x2, x3))

The graph of this decomposition, figure 18, is illustrated on the next page.

As with the D-vine we can generalise this to joint probability density f(x1, ..., xd) denoted by

d∏k=1

f(xk)d−1∏j=1

d−j∏i=1

cj,j+1|1,...,j−1(F (xj |x1, ..., xj−1), F (xj+i|x1, ..., xj−1)

)(3.23)

Aas [2006] was able to show there are d!/ possible vines

35

Page 40: 9.8.15.thesis

Figure 18: C-Vine tree for (X1, .., X5)

It’s important to note that fitting a conical vine can be more advantageous when a specificvariable is known to command a lot of the interactions in the data set.

As we have more important material to cover we stop here in terms of theoretical detail but werecommend the interested reader, reviews K. Aas [2006] for more information.

Now that we have defined the types of vine copula’s we can fit, we must discuss the process usedto select the model.

Vine Model Selection ProcessWith the knowledge of the different types of vine copulas available to us we will now look at theprocure necessary to fit them and make inferences on the models. In the application in section 4we will fit both types of vine copula’s and make comparisons. For this section we will follow thepaper by E. Brechmann and U. Schepsmeier [2013] is it runs parallel with the coding. The stepsto construct a vine copula look as follows:

36

Page 41: 9.8.15.thesis

(i) Structure selection - First step is to decide on the structure of the decomposition as we’veshown in the previous section with the vine graphs.(ii) Copula selection - With the structure in place we then need to chose copula functions tomodel each edge of the vine copula construction.(iii) Estimate copula parameters - Then we need to estimate the parameters for the copulaechosen in step (ii).(iv) Evaluation - Finally the models need to be evaluated and compared to alternatives.

(i) Structure selection: If we wanted to get a full overview of the model selection process wewould fit all possible models and compare our results. However, this is not realistic. As we’veseen in the previous section as the number of dimensions increases the possible outcomes of thedecompositions increases to a sufficiently large number. To counter this problem we need to takea more clever approach.

C.Czado [2011] introduced a sequential approach which takes the variable with the largest valuefor

S :=d∑i=1

|τij | j = 1, ..., d, (3.24)

and allocates it to the root node for the first tree. The value represents an estimate for thevariable with the most significance in terms of interdependence. This process is repeated untilthe whole tree structure is completed i.e. move onto the second tree and find the next largestestimated pair kendall tau value. As the copulae specified in the first trees of the vine underpinthe whole dependence structure for our chosen model, we want to capture most of thedependence in this tree. You will see in the application section that we order the variables forthe tree structure via equation 3.24. Please see the source mentioned for more detail.Loading the VineCopula package (U. Schepsmeier et al [2015]) in R and then using the functionRVineStructureSelect, allows us to carry out the above procedure in an automated fashion.This function can select optimal R-vine tree structure through maximum spanning trees withabsolute values of pairwise Kendall’s tau’s as weights but also includes the above method forC-vines. See VineCopula package for further details or R-code in the appendix.

(ii) Copula selection: Once we’ve defined the vine structure we need to conduct a copulaselection process. It can be done via Goodness-of-fit tests, Independence test, AIC/BIC andgraphical tools like contour plots. We will be using the function CDVineCopSelect for the C- &D-vine and RVineCopSelect for R-vine, copula selections. These allow the coder to decidewhether they use AIC or BIC and/or Independent test (see detail below). The program tests anextensive range of copula functions, we refer the reader to VineCopula package for more detail.To recap on AIC and BIC criteria see section 3.1.4.Independent test - looks at whether two univariate copula data sets are independent or not.The test exploits the asymptotic normality of the test statistic

Statistic := T =

√9n(n− 1)

2(2n+ 5)× |τ |

37

Page 42: 9.8.15.thesis

where n is the number of observations for the copula data vectors and τ is the estimatedKendall tau value between two copula data vectors u1&u2. The p-value of the null hypothesis ofbivariate independence hence is asymptotically

p− value := 2× (1− Φ(T ).

This was referred from VineCopula package.

(iii) Estimate copula parameters:Now we have chosen the copula distributions we look to estimate the parameters. Again toconduct this we use R functions which are as follows: for C- & D-vine we have CDVineSeqEst

and for R-vine we use RVineSeqEst. The pair-copula parameter estimation is performedtree-wise, i.e., for each C- or D-vine tree the results from the previous trees are used to calculatethe new copula parameters. The estimation method is either done by pairwise maximumlikelihood estimation (see page 16 E. Brechmann [2013] for elaboration on test details) orinversion of Kendalls tau (this method is restricted to copula functions with only oneparameter). Referenced from VineCopula package, please consult for more detail.

(iv) Evaluation: Finally in order to evaluate and compare our selected models, we can againuse the classical AIC/BIC measure but also the Vuong test. Please see previous sections forexplanation of AIC/BIC criteria.Vuong test - The Vuong test is a likelihood-ratio test which can be used for testing non-nestedmodels. It is carried out between two d-dimensional R-vine copula models. The test is asfollows: let c1&c2 be two competing vine copula models in terms of their densities and withestimated parameter sets θ1&θ2. We compute the standardised sum, ν, of the log difference ofthe pointwise likelihoods

mi := log

[c1(ui|θ1)c2(ui|θ2)

]for observations ui with i = 1, ...n. Statistic is as follows

statistic := ν =1n

∑ni=1mi√∑n

i=1(mi − m)2

Vuong showed that ν is asymptotically standard normal. According to the null-hypothesis

H0 : E[mi] = 0, ∀i = 1, ..., n,

thus we prefer vine model 1 over vine model 2 if

ν > Φ−1(

1− α

2

),

where Φ−1 denotes the inverse of the standard normal distribution function. If ν < Φ−1(

1− α

2

)we choose model 2. But, if |ν| ≤ Φ−1

(1− α

2

)no decision can be made among the two models.

Like AIC and BIC this test can be altered to take into account the number of parameters used,please see VineCopula package for more detail.

38

Page 43: 9.8.15.thesis

3.5 Vine Copula Simulation

Moving forward we now look at vine copula simulation. Here we set out the theory necessary tosimulate copula data from our C-vine models presented in the previous section. The simulationwill be done conditional on a arbitrarily chosen special variable xi+ . The work done by K. Aasonly considers sequential simulation from B = 1, ..., d in an ordered fashion starting from x1.But for us we need to be able to simulate from any starting point within B. This requires aslight alteration to K. Aas algorithm, we will reference the paper by Hendrich [2012] whoexplains this alteration. We must firstly outline the basic theory before introducing thealgorithm.

Normal SimulationIn this section we depict the work done by K. Aas. By ’Normal’ we mean that we are notconditioning on any specially chosen variable. Going forward we will keep this labelling forreference. Given a sample ω1, ..., ωd independently and identically distributed on uniform[0, 1]then the general simulation procedure following a C-vine looks as follows:

x1 = ω1

x2 = F−1(ω2|x1)x3 = F−1(ω3|x1, x2)x4 = F−1(ω4|x1, x2, x3).

.

.

xd = F−1(ωd|x1, x2, x3, ..., xd−1)

To successfully run the simulation we need to be able to calculate the conditional distributionfunctions such as F (xj |x1, x2, ..., xd−1, j ∈ 2, ..., d, and their inverses, respectively, for thisprocedure we make critical use of the h-function mentioned in 3.21 and the pairwisedecomposing general equation 3.20. We know from 3.20 that the selection of v ∈ B determinesthe copula Cjv|B−ν used to calculate the conditional distribution function. We only want toinclude the copulae already involved in the decomposition of the joint density. Hence, forv = j − 1 &B = 1, ..., j − 1 this gives us

F (xj |x1, ..., xj−1) =∂Cj,j−1|1,...,j−2

(F (xj |x1, ..., xj−2), F (xj−1|x1, ..., xj−2)

)∂F (xj−1|x1, ..., xj−2)

= h(F (xj |x1, ..., xj−2)|F (xj−1|x1, ..., xj−2), θj,j−1|1,...,j−2

), (3.25)

we notice again that the h-function decomposes the conditional distribution function into twolower-dimensional distribution functions. This characteristic allows us to solve for the above

39

Page 44: 9.8.15.thesis

equation by applying the h-function iteratively on the first argument. This leads to

F (xj |x1, ..., xj−3, xj−2, xj−1) = h(F (xj |x1, ..., xj−2)|F (xj−1|x1, ..., xj−2), θj,j−1|1,...,j−2

)F (xj |x1, ..., xj−2) = h

(F (xj |x1, ..., xj−3)|F (xj−2|x1, ..., xj−3), θj,j−2|1,...,j−3

)F (xj |x1, ..., xj−3) = h

(F (xj |x1, ..., xj−4)|F (xj−4|x1, ..., xj−4), θj,j−3|1,...,j−4

··

F (xj |x1, x2) = h(F (xj |x1)|F (x2|x1), θj2|1

)F (xj |x1) = h(xj |x1, θj1) (3.26)

One can see from the system of equations above that equation 3.25 can essentially be written asa nested set of h-functions. By looking at he RHS of the equations in 3.26 you can see thesubscript order is always dropping one as we move down to the next equation. This meansimplies that the equations can be solved sequentially. For more detail see K. Aas.

Conditional SimulationNow consider simulation conditional on a arbitrary selected variable of interestxi+ , i

+ ∈ 1, ..., d. Given same conditions as in Normal simulation procedure expect here wecondition on x3 = a where a ∈ [0, 1], we have simulation procedure as follows:

x1 = F−1(ω1|x4)x2 = F−1(ω2|x1, x4)x3 = a

x4 = F−1(ω4|x1, x2, x3).

.

.

xd = F−1(ωd|x1, x2, x3, ..., xd−1)

We can deduce from our simulation procedure above that we have a different samplingprocedure compared to the Normal one. Simulating values for variables with subscripts greaterthan i is fine i.e. j = i+ + 1, i+ + 2, ..., d, problems arises when we simulate values of thevariables with subscripts less than i+ i.e. j = 1, ..., j − 1, i+.We now define the conditioning set for simulated variables with indices j = 1, ..., j − 1, i+, as Bj .The system of equations in 3.26 are the same in this conditional case ∀j ≤ i+ so again thenested h-functions can be solved sequentially, see Hendrich [2012] for the illustration of this.In order to clarify how the conditional simulation procedure works we give an example takenfrom Hendrich [2012], please see over the page.

40

Page 45: 9.8.15.thesis

Example - Conditional Simulation for d=5 & i+ = 4For the simulation conditional on x4 = a ∈ [0, 1] we have:

(1) ω1 = F (x1|x4) = h(x1|x4, θ14) and so

x1 = h−1(ω1|x− 4, θ14)

(2) ω2 = F (x2|x1, x4) = h( F (x2|x1)︸ ︷︷ ︸=h(x2|x1,θ12)

| F (x4|x1)︸ ︷︷ ︸=h(x4|x1,θ14)

, θ34|12) with

h(x2|x1, θ12) = h−1(ω2|h(x4|x1, θ14), θ24|1)︸ ︷︷ ︸=:y1

⇐⇒ x2 = h−1(y1|x1.θ12)]

(3) ω3 = F (x3|x1, x2, x4) = h( F (x3|x1, x2)︸ ︷︷ ︸=h(F (x3|x1)|F (x2|x1),θ12)

|F (x4|x1, x2), θ24|1) and hence

F (x4|x1, x2) = h( F (x4|x1)︸ ︷︷ ︸=h(x4|x1,θ14)

| F (x2|x1)︸ ︷︷ ︸=h(x2|x1,θ12)

, θ12) =: y2

this gives ush( F (x3|x1)︸ ︷︷ ︸

=h(x3|x1,θ13)

| F (x2|x1)︸ ︷︷ ︸=h(x2|x1,θ12)

, θ12) = h−1(ω3|y2, θ34|12)︸ ︷︷ ︸=:y3

⇐⇒ h(x3|x1, θ13) = h−1(y3|h(x2|x1, θ12), θ23|1)︸ ︷︷ ︸=:y4

⇐⇒ x3 = h−1(y4|x1, θ13)

(4) As we chose at the start, x4 = a ∈ [0, 1] (5)

ω5 = F (x5|x1, x2, x3, x4) = h(

F (x5|x1, x2, x3)︸ ︷︷ ︸=h(F (x5|x1,x2)|F (x3|x1,x2),θ35|12)

|F (x4|x1, x2, x3), θ45|123)

with

F (x4|x1, x2, x3) = h(F (x4|x1, x2), F (x3|x1, x2), θ34|12) =: y5

additionallyF (x3|x1, x2) = h(F (x3|x1)|F (x2|x1), θ23|1) =: y6

so we get the following

⇐⇒ h(F (x5|x1, x2)|F (x3|x1, x2)︸ ︷︷ ︸=y6

, θ35|12) = h−1(ω5|y5, θ45|123)︸ ︷︷ ︸=:y7

⇐⇒ h(F (x5|x1)|F (x2|x1), θ25|1) = h−1(y7|y6, θ35|12)︸ ︷︷ ︸=:y8

41

Page 46: 9.8.15.thesis

⇐⇒ h(x5|x1, θ15) = h−1(y8|h(x2|x1, θ12), θ25|1)︸ ︷︷ ︸=:y9

⇐⇒ x5 = h−1(y9|x1, θ15)

For more detail on this please see Hendrich [2012] page 117. Now that we have the abovesampling procedure for the conditional case we are now able to alter the algorithm for theNormal simulation procedure introduced by K. Aas to give the following (referenced fromHendrich page 119):

Algorithm: Conditional simulation algorithm for a C-vine. Generate one samplex1, ..., xd from the C-vine, given that variable xi+, i

+ ∈ 1, ..., d, is equal to a pre-specified valuea.

Sample ω1, ..., ωi+−1, ωi++1, ..., ωd independent and uniformly distributed on [0,1].

xi+ = vi+1 = a

for j ← 1, ..., i+ − 1, i+ + 1, ..., dvj1 = ωj

if j > i+ thenvj1 = h−1(vj1|vi+j , θi+j|1,...,j−1)

end if

if j > 1 thenfor k ← j − 1, ..., 1vj1 = h−1(vj1|vkk, θkj|1,...,k−1)

end forend if

xj = vj1if j < d then

for l← 1, ..., j − 1vj,l+1 = h(vjl|vll, θlj|1,...,l−1)

end forend if

if j < i+ thenvi+,j+1 = h(vi+j |vjj , θji+|1,...,j−1)

end ifend for

Summary of algorithm: The outer for-loop will run over the sampled variables. Thesampling of variable j is initialised with respect to its position in the vine. Therefore if j < i+

then calculation depends on i+, if j > i+ it does not. The j variable is then carried forward intofirst inner for-loop. For the last steps the conditional distribution functions needed for sampling(j + 1)th variable are calculated. As F (xj |x1, ..., xj−1) is computed recursively in the second

42

Page 47: 9.8.15.thesis

inner for-loop for every j, the corresponding F (xi+ |x1, ..., xj−1) is worked out in the last step∀j < i+.

43

Page 48: 9.8.15.thesis

4 Application

Now that the theory is completed we can look to apply it to our data set. There are severalsteps necessary in order to acquire some meaningful results. First we need to fit the time seriesmodels to get our standardised residuals, which then, need to be transformed into copula dataas mentioned in 2 The Data, via probability integral transform. Once this is done we move ontofitting our copula vine structures and their respective copula distributions. Finally we look at thecopula simulation where we hope to answer our major questions mentioned in 1.2 Questions ofOur Investigation.Through this section we also apply the procedures to the 2009 data set, for comparative purposes,in line with our questions in section 1.2. We do not include all the results from the fitting procedurebecause we do not want to cloud this paper with repetition of the results already obtained withthe 2008 data set.

4.1 Fitting Time Series Models

As we discussed in section 3.1, in order to conduct our copula construction we need to ensureour data sets are independent and identically distributed (i.i.d). In order to do this we are goingto fit the time series models as discussed in section 3.1 where we are able to acquire modelresiduals which are i.i.d, note these residuals are modelled by the distributions chosen in section3.1.1.’Distribution of the Zt’s. Once we have completed this step we will look to apply theprobability integral transform to secure our copula data.

Fitting ProcedureAs our data comes in the format of equation 3.1, we make the assumption that our data isweakly stationary. With this in mind we model each individual time series as follows:

1. We first need to decide on the order p,q of ARMA(p,q) model, this is done using theauto.arima function (forecast package) in R which selects the best fitting model via theAIC criteria as a measure of goodness-of-fit. Note this can also be done manually usingthe graphical approach i.e. ACF and PACF, depends on the readers preference. In thispaper we try to automate as many of these processes in order to tailor this to acomputationally convenient and easy to use tool for management.

2. Now we look to specify our GARCH model as you will see from our section 3.1.3 andreferring to the paper A. Ghalanos [2014]. We can try a wide variety of GARCHspecifications and fit their respective models in order to find the best fitting model viaAIC/BIC and log likelihood criteria (see 3.1.4 for recap). For this we use ugarchspec andugarchfit functions within the VineCopula package. Please reference Appendix C forvisibility on the code.

3. At the same time we need to look at the different types of distributions to fit to ourstandardises residuals. Again we can use the criteria above for comparative purposes, butwe must also consider, tests to see whether the fitted residuals are independently andidentically distributed according to the assumed distribution chosen. We use QQ-plots,choosing the distribution which has the most points lying on a straight line.

44

Page 49: 9.8.15.thesis

4. The final set of tests are used to ascertain whether we have a good performing model ifafter fitting a standard GARCH model we find the Sign Bias test suggest a presence ofasymmetry we should fit a eGARCH model. However, if our results do not differsignificantly we should select the basic model so we avoid over parameterisation.

In table 3 and table 4 on the next page we detail our findings from the above procedure. Thetables include the type of ARMA(p,q) model selected with its associated parameters, the typeGARCH(1,1) modelled selected i.e. eGARCH or csGARCH and their associated parameters,respective distributions for the residuals and their parameters and finally the info criteriaconsisting of log Likelihood, AIC and BIC criteria.

During the fitting process we found that the eGARCH model surprisingly fit the majority of ourmodels. Often when fitting the standard GARCH (sGARCH) model the parameters we eitherdeemed insignificant or their were clear signs of leverage effects/asymmetry effects amongst thedata. Also we were captured by the single use of the csGARCH model (Component sGARCH)model, it seems that its properties of modelling both short-run and long-run movements ofvolatility fitted the OML.L data well. Additionally, the most common statistical distributions tomodel the residuals was the t-Student and Normal distribution which was not necessarilysurprising as the t-Student model is notorious for capturing the leptokurtosis characteristic offinancial data. The final two distributions used were skewed ged and standard ged.

When we look at the p-values within the table one can see that the majority of the parametersare significant at the 5% level, there are a couple of parameter estimates that just fall outside ofthis including the alpha (p=0.154) for csGARCH on OML.L model and eta parameter (p =0.133) for PRU.L but asides these we can say the majority of the parameters fit the data well.Interestingly enough the mean parameter is absent for the majority of the institutions, all of thebanks in fact, the banks showed no sign of autocorrelation which meant they did not require anARMA model. On the other hand, the insurance companies seemed to illustrate some form ofautocorrelation which had to be modelled. The beta parameter was less than or equal to one forall eGARCH models ensuring our stationarity condition had been satisfied. If we consider thedistribution parameters we can see that the majority of them do not exhibit signs of skewnessexcept for PRU.L which oddly shows sign of positive skewness. If one looks at a plot of theoriginal data this can be made apparent. leptokurtosis does seem to be prominent within thedata but we know to expect this from financial time series.

Our goodness of fit measures are included at the end of table 4 which shows the log likelihoodnumber and the attaching AIC and BIC numbers, ranging [-6.334,-5.001] and [-6.264, -4.9312],respectively.

Moving onto our informative time series plots in Appendix A - QQ-Plots, Empirical Density ofStandardized Residuals and Residual Plots. One can see with the QQ-plots that the majority ofthe points lie on the diagonal straight line. HSBA.L and LLOY.L seem to have a slight tailmoving away from the lie, however, generally speaking the QQ-plots suggest the model areadequate. The empirical density of standardised residuals illustrate the fit of the chosendistribution against the standardised residuals. As you can see the distributions capture themajority of the data characteristics, the plotted bars escape the density curve, slightly in parts.

45

Page 50: 9.8.15.thesis

Finally we have the residual plot which has been selected to test for some sense of boundedness.One can see that the vast majority of the data points are all contained within the [-2,2]horizontal bounds. This is a reassuring sign that we have i.i.d residuals.

46

Page 51: 9.8.15.thesis

Com

pany

AR

MA

Param

eters

Garch

type

Param

eters

pq

µφ1

η1

ωα

βγ

η11

η21

HSBA.L

00

estim

ate

eGarch

-0.278

-0.218

0.970

0.154

p-valu

e0.000

0.001

0.000

0.020

LLOY.L

00

estim

ate

eGarch

-0.003

-0.161

0.978

0.170

p-valu

e0.000

0.000

0.000

0.000

BARC.L

00

estim

ate

eGarch

-0.179

-0.096

0.979

0.220

p-valu

e0.075

0.088

0.000

0.003

STAN.L

00

estim

ate

eGarch

-0.161

-0.270

0.983

0.118

p-valu

e0.000

0.000

0.000

0.000

PRU.L

01

estim

ate

-0.002

-0.095

eGarch

-0.181

-0.251

0.977

0.123

p-valu

e0.056

0.133

0.000

0.000

0.000

0.027

LGEN.L

11

estim

ate

0.634

-0.787

eGarch

-0.014

-0.123

1.000

0.127

p-valu

e0.000

0.000

0.020

0.005

0.000

0.000

AV.L

11

estim

ate

0.748

-0.814

eGarch

-0.105

-0.183

0.989

0.153

p-valu

e0.000

0.000

0.000

0.000

0.000

0.000

OM

L.L

00

estim

ate

-0.002

csG

ARCH

0.000

0.159

0.140

0.979

0.140

p-valu

e0.015

0.000

0.154

0.000

0.000

0.002

Tab

le3:

AR

MA

-GA

RC

Hta

ble

for

all

com

pan

ies

Com

pany

Distrib

utio

nN

am

eParam

eters

Log

Lik

elihood

AIC

BIC

νζ

HSBA.L

t-student

5.149

806.242

-6.334

-6.264

0.008

LLOY.L

ged

1.418

656.687

-5.144

-5.060

0.000

BARC.L

t-student

9.125

637.949

-5.004

-4.934

0.063

STAN.L

norm

al

671.665

-5.278

-5.222

PRU.L

sged

0.975

1.437

668.269

-5.220

-5.108

0.000

0.000

LGEN.L

t-student

5.589

713.341

-5.584

-5.486

0.006

AV.L

norm

al

685.300

-5.370

-5.286

OM

L.L

norm

al

637.628

-5.001

-4.931

Tab

le4:

Sta

nd

ard

ised

Res

idu

alD

istr

ibu

tion

tab

lefo

ral

lco

mp

anie

s

47

Page 52: 9.8.15.thesis

We proceed to analyse the goodness-of-fit through the diagnostics tests for the standardisedresiduals, if you look on the next page, table 5 details the results from our tests mentioned insection 3.1.4.

We begin with the Ljung Box test which is tested against lags of 1,2 & 5 for the standard testand lags 1,5 & 9, for the squared residual test. LGEN.L and AV.L have different lags for thestandard Ljung Box test which is due to their ARMA(p,q) orders. For the standard Ljung Boxresidual test all of the companies with the exception of OML.L, have consistent high values forthe p-value. This implies there is sufficient evidence to keep the null hypothesis of noautocorrelation. OML.L at lag 2 suggests we reject the null at the 5% level but we expect this isdue to the quality of the data and can not remove this. Looking at the squared residual test wesee a similar picture, all of the p-values are significantly larger than .05, this implies there issufficient evidence to suggest independence between residuals.There is one particular data pointwhich is close to the 5% level, PRU.l at lag 9 with a p-value of 0.063. But apart from this thetests seem to have performed in our favour.

Now we move onto the ARCH-LM test at lags 3,5 & 9 which we’ve performed in order to testfor ARCH effects among the residuals. Aside from PRU.L and BARC.L the rest of thecompanies have large p-values which indicates that the model we have used has removed anyARCH effects. PRU.L has a p-value = 0.007 at a lag of 5 which would suggest at the 5%significance level we reject the null of no ARCH effects. In general there is not a lot we can doto remove this, it is a consequence of the data. From a general view point the vast majority ofthe data suggest the models fitted have removed all ARCH effects.

The last test performed was the sign bias test. This includes the Sign Bias test (SB), NegativeSize Bias test (NSB), Positive Size Bias test (PSB) and Joint Effect test (JE). We conduct thesetests to detect leverage or asymmetrical effects, after the model has been fitted. Again all of thecompanies exhibited large p-values indicating that the null hypothesises are not rejected andtheir is sufficient evidence to suggest the absence of leverage effects.

Thus, after fitting the different time series models to our data, we deduce from the abovediscussed tests that we obtain standardized model residuals that are independent and show noserial autocorrelation. Additionally, we conclude the absence of ARCH-effects and asymmetriceffects amongst the residuals.

We now move onto transforming the residuals using their underlying distribution to beuniformly distributed.

48

Page 53: 9.8.15.thesis

Company

Lju

ng

Box

Test

Standard

Lju

ng

Box

Test

Standard

Squared

ARCH

-LM

Test

Sig

nBia

sTest

lag

12

51

59

35

7SB

NSB

PSB

JE

HSBA.L

test

stat.

0.316

0.368

0.915

0.037

0.747

2.904

0.000

1.535

2.797

0.527

0.991

0.154

1.010

p-valu

e0.574

0.759

0.879

0.847

0.914

0.775

0.991

0.583

0.553

0.599

0.323

0.878

0.799

LLOY.L

test

stat.

0.048

0.562

1.028

0.063

1.251

2.075

0.442

0.510

0.774

0.751

0.839

1.578

3.631

p-valu

e0.827

0.665

0.853

0.802

0.801

0.896

0.506

0.881

0.947

0.454

0.402

0.116

0.304

BARC.L

test

stat.

0.132

1.183

2.634

0.086

4.738

7.929

0.043

6.230

6.944

0.248

0.045

0.192

0.071

p-valu

e0.717

0.443

0.478

0.769

0.175

0.133

0.836

0.053

0.089

0.805

0.964

0.848

0.995

STAN.L

test

stat.

2.240

2.941

4.026

0.324

2.139

4.272

2.142

3.116

4.517

0.798

0.303

0.889

0.983

p-valu

e0.135

0.146

0.251

0.569

0.586

0.543

0.143

0.273

0.278

0.426

0.762

0.375

0.805

PRU.L

test

stat.

0.080

1.922

4.528

0.670

6.007

9.537

1.624

10.012

10.711

0.414

0.522

1.437

2.339

p-valu

e0.778

0.241

0.153

0.413

0.090

0.063

0.203

0.007

0.013

0.679

0.602

0.152

0.505

OM

L.L

test

stat.

4.692

5.360

6.312

0.853

3.398

4.802

0.518

1.251

2.115

0.064

1.372

0.379

3.608

p-valu

e0.030

0.033

0.076

0.356

0.339

0.459

0.472

0.660

0.693

0.949

0.171

0.705

0.307

lag

15

91

59

35

7SB

NSB

PSB

JE

LGEN.L

test

stat.

0.021

0.380

1.072

0.570

3.743

6.335

0.429

6.177

7.004

0.725

0.174

1.255

1.607

p-valu

e0.884

1.000

1.000

0.450

0.288

0.262

0.512

0.055

0.087

0.469

0.862

0.211

0.658

AV.L

test

stat.

0.059

2.032

4.030

0.022

3.748

5.779

0.142

4.169

4.505

1.575

0.264

0.878

2.787

p-valu

e0.808

0.952

0.684

0.883

0.287

0.324

0.707

0.159

0.280

0.117

0.792

0.381

0.426

Tab

le5:

Sta

nd

ard

ised

Res

idu

alD

iagn

osti

csfo

ral

lco

mp

anie

s

49

Page 54: 9.8.15.thesis

We are almost done, as previously discussed, before we move onto copula model constructionswe need our marginal distributions of our residuals to belong to [0,1]. To achieve this we use theprobability integral transformation.

What is probability integral transformation?Essentially what we are doing is applying the cumulative distribution function of thestandardised residual distribution (selected from ’Distribution of the Zt’s )to the eightcompanies and the end result is values ∈ [0, 1]. The methodology looks as follows:

Let our standardised residuals from our fitted time series model be (Zi,t)t=1,...,253 which belongto one of the following distributions: normal, t-student, generalised error distribution etc. Thenwe have for our eight institutions

Ui,t = F (Zi,t), i = 1, ..., 8 & t = 1, ..., 253 =⇒ Ui,t ∼ Uniform[0, 1]

Where F the cumulative distribution function, is selected depending on the outcome of theGARCH modelling process, the distribution which yields the best goodness-of-fit results will bechosen. See Hendrich [2012] for further information. If we look at the plots in Appendix A -

Histograms of Copula Data, we can see the data transformation to copula data, distributed on[0,1]. Going forward we now use this as our underlying data sample to conduct all the necessaryprocedures and tests of dependence. The first thing we do is look at the basic measures ofassociation discussed in section 3.2. We now look to analyse the Kendall τ and Spearman ρmatrices for both 2008 and 2009.

Figure 19: 2008 and 2009 respectively Kendall τ Matrices

Looking at figure 19 - Kendall tau matrix, gives us our first indication of any dependencebetween the institutions. As was described in section 3.2 Kendall’s tau in our case is a measure

50

Page 55: 9.8.15.thesis

of co-movements of increases and decreases in return. We can see in 2008 all entries to thematrix are positive indicating there is some form of dependence between all pairs of institutions.At the end of the rows we have installed the collective sum of the row entries as a measure ofcomparisons with 2009 data. The cells highlighted in red are also used for comparative reasonsas they indicate all values ∈ [0.5, 0.9]. There appears to be multiple entries between thisinterval, the highest degree of dependence coming from PRU.L at 0.628 with AV.L, PRU.L alsohas high dependence relations with three other institutions. If we now cross examine both tablesfrom 2008 to 2009, we can see that there is a significant drop in the numbers of cells withdependence measures belonging to [0.5,0.9]. This can also be seen generally from the totalKendall tau value for each matrix, a drop from 34.516 to 30.568. So our first sample of evidencesuggests that the dependence between these institutions was not as strong in 2009.

Figure 20: 2008 and 2009 respectively Spearman’s ρ Matrices

Looking at figure 20 we look at the Spearman’s rho matrix for both, 2008 and 2009. Spearman’srho being the alternative measure for dependence. Whilst the absolute values are larger in thematrix compared to Kendall’s tau, the results are the same. Going from 2008 to 2009 there is asignificant drop in total dependence between our institutions. We again compare the number ofcells highlighted in red (pairs belonging to interval [0.7,0.9]) we can see a dramatic drop and thetotal Spearman value drops from 44.191 to 39.886.In order to try and give a graphical interpretation we are going to illustrate the dependencethrough distance on a two-dimensional space via the theory discussed on multidimensionalscaling (section 3.2), in particular we use Kruskal-Shephard scaling method to calculate and plotpoints exhibiting dependence. Naturally we have plotted the data for both 2008 and 2009 tocompare. See figure 21 and figure 22 over the next couple of pages.

51

Page 56: 9.8.15.thesis

Fig

ure

21:

2008

Plo

tof

the

inst

itu

tion

sn

ames

afte

rap

ply

ing

mu

ltid

imen

sion

alsc

alin

gon

the

emp

iric

al

valu

esof

Ken

dall

sta

u

52

Page 57: 9.8.15.thesis

Fig

ure

22:

2009

Plo

tof

the

inst

itu

tion

sn

ames

afte

rap

ply

ing

mu

ltid

imen

sion

alsc

alin

gon

the

emp

iric

al

valu

esof

Ken

dall

sta

u

53

Page 58: 9.8.15.thesis

Firstly analysing figure 21 we can see that there seems to be a rough divide between the banksand the insurance companies. PRU.L seems to have a central position amongst all theinstitutions particularly BARC.L, AV.L and HSBA.L. Which if you look back to the Kendallmatrix you will see these pairs all highlighted in red, indicating there comparatively higher levelof dependence compared to the remaining institutions. PRU.L having the highest measure ofKendall tau is represented by its central position within the plot. The observations will play acritical role for the determination of the root nodes in the pairwise copula tree construction inthe next section.

The insurance companies as a whole seem to be clustered together a lot closer than the bankswith the three other insurance companies all surrounding AV.L in a circular form. This wouldimply the dependence to AV.L is similar for the remaining insurance companies as theirdistances are appropriately equidistant. The last point to notice is that there seems to be a treeof dependence where by PRU.L has a high level of dependence with AV.L. Then AV.L is in turnseems to have a high level of dependence on OML.L and LGEN.L. Again I would expect this tobe visible later on in the vine copula construction.

Moving onto the banks we can not see the same clustering as the insurance companies. Insteadwe see two pairs of institutions with a significant level of dependence between them. STAN.Lwith HSBA.L and finally LLOY.L with BARC.L. These two relationships are separated byHSBA.L and BARC.L by quite a large distance, implying a small level of dependence.Compared to the insurance companies where we saw much more of a nested dependence patternthe banks as a group seem to be more unrelated.

When we now compare our system of institutional dependence through the 2008 and 2009graphs we notice some interesting characteristics. The structure between the banks and theinsurance companies has not changed significantly. However, the distances between theinstitutions has dropped, this is shown by the increase in distance and positions around thegraph. So a year on from 2008 the only significant different appears to be in the level ofdependence represented by the larger distances between the institutions within the plot.

To summarise the Kendall measures for the system we constructed a simple table which ordersthe companies by the sum of their pairwise dependence measures with all the institutions (sumof the individual Kendall matrix rows). We did this for 2008 and 2009 data, respectively to givethe comparative oversight. Please see our results below:

Figure 23: Kendall’s Order Tau Values Table - 2008 & 2009 Data, Respectively

54

Page 59: 9.8.15.thesis

From 2008 to 2009 not only has there been a decrease in the aggregate dependence measure butthe leading dependable institutions seems to have changed. In 2008 the top half consisted offtwo insurance companies and two banks, respectively. Going into 2009 we see a reshuffle, thetop half dependable institutions are now three insurance companies and one bank.

Just to summarise these initial findings:

• From 2008 to 2009 we see a drop in the total measure of dependence between the financialsystem.

• The overall nested structure for the banks and the insurances companies as two groupsdoes not change significantly from 2008 to 2009.

• The insurance companies seem to have a more interlinked nested structure compared tothe banks.

• Prudential seems to be the most dependable institution during 2008 and 2009.

• Going from 2008 to 2009 the insurance companies seem to become more dependable in thefinancial system as a whole.

As we said in our questions we are making the comparison of these two specific time horizons sowe can look for a relationship between the GDP % change and the dependence size andstructure between within the financial system.What we have seen so far seems to support our ideology that dependence between financialinstitutions seems to decrease as the economy is deemed to be growing and recovering. However,we now apply the copula techniques discussed in section 3.3 onwards to investigate thispostulation further.

55

Page 60: 9.8.15.thesis

4.2 Constructing the Vine Copulae

Now that we have ascertained the copula data and calculated some basic dependency measures,we are in a position to begin the construction of the vine copula models.

For this section we will implement the theory discussed in section 3.3 and 3.4. As we arecomparing two different samples we will concentrate on the C- & R-Vine copula models. AsD-vine model has a basic structure it has little flexibility in its modelling so we omit it in thisapplication. We begin by illustrating some basic plots to help us understand the data formatand characteristics. We then look to outline the procedure undertaken to fit the vine copulagraphs, this includes: finding an appropriate pairwise decomposition structure given Kendall tauvalues, fitting applicable copula functions and calculating the respective parameters and finallyevaluating the final fitted models.

The end results of this section will provide a premise in which to perform simulation which willconclude our application. As we know from the theory discussed in section 3.4 and 3.5 the vinecopula models are the foundation on which we run the simulation. The dependencyrelationships highlighted in the vine copula models will be used in the simulation to test acatastrophe share price drop.

Before we detail the fitting procedure below we recommend the reader reviews figure 32 inAppendix B - Vine Copula Modelling. This scatter and contour matrix plot gives an illustrationof the copula data characteristics. Should the reader wish to manually select a copula functionthrough graphical analysis this would be the graph necessary to do so, referring back to section3.3, where different contour plots were used to match different copula functions.

Fitting Procedure The following procedure is applied to the copula data we obtained fromthe previous section 4.1. We follow the theory outlined in section 3.4 - Vine Model SelectionProcess. This applies to both C- & R-Vine models:

1. To begin with we need to ascertain the structure of the vine copula decomposition. As wepreviously discussed, this is done sequentially depending on the size of the institutionstotal Kendall tau value, see equation 3.24 and theory surrounding it. The R-functionRVineStructureSelect does this in an automated fashion and returns a matrix see figure24 for a demonstration.

2. For point three we combine part (ii) and (iii) of the method section since R-software doesboth of these steps in one function. Now that we have the decomposition structure weneed to select the copula functions and parameter estimates to best fit the data. This isdone via the RVineStructureSelect function in R which returns the copula functionsselected and their respective parameter estimates. We chose the selection criteria for thegoodness of fit to be the AIC criteria. Figure 25, 26 & 27 show this respectively. Figure 26& 27 show the parameters for the copulas. Figure 27 is needed for the copulas whichrequire two parameters. To see additional copula functions are not referenced in figure 25please see E. Brechmann and U. Schepsmeier [2013]

3. Final step is to conduct some form of evaluation, we have used the AIC, BIC and Loglikelihood values to give us an indication of the best suited model. To compare two models

56

Page 61: 9.8.15.thesis

we can make use of the Vuong test. We use the following R-functions to conduct thesetests: RVineAIC,RVineBIC,RVineLogLik & RVineVuongTest. Table 6 and 7 belowillustrate the values we obtained. We are only looking at one model for the C- & R-Vineas the purpose of this thesis is not to look at multiple model comparisons. But to look atcomparisons of 2008 and 2009 data. However, it is advised that the reader tries multiplemodel alternatives if they believe a better fitting model will be obtained. We haveillustrated the C- & R-Vine comparison as an example for the reader.

NB: When reading the matrices going forward please remember that going from onematrix to another there is a 1 to 1 mapping so each element in the matrix corresponds tothe same element in the next matrix. There is no change in order of the random variables.Structure is always (x1, x2, x3, x4, x5, x6, x7, x8) crossed with (x1, x2, x3, x4, x5, x6, x7, x8).

57

Page 62: 9.8.15.thesis

Key for figure 24:The institution are numbered in the matrix below as follows: 1 = HSBC, 2 = Lloyds, 3 =Barclays, 4 = Standard Chartered, 5 = Prudential, 6 = Legal & General, 7 = Aviva &8 = Old Mutual.

2 0 0 0 0 0 0 08 4 0 0 0 0 0 04 8 6 0 0 0 0 06 6 8 1 0 0 0 01 1 1 8 7 0 0 07 7 7 7 8 3 0 03 3 3 3 3 8 8 05 5 5 5 5 5 5 5

Figure 24: 2008: C-Vine Copula Decomposition Matrix Structure

Key for figure 25:The numbers in the matrix below reference the following copula functions:1 = Gaussian copula. 2 = t − copula. 3 = Clayton copula. 4 = Gumbel copula.5 = Frank copula. 10 = BB8 copula. 16 = Rotated Joe copula (180 degrees; survival Joe).17 = Rotated BB1 copula(180 degrees; survival BB1). 104 = Tawn type 1 copula. 114 =Rotated Tawn type 1 copula (180 degrees).

0 0 0 0 0 0 0 016 0 0 0 0 0 0 05 104 0 0 0 0 0 05 5 3 0 0 0 0 05 5 114 1 0 0 0 05 4 5 5 2 0 0 04 4 5 1 4 2 0 02 1 17 17 1 17 10 0

Figure 25: 2008: C-Vine Copula Family Matrix

58

Page 63: 9.8.15.thesis

1.055768 0 0 0 0 0 0 00.5588021 2.0305519 0 0 0 0 0 00.4265558 −0.4804512 0.1903177 0 0 0 0 01.0943743 2.006221 1.757894 0.2303689 0 0 0 00.2741298 1.2148185 2.5270921 0.8745599 0.3811219 0 0 01.518809 1.3195561 2.271223 0.3686091 1.1700034 0.3418016 0 00.683807 0.709726 0.6037515 0.7863233 0.8345743 0.5148141 3.503026 0

Figure 26: 2008: C-Vine Copula Parameter Values Matrix

0 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0.03563586 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0.06907585 0 0 0 0 00 0 0 0 6.633071 0 0 00 0 0 0 0 8.32729 0 0

4.551004 0 1.47742189 1.442398 0 1.591281 0.894044 0

Figure 27: 2008: C-Vine Copula Parameter Values Matrix

Now that we have our model and parameter outline we can produce some goodness-of-fit figures.From step three we produce the following results for our C- & R-vine models:

AIC BIC log Likelihood

C-Vine -1685 -1554 880

R-Vine -1689 -1573 878

Table 6: 2008: Model evaluation criteria C- & R-Vine

Test Statistic Test Statistic AIC p-value AIC p-value

C- vs R-Vine 0.208 -0.218 0.835 0.827

Table 7: 2008: Vuong test C- vs R-Vine

We can see that the R-Vine model seems to have a better goodness-of-fit but this should notcome as a surprise. As the R-Vine has no restrictions in terms of the density decompositionunlike the C-Vine model. Thus the R-Software is trying out the best decomposition in order tofind the smallest AIC and Log likelihood values.With the model specifics calculated R-Software can now produce graphical representations ofthe dependence structures. In Figure 28 28 and figure 29 below we have chosen to illustrate thefirst tree for the R& C-Vine, for each figure we compare the two time horizons. The rational forselecting the 1st tree is it contains the majority of the dependence information. As you move

59

Page 64: 9.8.15.thesis

down the tree structure you lose more and more of the dependence information. See AppendixB.2 and B.3.

Figure 28: C-Vine Graph Tree 1 - 2008 & 2009, Respectively

Figure 29: R-Vine Graph Tree 1 - 2008 & 2009, Respectively

NEED TO ADD THE R-VINE MATRIX FOR FAMILIES OF DECOMPOSITION, COPULASAND PARAMETERS.

60

Page 65: 9.8.15.thesis

4.3 The Vine Copula Simulation

In the last section we looked at modelling the dependence between the financial institutions withR- and C-Vine copulas. Now that we have a structure we can look to see what would happen tothe system as a whole given one institution performs badly. By perform badly, I specifically meana sharp drop in share value, we represent this by giving the chosen company a value of xi+ = 0.1which represents a value in the lower left hand side of the [0,1]x[0,1] grid.

61

Page 66: 9.8.15.thesis

Bank Simulation Plots: 2008 vs 2009

Figure 30: HSBC: 2008 vs 2009

Figure 31: Lloyds: 2008 vs 2009

Figure 32: Barclays: 2008 vs 2009

Figure 33: Standard Chartered: 2008 vs 2009

62

Page 67: 9.8.15.thesis

Insurance Simulation Plots: 2008 vs 2009

Figure 34: Prudential: 2008 vs 2009

Figure 35: Legal & General: 2008 vs 2009

Figure 36: AVIVA: 2008 vs 2009

Figure 37: Old Mutual: 2008 vs 2009

63

Page 68: 9.8.15.thesis

5 Conclusion

64

Page 69: 9.8.15.thesis

A Additional figures - Time Series Modelling

Log return data: 2008

65

Page 70: 9.8.15.thesis

QQ-Plots, Empirical Density of Standardized Residuals and Residual Plots:2008

Figure 38: HSBA.L plots 2008

Figure 39: LLOY.L plots 2008

Figure 40: BARC.L plots 2008

Figure 41: STAN.L plots 2008

66

Page 71: 9.8.15.thesis

Figure 42: PRU.L plots 2008

Figure 43: LGEN.L plots 2008

Figure 44: AV.L plots 2008

Figure 45: OML.L plots 2008

67

Page 72: 9.8.15.thesis

Histograms of Copula Data: 2008

68

Page 73: 9.8.15.thesis

B Additional figures - Vine Copula Modelling

B.1 Scatter and Contour Matrix of Full Copula Data Set: 2008

Figure 46: Scatter and Contour Plot Matrix for the Copula Data: 2008

69

Page 74: 9.8.15.thesis

B.2 R-Vine Copula Decomposition, Copula Selection and Parameter Matrices

The institution are numbered in the matrix below as follows: 1 = HSBC, 2 = Lloyds, 3 =Barclays, 4 = Standard Chartered, 5 = Prudential, 6 = Legal & General, 7 = Aviva &8 = Old Mutual.

2 0 0 0 0 0 0 08 1 0 0 0 0 0 06 8 3 0 0 0 0 07 6 8 4 0 0 0 01 7 6 8 5 0 0 04 3 7 6 8 6 0 05 4 4 7 6 8 8 03 5 5 5 7 7 7 7

Figure 47: 2008: R-Vine Copula Decomposition Matrix Structure

The numbers in the matrix below reference the following copula functions:1 = Gaussian copula3 = Clayton copula4 = Gumbel copula5 = Frank copula10 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = Rotated Joe copula (180 degrees; survival Joe)17 = Rotated BB1 copula(180 degrees; survival BB1)214 = rotated Tawn type 2 copula (180 degrees)

0 0 0 0 0 0 0 0214 0 0 0 0 0 0 03 5 0 0 0 0 0 01 214 14 0 0 0 0 05 5 5 13 0 0 0 013 3 5 1 13 0 0 04 4 4 4 16 14 0 01 17 17 1 1 4 10 0

Figure 48: 2008: R-Vine Copula Parameter Selection Matrix

70

Page 75: 9.8.15.thesis

0 0 0 0 0 0 01.28760096 0 0 0 0 0 00.04211339 1.0463272 0 0 0 0 0−0.03922405 1.4321909 1.1344997 0 0 0 01.02200243 0.4752089 1.6950371 0.22972324 0 0 00.14816364 0.3088555 0.7837185 0.02639058 0.1802896 0 01.22338516 1.4130838 1.3195561 1.30874031 1.2171701 1.168167 0

Figure 49: 2008: R-Vine Copula Parameter One Values Matrix

0 0 0 0 0 0 0 00.01750423 0 0 0 0 0 0 0

0 0 0 0 0 0 0 00 0.09202863 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 00 1.4423981 1.591281 0 0 0 0.8122436 0

Figure 50: 2008: R-Vine Copula Parameter Two Values Matrix

B.3 Remaining Vine Tree Comparisons C-Vines

Figure 51: C-Vine Graph Tree 2 - 2008 & 2009, Respectively

71

Page 76: 9.8.15.thesis

Figure 52: C-Vine Graph Tree 3 - 2008 & 2009, Respectively

Figure 53: C-Vine Graph Tree 4 - 2008 & 2009, Respectively

72

Page 77: 9.8.15.thesis

Figure 54: C-Vine Graph Tree 5 - 2008 & 2009, Respectively

Figure 55: C-Vine Graph Tree 6 - 2008 & 2009, Respectively

73

Page 78: 9.8.15.thesis

Figure 56: C-Vine Graph Tree 7 - 2008 & 2009, Respectively

B.4 Remaining R-Vine Tree Comparisons

Figure 57: R-Vine Graph Tree 2 - 2008 & 2009, Respectively

74

Page 79: 9.8.15.thesis

Figure 58: R-Vine Graph Tree 3 - 2008 & 2009, Respectively

Figure 59: R-Vine Graph Tree 4 - 2008 & 2009, Respectively

75

Page 80: 9.8.15.thesis

Figure 60: R-Vine Graph Tree 5 - 2008 & 2009, Respectively

Figure 61: R-Vine Graph Tree 6 - 2008 & 2009, Respectively

76

Page 81: 9.8.15.thesis

Figure 62: R-Vine Graph Tree 7 - 2008 & 2009, Respectively

77

Page 82: 9.8.15.thesis

C R-code

C.1 Fitting GARCH Models and Preparing Copula Data - 2008 Data

require(rugarch)

require(forecast)

require(fGarch)

require(VineCopula)

require(CDVine)

require(MASS)

#input of data - logreturn

logreturn = read.csv("~/Documents/MSc/Thesis/rcode/logreturn.08.csv")

#individual stocks - raw

hsba = ts(logreturn[,2], start=1);

lloy = ts(logreturn[,3], start=1);

barc = ts(logreturn[,4], start=1);

stan = ts(logreturn[,5], start=1);

pru = ts(logreturn[,6], start=1);

lgen = ts(logreturn[,7], start=1);

av = ts(logreturn[,8], start=1);

oml = ts(logreturn[,9], start=1);

###ARMA-GARCH MODELS

###Garch Models

#####*******BANKS***********############

#HSBA.L Model - std (NO in-Mean)

argarch.hsba.std = ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(0,0), include.mean = F,archm=F, archpow=1), distribution.model="std")

fit.hsba = ugarchfit(argarch.hsba.std, data=hsba)

#LLOY.L Model - std (in-mean NO)

argarch.lloy.ged = ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(0,0), include.mean = T,archm=F, archpow=1), distribution.model="ged")

fit.lloy = ugarchfit(argarch.lloy.ged, data=lloy)

#BARC.L Model - std(in-mean NO)

argarch.barc.std = ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(0,0), include.mean = F,archm=F, archpow=1), distribution.model="std")

fit.barc = ugarchfit(argarch.barc.std, data=barc)

#STAN.L Model - norm (in-mean NO)

argarch.stan.norm = ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(0,0), include.mean = F, archm=F, archpow=1), distribution.model="norm")

fit.stan = ugarchfit(argarch.stan.norm, data=stan)

#####*******INSRUANCE***********############

#PRU.L Model - In-Mean NO and SGED

argarch.pru.sged = ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(0,1), include.mean = T,archm=F, archpow=1), distribution.model="sged")

fit.pru = ugarchfit(argarch.pru.sged, data=pru)

#LGEN.L Model - (No In-mean) STD - student t

argarch.lgen.std = ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(1,1), include.mean = F,archm=F, archpow=1), distribution.model="std")

fit.lgen = ugarchfit(argarch.lgen.std, data=lgen)

78

Page 83: 9.8.15.thesis

#AV.L Model - IN-Mean NO NORM

argarch.av.norm = ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(1,1), include.mean = F,archm=F, archpow=1), distribution.model="norm")

fit.av = ugarchfit(argarch.av.norm, data=av)

#OML.L Model - (IN-MEAN NO) Norm

argarch.oml.norm = ugarchspec(variance.model=list(model="csGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(0,0), include.mean = F,archm=F, archpow=1), distribution.model="norm")

fit.oml = ugarchfit(argarch.oml.norm , data=oml)

###INNOVATIONS - Probability Integral Transformation

#####*******BANKS***********############

#HSBA.L Innovations to U[0,1] -

hsba.in = fit.hsba@fit$z

hsba.U = pdist(distribution = "std", hsba.in, shape = 5.14947)

#LLOY.L Innovations to U[0,1]

lloy.in = fit.lloy@fit$z

lloy.U = pdist(distribution = "ged", lloy.in, shape = 1.417607 )

#BARC.L Innovations to U[0,1]

barc.in = fit.barc@fit$z

barc.U = pdist(distribution = "std", barc.in, shape = 9.124920 )

#STAN.L Innovations to U[0,1]

stan.in = fit.stan@fit$z

stan.U = pdist(distribution = "norm", stan.in )

#####**********INSURANCE COMPANIES*************############

#PRU.L Innovations to U[0,1]

pru.in = fit.pru@fit$z

pru.U = pdist(distribution = "sged", pru.in, skew = 0.974901 , shape = 1.436649 )

#LGEN.L Innovations to U[0,1]

lgen.in = fit.lgen@fit$z

lgen.U = pdist(distribution = "std", lgen.in, shape = 5.58901 )

#AV.L Innovations to U[0,1]

av.in = fit.av@fit$z

av.U = pdist(distribution = "norm", av.in)

#OML.L Innovations to U[0,1] - Is shape too large?

oml.in = fit.oml@fit$z

oml.U = pdist(distribution = "norm", oml.in )

####Innovation Histrograms

par(mfrow=c(4,2))

hist(hsba.U)

hist(lloy.U)

hist(barc.U)

hist(stan.U)

hist(pru.U)

79

Page 84: 9.8.15.thesis

hist(lgen.U)

hist(av.U)

hist(oml.U)

########Residual plots

par(mfrow=c(1,1))

plot(fit.hsba@fit$z, ylim=c(-4,4))

abline(h=2, col=’Red’)

abline(h = -2, col=’Red’)

plot(fit.lloy@fit$z, ylim=c(-4,4))

abline(h=2, col=’Red’)

abline(h = -2, col=’Red’)

plot(fit.barc@fit$z, ylim=c(-4,4))

abline(h=2, col=’Red’)

abline(h = -2, col=’Red’)

plot(fit.stan@fit$z, ylim=c(-4,4))

abline(h=2, col=’Red’)

abline(h = -2, col=’Red’)

plot(fit.pru@fit$z, ylim=c(-4,4))

abline(h=2, col=’Red’)

abline(h = -2, col=’Red’)

plot(fit.lgen@fit$z, ylim=c(-4,4))

abline(h=2, col=’Red’)

abline(h = -2, col=’Red’)

plot(fit.av@fit$z, ylim=c(-4,4))

abline(h=2, col=’Red’)

abline(h = -2, col=’Red’)

plot(fit.oml@fit$z, ylim=c(-4,4))

abline(h=2, col=’Red’)

abline(h = -2, col=’Red’)

#####QQ-Plots

#####MEASURES OF ASSOCIATION KENDAL AND SPEARMEN

#####Kendall tau

combUB = cbind(hsba.U,lloy.U,barc.U,stan.U)

combUI = cbind(pru.U,lgen.U,av.U,oml.U)

pairs(combUB)

pairs(combUI)

combAll = cbind(hsba.U,lloy.U,barc.U,stan.U,pru.U,lgen.U,av.U,oml.U)

ktau = cor(combAll, method="kendall", use="pairwise")

ktau

sumrows = cbind(sum(ktau[1,]), sum(ktau[2,]),sum(ktau[3,]),sum(ktau[4,]),

sum(ktau[5,]),sum(ktau[6,]),sum(ktau[7,]),sum(ktau[8,]))

print(sumrows)

sort(sumrows, decreasing = FALSE)

80

Page 85: 9.8.15.thesis

#####Spearmans tau

stau = cor(combAll, method="spearman", use="pairwise")

stau

sumrows = cbind(sum(stau[1,]), sum(stau[2,]),sum(stau[3,]),sum(stau[4,]),

sum(stau[5,]),sum(stau[6,]),sum(stau[7,]),sum(stau[8,]))

##Kruskal-Shephard scaling method

## dissimalrity matrix

d = 1- ktau

#####The pairwise plot

d.mds = isoMDS(d)

d.mds

par(mfrow=c(1,1))

plot(d.mds$points, type = "n", xlim=c(-.7,.6), xlab="",ylab="")

text(d.mds$points, labels = row.names(d[1:8,]))

#####Scatter abd Contour Matrix

#####All plots

panel.contour <- function(x, y, bw=2, size=100)

usr <- par("usr")

on.exit(par(usr))

par(usr = c(-3,3,-3,3), new=TRUE)

BiCopMetaContour(x, y, bw, size, axes=FALSE)

pairs(combAll, lower.panel=panel.contour, gap=0)

#####banks plots

panel.contour <- function(x, y, bw=2, size=100)

usr <- par("usr")

on.exit(par(usr))

par(usr = c(-3,3,-3,3), new=TRUE)

BiCopMetaContour(x, y, bw, size, axes=FALSE)

pairs(combUB, lower.panel=panel.contour, gap=0)

#####Insurance plots

panel.contour <- function(x, y, bw=2, size=100)

usr <- par("usr")

on.exit(par(usr))

par(usr = c(-3,3,-3,3), new=TRUE)

BiCopMetaContour(x, y, bw, size, axes=FALSE)

pairs(combUI, lower.panel=panel.contour, gap=0)

81

Page 86: 9.8.15.thesis

###Vine Copula Construction

####CVines

##Determine C-Vine Structure sequentially

C.Struc = RVineStructureSelect(combAll, familyset = NA, type = 1,

selectioncrit = "AIC", indeptest = FALSE,

level = 0.05, trunclevel = NA,

progress = FALSE, weights = NA)

C.Struc

#Selecting copula families and parameter estimation

C.Mod = RVineCopSelect(combAll, familyset = NA, C.Struc$Matrix, selectioncrit = "AIC",

indeptest = FALSE, level = 0.05, trunclevel = NA)

C.Mod

#RVM defined

C.RVM = RVineMatrix(C.Struc$Matrix, C.Mod$family,

C.Mod$par,

C.Mod$par2, names=c(’hsba’,’lloy’,’barc’,’stan’,’pru’,’lgen’,’av’,’oml’))

C.RVM

##plot

RVineTreePlot(data = combAll, C.RVM, method = "mle", max.df = 30,

max.BB = list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1)),

tree = "ALL", edge.labels = c("emptau"), P = NULL)

#### R-Vine

##Determine R-Vine Structure sequentially

R.Struc = RVineStructureSelect(combAll, familyset = NA, type = 0,

selectioncrit = "AIC", indeptest = FALSE,

level = 0.05, trunclevel = NA,

progress = FALSE, weights = NA)

R.Struc

#Selecting copula families and parameter estimation

R.Mod = RVineCopSelect(combAll, familyset = NA, R.Struc$Matrix, selectioncrit = "AIC",

indeptest = FALSE, level = 0.05, trunclevel = NA)

R.Mod

#RVM defined

RVM = RVineMatrix(R.Struc$Matrix, R.Mod$family,

R.Mod$par,

R.Mod$par2, names=c(’hsba’,’lloy’,’barc’,’stan’,’pru’,’lgen’,’av’,’oml’))

RVM

##plot

RVineTreePlot(data = combAll, RVM, method = "mle", max.df = 30,

max.BB = list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1)),

tree = "ALL", edge.labels = c("emptau"), P = NULL)

82

Page 87: 9.8.15.thesis

#####GOF TESTS for Cop Models

####C-VIne

RVineAIC(combAll, C.RVM, par = C.RVM$par, par2 = C.RVM$par2)

RVineBIC(combAll, C.RVM, par = C.RVM$par, par2 = C.RVM$par2)

clog = RVineLogLik(combAll, C.RVM, par = C.RVM$par, par2 = C.RVM$par2)

sum(clog$loglik)

RVineMLE(data, C.RVM, start = C.RVM$par, start2 = C.RVM$par2)

RVineVuongTest(combAll, C.RVM, R.RVM)

###R-Vine

RVineAIC(combAll, RVM, par = RVM$par, par2 = RVM$par2)

RVineBIC(combAll, RVM, par = RVM$par, par2 = RVM$par2)

rlog = RVineLogLik(combAll, RVM, par = RVM$par, par2 = RVM$par2)

sum(rlog$loglik)

RVineMLE(data, RVM, start = RVM$par, start2 = RVM$par2,

maxit = 200, max.df = 30,

max.BB = list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1)))

RVineVuongTest(combAll, C.RVM, RVM)

#####AUTO-ARIMA

auto.arima(hsba, d=0, trace=T)

auto.arima(lloy, d=0, trace=T)

auto.arima(barc, d=0, trace=T)

auto.arima(stan, d=0, trace=T)

auto.arima(pru, d=0, trace=T)

auto.arima(lgen, d=0, trace=T)

auto.arima(av, d=0, trace=T)

###Garch Models Plots

show(fit.hsba)

show(fit.lloy)

show(fit.barc)

show(fit.stan)

show(fit.pru)

show(fit.lgen)

show(fit.av)

show(fit.oml)

#####*******BANKS***********############

plot(fit.hsba)

plot(fit.lloy)

plot(fit.barc)

plot(fit.stan)

#####**********INSURANCE COMPANIES*************############

plot(fit.pru)

plot(fit.lgen)

83

Page 88: 9.8.15.thesis

plot(fit.av)

plot(fit.oml)

C.2 Example Simulation Code X1 = HSBC Specific - 2008 Data

require(VineCopula)

C.Mod$family

C.Mod$par

C.Mod$par2

x22 = NULL

x33 = NULL

x44 = NULL

x55 = NULL

x66 = NULL

x77 = NULL

x88 = NULL

for (i in 1:1500)

x = runif(7, min = 0, max = 1)

w2 = x[1]

w3 = x[2]

w4 = x[3]

w5 = x[4]

w6 = x[5]

w7 = x[6]

w8 = x[7]

x1 = 0.1

#(1)

x1

#(2)

x2 = hinv.16.u(w2,x1,C.Mod$par[2,1])

m = BiCopHfunc(x1,x2, family = 16, C.Mod$par[2,1])$hfunc1

#(3)

y1 = hinv.104.u(w3,BiCopHfunc(x1,x2,family = 16, C.Mod$par[2,1])$hfunc1, C.Mod$par[3,2],C.Mod$par2[3,2],par3)

x3 = hinv.16.u(y1,x1, C.Mod$par[2,1])

#(4)

y2 = BiCopHfunc(BiCopHfunc(x1,x3,family = 5, C.Mod$par[3,1])$hfunc1, m, family = 104, C.Mod$par[3,2], C.Mod$par2[3,2])$hfunc1

y3 = hinv.3.u(w4, y2, C.Mod$par[4,3])

y4 = hinv.5.u(y3,m, C.Mod$par[4,2])

x4 = hinv.5.u(y4, x1, C.Mod$par[4,1])

#(5)

y5 = BiCopHfunc(y2,y3,family = 3, C.Mod$par[4,3])$hfunc1

y6 = hinv.1.u(w5,y5,C.Mod$par[5,4])

y7 = hinv.114.u(y6, y3, C.Mod$par[5,3],C.Mod$par2[5,3],par3)

84

Page 89: 9.8.15.thesis

y8 = hinv.5.u(y7, m, C.Mod$par[5,2])

x5 = hinv.5.u(y8, x1, C.Mod$par[5,1])

#(6)

y9 = BiCopHfunc(y5, y6,family =1 ,C.Mod$par[5,4])$hfunc1

y10 = hinv.2.u(w6,y9,C.Mod$par[6,5],C.Mod$par2[6,5])

y11 = hinv.5.u(y10, y6, C.Mod$par[6,4])

y12 = hinv.5.u(y11, y3, C.Mod$par[6,3])

y13 = hinv.4.u(y12, m, C.Mod$par[6,2])

x6 = hinv.5.u(y13, x1, C.Mod$par[6,1])

#(7)

y14 = BiCopHfunc(y9, y10,family = 2,C.Mod$par[6,5],C.Mod$par2[6,5])$hfunc1

y15 = hinv.2.u(w7,y14,C.Mod$par[7,6], C.Mod$par2[7,6])

y16 = hinv.4.u(y15,y9,C.Mod$par[7,5])

y17 = hinv.1.u(y16, y6, C.Mod$par[7,4])

y18 = hinv.5.u(y17, y3, C.Mod$par[7,3])

y19 = hinv.4.u(y18, m, C.Mod$par[7,2])

x7 = hinv.4.u(y19, x1, C.Mod$par[7,1])

#(8)

y20 = BiCopHfunc(y14, y15,family = 2 ,C.Mod$par[7,6],C.Mod$par2[7,6])$hfunc1

y21 = hinv.10.u(w8,y20,C.Mod$par[8,7], C.Mod$par2[8,7])

y22 = hinv.17.u(y21,y14,C.Mod$par[8,6], C.Mod$par2[8,6])

y23 = hinv.1.u(y22,y9,C.Mod$par[8,5])

y24 = hinv.17.u(y23, y6, C.Mod$par[8,4], C.Mod$par2[8,4])

y25 = hinv.17.u(y24, y3, C.Mod$par[8,3], C.Mod$par2[8,3])

y26 = hinv.2.u(y25, m, C.Mod$par[8,2], C.Mod$par2[8,2])

x8 = hinv.1.u(y26, x1, C.Mod$par[8,1])

x22[i] = x2

x33[i] = x3

x44[i] = x4

x55[i] = x5

x66[i] = x6

x77[i] = x7

x88[i] = x8

l1 = c(x1,mean(x22),mean(x33),mean(x44),mean(x55),mean(x66),mean(x77),mean(x88))

plot(l1,ylim=c(0,1), main = "HSBC Shock")

l1

length(x88)

85

Page 90: 9.8.15.thesis

C.3 Example H-Functions Code

require(VineCopula)

####### Inverse HFunctions to be used for the simulation ####

#*****************************************************************########

#####lower and upper bound

q = 1.1e-5

p = 1 - q

#### 1 - Gaussian copula

hinv.1.u = function(x,v,o)

f = function(u,x,v,o)

a = qnorm(u,0,1) - o*qnorm(v,0,1) / sqrt(1 - o^2)

x - pnorm(a,0,1)

uniroot(f,x=x,v=v,o=o,c(q,p))

return(uniroot(f,x=x,v=v,o =o,c(q,p))$root)

## v = h-1(x|u, theta)

hinv.1.v = function(x,u,o)

f = function(u,x,v,o)

a = qnorm(v,0,1) - o*qnorm(u,0,1) / sqrt(1 - o^2)

x - pnorm(a,0,1)

uniroot(f,x=x,u=u,o=o,c(q,p))

return(uniroot(f,x=x,u=u,o=o,c(q,p))$root)

############------End Gaussian-------############

#### 2 - t copula

hinv.2.u = function(x,v,o,nu)

v = v

if(nu==0)

return(v)

else

f = function(u,x,v,o,nu)

t1 = qt(u,nu)

t2 = qt(v,nu)

mu = o*t2

86

Page 91: 9.8.15.thesis

sig = nu + t2^2*1 - o^2 / nu + 1

a = t1 - mu / sqrt(sig)

x - pt(a, nu + 1)

uniroot(f,x=x,v=v,o=o,nu=nu,c(q,p))

return(uniroot(f,x=x,v=v,o=o,nu=nu,c(q,p))$root)

87