Rmetrics Workshop Singapore 2010

252
Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253 R/Rmetrics Workshop Singapore 2010 Diethelm Würtz Mahendra Mehta David Scott Juri Hinz Rmetrics Association & Finance Online

description

Rmetrics Workshop Singapore 2010

Transcript of Rmetrics Workshop Singapore 2010

Page 1: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics Workshop Singapore 2010

Diethelm WürtzMahendra MehtaDavid ScottJuri Hinz

Rmetrics Association & Finance Online

Page 2: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 3: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics eBook Series

R/Rmetrics eBooks is a series of electronic books and user guides aimedat students and practitioner who use R/Rmetrics to analyze financialmarkets.

A Discussion of Time Series Objects for R in Finance (2009)Diethelm Würtz, Yohan Chalabi, Andrew Ellis

Portfolio Optimization with R/Rmetrics (2010),Diethelm Würtz, William Chen, Yohan Chalabi, Andrew Ellis

Basic R for Finance (2010),Diethelm Würtz, Yohan Chalabi, Longhow Lam, Andrew EllisEarly Bird Edition

Financial Market Data for R/Rmetrics (2010)Diethelm Würtz, Andrew Ellis, Yohan ChalabiEarly Bird Edition

Indian Financial Market Data for R/Rmetrics (2010)Diethelm Würtz, Mahendra Mehta, Andrew Ellis, Yohan Chalabi

Presentations from the R/Rmetrics Singapore Workshop (2010)Diethelm Würtz, Mahendra Mehta, Juri Hinz, David Scott

Page 4: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 5: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

PRESENTATIONS FROM THE

R/RMETRICS

SINGAPORE WORKSHOP 2010

EDITORS:

DIETHELM WÜRTZ

MAHENDRA MEHTA

JURI HINZ

DAVID SCOTT

RMETRICS ASSOCIATION & FINANCE ONLINE

Page 6: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Series Editors:PD Dr. Diethelm WürtzInstitute of Theoretical Physics andCurriculum for Computational ScienceSwiss Federal Institute of TechnologyHönggerberg, HIT K 32.28093 Zurich

Dr. Martin HanfFinance Online GmbHWeinbergstrasse 418006 Zurich

Contact Address:Rmetrics AssociationWeinbergstrasse 418006 [email protected]

Publisher:Finance Online GmbHSwiss Information TechnologiesWeinbergstrasse 418006 Zurich

Authors:Diethelm Würtz, Swiss Federal Institute of Technology ZurichMahendra Mehta, NeuralSoft Technologies MumbaiJuri Hinz, National University of Singapore, SingaporeDavid Scott, University of Auckland, Auckland

ISBN:eISBN:DOI:

© 2009, Finance Online GmbH, ZurichPermission is granted to make and distribute verbatim copies of this manual provided thecopyright notice and this permission notice are preserved on all copies.Permission is granted to copy and distribute modified versions of this manual under the con-ditions for verbatim copying, provided that the entire resulting derived work is distributedunder the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into another lan-guage, under the above conditions for modified versions, except that this permission noticemay be stated in a translation approved by the Rmetrics Association, Zurich.

Limit of Liability/Disclaimer of Warranty: While the publisher and authors have used theirbest efforts in preparing this book, they make no representations or warranties with respectto the accuracy or completeness of the contents of this book and specifically disclaim anyimplied warranties of merchantability or fitness for a particular purpose. No warranty maybe created or extended by sales representatives or written sales materials. The advice andstrategies contained herein may not be suitable for your situation. You should consult with aprofessional where appropriate. Neither the publisher nor authors shall be liable for any lossof profit or any other commercial damages, including but not limited to special, incidental,consequential, or other damages.

Trademark notice: Product or corporate names may be trademarks or registered trademarks,and are used only for identification and explanation, without intent to infringe.

Page 7: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Revision History

May 2010: 1st edition

Page 8: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 9: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

WELCOME

Welcome to the first R/Rmetrics Singapore Conference on “ComputationalTopics in Finance”. We are very glad that you found the time to come tothe Singapore, and for the many of you traveling from the U.S., Europeand various places in Asia, we hope that your journey was not too arduous.

With the R/Rmetrics Singapore Conference, we want to create a new fo-rum where fund and/or risk managers from banks and insurance firms,decision makers, researchers from industry and academia, and studentscan exchange ideas and engage in stimulating discussions.

The environment for this workshop should be a place a little bit asidefrom the mainstream conference of venues, and we are happy to havefound this at the Risk Management Institute of the National University ofSingapore.

About 40 participants are attending the conference, and the mixture, asplanned, is quite heterogeneous. About half are from academia, and theother half from the software and financial industries, including banks.

Last but not least, we want to thank the organizing committee and oursponsors.

We wish you an interesting conference with many inspiring and stimulat-ing discussions.

Diethelm WürtzSingapore, February 2010

v

Page 10: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 11: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CONTENTS

WELCOME V

CONTENTS VII

I Friday Morning 1

1 STEFANO IACUS 2

2 JURI HINZ 40

3 DAVID SCOTT 56

4 MARC PAOLELLA 82

II Friday Afternoon 85

5 VIKRAM KURIYAN 86

6 BERNARD LEE 120

7 KAM FONG CHAN 122

8 ANDREW ELLIS 134

9 ANMOL SETHY 148

10 KARIM CHINE 164

III Saturday Morning 167

11 DEFENG SUN 168

12 YOHAN CHALABI 190

vii

Page 12: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CONTENTS VIII

13 JOEL YU 192

14 LEONG CHEE KIA 202

15 DIETHELM WÜRTZ 204

16 PRATAP SONDHI 214

IV Appendix 233

SPONSORS 234

RMETRICS ASSOCIATION 236

Page 13: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 14: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 15: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

PART I

FRIDAY MORNING

1

Page 16: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 1

STEFANO IACUS

2

Page 17: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The "yuima" package: An R framework for simulation and inference

of stochastic differential equations

Stefano M. Iacuson behalf of Yuima Project Team

Department of Economics, Business and StatisticsUniversità degli Studi di Milano, Italy

Most of the theoretical results in modern finance rely on the assumption that the underlying dynamics of asset prices, currencies exchange rates, interest rates, etc are continuous time stochastic proces-ses driven by stochastic differential equations. Continuous time models are also at the basis of option pricing and option pricing often requires Monte Carlo methods. In turn, the Monte Carlo method re-quires a preliminary good model to simulate whose parameters has to be estimated from historical data. Most ready-to-use tools in computational finance relies on pure discrete time models, like arch, garch, etc. and very few examples of software handling continuous time processes in a general fashion are available also in the R community. There still exists a gap between what is going on in mathematical finance and applied finance. The "yuima" package is intended to help in filling this gap.

The Yuima Project is an open source and collaborative effort of several mathematicians and sta-tisticians aimed at developing the R package named "yuima" for simulation and inference of sto-chastic differential equations. The "yuima" package is an environment that follows the paradigm of methods and classes of the S4 system for the R language.

In the "yuima" package stochastic differential equations can be of very abstract type, e.g. uni or multi-dimensional, driven by Wiener process of fractional Brownian motion with general Hurst parameter, with or without jumps specified as Lévy noise. Lévy processes can be specified via compound Poisson description, by the specification of the Lévy measure or via increments and stable laws.

The "yuima" package is intended to offer the basic infrastructure on which complex models and inference procedures can be built on. In particular, the basic set of functions includes the following: 1) Simulation schemes for all types of stochastic differential equations (Wiener, fBm, Lévy). 2) Different subsampling schemes including random sampling with user specified random times distribution, space discretization, tick times, etc. 3) Automatic asymptotic expansion for the approximation and estimation of functionals of diffusion processes with small noise via Malliavin calculus, useful in option pricing. 4) Efficient quasi-likelihood inference for diffusion processes and diffusion processes with jumps.

All simulation schemes, subsampling and inference are designed to work on both regular or irregular grid times (i.e. regular or irregular time series). In special cases also asynchronous data and sampling schemes can be handled. As proof-of-concept (but fully operational) examples of statistical procedures have been implemented like change point analysis in volatility of stochastic differential equations, asynchronous covariance estimation, divergence test statistics.

The Yuima Project was partly supported by Japan Science and Technology Agency, Basic Research Programs PRESTO, Grants-in-Aid for Scientific Research No. 19340021.

Page 18: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

1 / 56

The Yuima Project

Stefano M. Iacus (University of Milan & R Core Team)on behalf of Yuima Core Team

Computational Topics in Finance, 1st R/Rmetrics Workshop, February 19/20, 2010, Singapore

Overview of the Yuima Project

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

2 / 56

Page 19: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The Yuima Project Team

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

3 / 56

A. Brouste (Univ. Le Mans, FR)M. Fukasawa (Osaka Univ. JP)H. Hino (Waseda Univ., Tokyo, JP)S.M. Iacus (Milan Univ., IT)K. Kengo (Tokyo Univ., JP)H. Masuda (Kyushu Univ., JP)Y. Shimitzu (Osaka Univ., JP)M. Uchida (Osaka Univ., JP)N. Yoshida (Tokyo Univ., JP). . . more to come

The yuima package1 is written by people working in mathematical statisticsand finance, who actively publish results in the field, have some knowledge ofR, and have the feeling on “what’s next” in the field.

Aims at filling the gap between theory and practice!1

The Yuima Project is funded by the Japan Science Technology (JST) Basic Research Programs PRESTO, Grants-in-Aid for ScientificResearch No. 19340021.

The yuima package goal: fill the gap between theory and practice

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

4 / 56

The Yuima Project aims at implementing, via the yuima package, a veryabstract framework to describe probabilistic and statistical properties ofstochastic processes in a way which is the closest as possible to theirmathematical counterparts but also computationally efficient.

� it is an R package, using S4 classes and methods, where the basic classextends to SDE’s with jumps (simple Poisson, Levy), SDE’s driven byfBM, Markov switching regime processes, HMM, etc.

� separates the data description from the inference tools and simulationschemes

� the design allows for multidimensional, multi-noise processesspecification

� it includes a variety of tools useful in finance, like asymptotic expansionof functionals of stochastic processes via Malliavin calculus

Page 20: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Overview of the yuima package

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

5 / 56

The yuima object

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

6 / 56

The main object is the yuima object which allows to describe the model in amathematically sound way.

Then the data and the sampling structure can be included as well or, just thesampling scheme from which data can be generated according to the model.

The package exposes very few generic functions like simulate, qmle, plot,etc. and some other specific functions for special tasks.

Before looking at the details, let us see an overview of the main object.

Page 21: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

What contains a yuima object ?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

7 / 56

YuimaSampling

randomdeterministic

tick timesspace disc.

...

regularirregular

multigridasynch.

Dataunivariate

multivariatets, xts, ...

Model

diffusionLevy

fractionalBM

MarkovSwitching HMM

Page 22: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

YuimaSampling

randomdeterministic

tick timesspace disc.

...

regularirregular

multigridasynch.

Dataunivariate

multivariatets, xts, ...

Model

diffusionLevy

fractionalBM

MarkovSwitching HMM

YuimaSampling

randomdeterministic

tick timesspace disc.

...

regularirregular

multigridasynch.

Dataunivariate

multivariatets, xts, ...

Model

diffusionLevy

fractionalBM

MarkovSwitching HMM

Page 23: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

YuimaSampling

randomdeterministic

tick timesspace disc.

...

regularirregular

multigridasynch.

Dataunivariate

multivariatets, xts, ...

Model

diffusionLevy

fractionalBM

MarkovSwitching HMM

What is possible to do with a yuima

object in hands?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

12 / 56

Page 24: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Yuima

SimulationExact

Euler-Maruyama

Space discr.

NonparametricsCovariation p-variation

ParametricInference

High freq.Low freq.

Quasi MLEDiff, Jumps,

fBM

AdaptiveBayesMCMC

Changepoint

Modelselection

Akaike’s

LASSO-typeHypotheses

Testing

Optionpricing

Asymptoticexpansion

Monte Carlo

Yuima

SimulationExact

Euler-Maruyama

Space discr.

NonparametricsCovariation p-variation

ParametricInference

High freq.Low freq.

Quasi MLEDiff, Jumps,

fBM

AdaptiveBayesMCMC

Changepoint

Modelselection

Akaike’s

LASSO-typeHypotheses

Testing

Optionpricing

Asymptoticexpansion

Monte Carlo

Page 25: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Yuima

SimulationExact

Euler-Maruyama

Space discr.

NonparametricsCovariation p-variation

ParametricInference

High freq.Low freq.

Quasi MLEDiff, Jumps,

fBM

AdaptiveBayesMCMC

Changepoint

Modelselection

Akaike’s

LASSO-typeHypotheses

Testing

Optionpricing

Asymptoticexpansion

Monte Carlo

Yuima

SimulationExact

Euler-Maruyama

Space discr.

NonparametricsCovariation p-variation

ParametricInference

High freq.Low freq.

Quasi MLEDiff, Jumps,

fBM

AdaptiveBayesMCMC

Changepoint

Modelselection

Akaike’s

LASSO-typeHypotheses

Testing

Optionpricing

Asymptoticexpansion

Monte Carlo

Page 26: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Yuima

SimulationExact

Euler-Maruyama

Space discr.

NonparametricsCovariation p-variation

ParametricInference

High freq.Low freq.

Quasi MLEDiff, Jumps,

fBM

AdaptiveBayesMCMC

Changepoint

Modelselection

Akaike’s

LASSO-typeHypotheses

Testing

Optionpricing

Asymptoticexpansion

Monte Carlo

Yuima

SimulationExact

Euler-Maruyama

Space discr.

NonparametricsCovariation p-variation

ParametricInference

High freq.Low freq.

Quasi MLEDiff, Jumps,

fBM

AdaptiveBayesMCMC

Changepoint

Modelselection

Akaike’s

LASSO-typeHypotheses

Testing

Optionpricing

Asymptoticexpansion

Monte Carlo

Page 27: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

How it is supposed to work?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

19 / 56

The model specification

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

20 / 56

We consider here the three main classes of SDE’s which can be easilyspecified. All multidimensional and eventually parametric models.

Page 28: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The model specification

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

20 / 56

We consider here the three main classes of SDE’s which can be easilyspecified. All multidimensional and eventually parametric models.

� Diffusions dXt = a(t,Xt)dt+ b(t,Xt)dWt

The model specification

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

20 / 56

We consider here the three main classes of SDE’s which can be easilyspecified. All multidimensional and eventually parametric models.

� Diffusions dXt = a(t,Xt)dt+ b(t,Xt)dWt

� Fractional Gaussian Noise, with H the Hurst parameter

dXt = a(t,Xt)dt+ b(t,Xt)dWHt

Page 29: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The model specification

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

20 / 56

We consider here the three main classes of SDE’s which can be easilyspecified. All multidimensional and eventually parametric models.

� Diffusions dXt = a(t,Xt)dt+ b(t,Xt)dWt

� Fractional Gaussian Noise, with H the Hurst parameter

dXt = a(t,Xt)dt+ b(t,Xt)dWHt

� Diffusions with jumps, Levy

dXt = a(Xt)dt+ b(Xt)dWt +

|z|>1

c(Xt−, z)µ(dt, dz)

+

0<|z|≤1

c(Xt−, z){µ(dt, dz)− ν(dz)dt}

dXt = −3Xtdt+1

1+X2tdWt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

21 / 56

> mod1 <- setModel(drift = "-3*x", diffusion = "1/(1+x^2)")

Page 30: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

dXt = −3Xtdt+1

1+X2tdWt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

21 / 56

> mod1 <- setModel(drift = "-3*x", diffusion = "1/(1+x^2)")

> str(mod1)

Formal class ’yuima.model’ [package "yuima"] with 16 slots

..@ drift : expression((-3 * x))

..@ diffusion :List of 1

.. ..$ : expression(1/(1 + x^2))

..@ hurst : num 0.5

..@ jump.coeff : expression()

..@ measure : list()

..@ measure.type : chr(0)

..@ parameter :Formal class ’model.parameter’ [package "yuima"] with 6 slots

.. .. ..@ all : chr(0)

.. .. ..@ common : chr(0)

.. .. ..@ diffusion: chr(0)

.. .. ..@ drift : chr(0)

.. .. ..@ jump : chr(0)

.. .. ..@ measure : chr(0)

..@ state.variable : chr "x"

..@ jump.variable : chr(0)

..@ time.variable : chr "t"

..@ noise.number : num 1

..@ equation.number: int 1

..@ dimension : int [1:6] 0 0 0 0 0 0

..@ solve.variable : chr "x"

..@ xinit : num 0

..@ J.flag : logi FALSE

dXt = −3Xtdt+1

1+X2tdWt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

22 / 56

And we can easily simulate and plot the model like

> set.seed(123)

> X <- simulate(mod1)

> plot(X)

0.0 0.2 0.4 0.6 0.8 1.0

−0.8

−0.6

−0.4

−0.2

0.0

0.2

t

x

Page 31: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

dXt = −3Xtdt+1

1+X2tdWt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

23 / 56

The simulate function fills the slots data and sampling

> str(X)

Formal class ’yuima’ [package "yuima"] with 5 slots

..@ data :Formal class ’yuima.data’ [package "yuima"] with 2 slots

.. .. ..@ original.data: ts [1:101, 1] 0 -0.217 -0.186 -0.308 -0.27 ...

.. .. .. ..- attr(*, "dimnames")=List of 2

.. .. .. .. ..$ : NULL

.. .. .. .. ..$ : chr "Series 1"

.. .. .. ..- attr(*, "tsp")= num [1:3] 0 1 100

.. .. ..@ zoo.data :List of 1

.. .. .. ..$ Series 1:’zooreg’ series from 0 to 1

..@ model :Formal class ’yuima.model’ [package "yuima"] with 16 slots

(...) output dropped

..@ sampling :Formal class ’yuima.sampling’ [package "yuima"] with 11 slots

.. .. ..@ Initial : num 0

.. .. ..@ Terminal : num 1

.. .. ..@ n : num 100

.. .. ..@ delta : num 0.1

.. .. ..@ grid : num(0)

.. .. ..@ random : logi FALSE

.. .. ..@ regular : logi TRUE

.. .. ..@ sdelta : num(0)

.. .. ..@ sgrid : num(0)

.. .. ..@ oindex : num(0)

.. .. ..@ interpolation: chr "none"

Parametric model: dXt = −θXtdt+1

1+XγtdWt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

24 / 56

> mod2 <- setModel(drift = "-theta*x", diffusion = "1/(1+x^gamma)")

Page 32: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Parametric model: dXt = −θXtdt+1

1+XγtdWt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

24 / 56

> mod2 <- setModel(drift = "-theta*x", diffusion = "1/(1+x^gamma)")

Automatic extraction of the parameters for further inference

> str(mod2)

Formal class ’yuima.model’ [package "yuima"] with 16 slots

..@ drift : expression((-theta * x))

..@ diffusion :List of 1

.. ..$ : expression(1/(1 + x^gamma))

..@ hurst : num 0.5

..@ jump.coeff : expression()

..@ measure : list()

..@ measure.type : chr(0)

..@ parameter :Formal class ’model.parameter’ [package "yuima"] with 6 slots

.. .. ..@ all : chr [1:2] "theta" "gamma"

.. .. ..@ common : chr(0)

.. .. ..@ diffusion: chr "gamma"

.. .. ..@ drift : chr "theta"

.. .. ..@ jump : chr(0)

.. .. ..@ measure : chr(0)

..@ state.variable : chr "x"

..@ jump.variable : chr(0)

..@ time.variable : chr "t"

..@ noise.number : num 1

..@ equation.number: int 1

..@ dimension : int [1:6] 2 0 1 1 0 0

..@ solve.variable : chr "x"

..@ xinit : num 0

..@ J.flag : logi FALSE

Parametric model: dXt = −θXtdt+1

1+XγtdWt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

25 / 56

And this can be simulated specifying the parameters

> simulate(mod2,true.param=list(theta=1,gamma=3))

Page 33: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

2-dimensional diffusions with 3 noises

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

26 / 56

dX1t = −3X1

t dt+ dW 1t +X2

t dW3t

dX2t = −(X1

t + 2X2t )dt+X1

t dW1t + 3dW 2

t

has to be organized into matrix form

(dX1

t

dX2t

)=

(−3X1

t

−X1t − 2X2

t

)dt+

(1 0 X2

t

X1t 3 0

)

dW 1t

dW 2t

dW 3t

> sol <- c("x1","x2") # variable for numerical solution

> a <- c("-3*x1","-x1-2*x2") # drift vector

> b <- matrix(c("1","x1","0","3","x2","0"),2,3) # diffusion matrix

> mod3 <- setModel(drift = a, diffusion = b, solve.variable = sol)

2-dimensional diffusions with 3 noises

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

27 / 56

dX1t = −3X1

t dt+ dW 1t +X2

t dW3t

dX2t = −(X1

t + 2X2t )dt+X1

t dW1t + 3dW 2

t

> str(mod3)

Formal class ’yuima.model’ [package "yuima"] with 16 slots

..@ drift : expression((-3 * x1), (-x1 - 2 * x2))

..@ diffusion :List of 2

.. ..$ : expression(1, 0, x2)

.. ..$ : expression(x1, 3, 0)

..@ hurst : num 0.5

..@ jump.coeff : expression()

..@ measure : list()

..@ measure.type : chr(0)

..@ parameter :Formal class ’model.parameter’ [package "yuima"] with 6 slots

.. .. ..@ all : chr(0)

.. .. ..@ common : chr(0)

.. .. ..@ diffusion: chr(0)

.. .. ..@ drift : chr(0)

.. .. ..@ jump : chr(0)

.. .. ..@ measure : chr(0)

..@ state.variable : chr "x"

..@ jump.variable : chr(0)

..@ time.variable : chr "t"

..@ noise.number : int 3

..@ equation.number: int 2

..@ dimension : int [1:6] 0 0 0 0 0 0

..@ solve.variable : chr [1:2] "x1" "x2"

..@ xinit : num [1:2] 0 0

..@ J.flag : logi FALSE

Page 34: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Plot methods inherited by zoo

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

28 / 56

> set.seed(123)

> X <- simulate(mod3)

> plot(X,plot.type="single",col=c("red","blue"))

0.0 0.2 0.4 0.6 0.8 1.0

−3−2

−10

1

t

x1

Multidimensional SDE

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

29 / 56

Also models likes this can be specified

dX1t = X2

t

∣∣X1t

∣∣2/3 dW 1t ,

dX2t = g(t)dX3

t ,

dX3t = X3

t (µdt+ σ(ρdW 1t +

√1− ρ2dW 2

t ))

,

where g(t) = 0.4 + (0.1 + 0.2t)e−2t

The above is an example of parametric SDE with more equations than noises.

Page 35: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Fractional Gaussian Noise dYt = 3Ytdt+ dWHt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

30 / 56

> mod4 <- setModel(drift="3*y", diffusion=1, hurst=0.3, solve.var="y")

Fractional Gaussian Noise dYt = 3Ytdt+ dWHt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

30 / 56

> mod4 <- setModel(drift="3*y", diffusion=1, hurst=0.3, solve.var="y")

The hurst slot is filled

> str(mod4)

Formal class ’yuima.model’ [package "yuima"] with 16 slots

..@ drift : expression((3 * y))

..@ diffusion :List of 1

.. ..$ : expression(1)

..@ hurst : num 0.3

..@ jump.coeff : expression()

..@ measure : list()

..@ measure.type : chr(0)

..@ parameter :Formal class ’model.parameter’ [package "yuima"] with 6 slots

.. .. ..@ all : chr(0)

.. .. ..@ common : chr(0)

.. .. ..@ diffusion: chr(0)

.. .. ..@ drift : chr(0)

.. .. ..@ jump : chr(0)

.. .. ..@ measure : chr(0)

..@ state.variable : chr "x"

..@ jump.variable : chr(0)

..@ time.variable : chr "t"

..@ noise.number : num 1

..@ equation.number: int 1

..@ dimension : int [1:6] 0 0 0 0 0 0

..@ solve.variable : chr "y"

..@ xinit : num 0

..@ J.flag : logi FALSE

Page 36: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Fractional Gaussian Noise dYt = 3Ytdt+ dWHt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

31 / 56

> set.seed(123)

> X <- simulate(mod4, n=1000)

> plot(X, main="I’m fractional!")

0.0 0.2 0.4 0.6 0.8 1.0

01

23

4

t

y

I’m fractional!

Jump processes

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

32 / 56

Jump processes can be specified in different ways in mathematics (and hencein yuima package).

Let Zt be a Compound Poisson Process (i.e. jumps follow some distribution,e.g. Gaussian)

Then is is possible to consider the following SDE which involves jumps

dXt = a(Xt)dt+ b(Xt)dWt + dZt

Next is an example of Poisson process with intensity λ = 10 and Gaussianjumps.

In this case we specify measure.type as “CP” (Compound Poisson)

Page 37: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Jump process: dXt = −θXtdt+ σdWt + Zt

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

33 / 56

> mod5 <- setModel(drift=c("-theta*x"), diffusion="sigma",

jump.coeff="1", measure=list(intensity="10", df=list("dnorm(z, 0, 1)")),

measure.type="CP", solve.variable="x")

> set.seed(123)

> X <- simulate(mod5, true.p=list(theta=1,sigma=3),n=1000)

> plot(X, main="I’m jumping!")

0.0 0.2 0.4 0.6 0.8 1.0

−8−6

−4−2

0

t

x

I’m jumping!

Jump processes

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

34 / 56

Another way is to specify the Levy measure. Without going into too muchdetails, here is an example of a simple OU process with IG Levy measuredXt = −xdt+ dZt

> mod6 <- setModel(drift="-x", xinit=1, jump.coeff="1",

measure.type="code", measure=list(df="rIG(z, 1, 0.1)"))

> set.seed(123)

> plot( simulate(mod6, Terminal=10, n=10000), main="I’m also jumping!")

0 2 4 6 8 10

05

1015

20

t

x

I’m also jumping!

Page 38: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The setModel method

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

35 / 56

Models are specified via

setModel(drift = NULL, diffusion = NULL, hurst = 0.5, jump.coeff = character(),

measure = list(), measure.type = character(), state.variable = "x",

jump.variable = "z", time.variable = "t", solve.variable, xinit)

indXt = a(Xt)dt+ b(Xt)dWt + c(Xt)dZt

The package implements many multivariate RNG to simulate Levy pathsincluding rIG, rNIG, rbgamma, rngamma, rstable.

Other user-defined or packages-defined RNG can be used freely.

The setSampling method

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

36 / 56

A sampling or subsampling structure can be created via the setSamplingconstructor.

This allow to specify regular or irregular multidimensional grids (i.e. eachequation has its own grid), possibly a random distribution of times.

Page 39: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The setSampling method

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

36 / 56

A sampling or subsampling structure can be created via the setSamplingconstructor.

This allow to specify regular or irregular multidimensional grids (i.e. eachequation has its own grid), possibly a random distribution of times.

The sampling slot in Yuima is also used during the inference. For example,one can specify the “model”, the “data” and then explicit the sampling whichwill contain informations about how these data have been collected. In thiscase, the tools for inference in Yuima will act differently upon this information.

The setSampling method

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

36 / 56

A sampling or subsampling structure can be created via the setSamplingconstructor.

This allow to specify regular or irregular multidimensional grids (i.e. eachequation has its own grid), possibly a random distribution of times.

The sampling slot in Yuima is also used during the inference. For example,one can specify the “model”, the “data” and then explicit the sampling whichwill contain informations about how these data have been collected. In thiscase, the tools for inference in Yuima will act differently upon this information.

In simulation studies, one can decide to simulate the processes at highfrequency and then resample the simulated data according to differentsubsampling schemes: random, irregular, space grids, etc and verifty the effectof different subsampling on the estimation or the calibration of financial product.

Page 40: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Inference

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

37 / 56

Which tools have been developed

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

38 / 56

� the covariance estimator of Yoshida-Hayashi (2005) for multidimensionalIto processes with asynchronous data

� quasi-likelihood estimation for multidimensional diffusions (Yoshida,1992, 2005)

� change point estimation for the volatility in a multidimensional Ito process(Iacus & Yoshida, 2009)

� Bayes type estimators (Yoshida, 2005)

� LASSO-type and hypotheses testing based on φ-divergences (DeGregorio & Iacus, 2008 & 2010)

Just not to be too vague, let us consider the exact fomulations of some of theproblems which can be handled by the yuima package.

Page 41: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Change-point Analysis

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

39 / 56

Volatility Change-Point Estimation

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

40 / 56

The theory works for SDEs of the form

dYt = btdt+ σ(Xt, θ)dWt, t ∈ [0, T ],

where Wt a r-dimensional Wiener process and bt and Xt aremultidimensional processes and σ is the diffusion coefficient (volatility) matrix.

When Y = X the problem is a diffusion model.

The process bt may have jumps but should note explode and it is treated as anuisance in this model.

Page 42: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Change-point analysis

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

41 / 56

The change-point problem for the volatility is formalized as follows

Yt =

{Y0 +

∫ t0 bsds+

∫ t0 σ(Xs, θ

∗1)dWs for t ∈ [0, τ∗)

Yτ∗ +∫ tτ∗ bsds+

∫ tτ∗ σ(Xs, θ

∗2)dWs for t ∈ [τ∗, T ].

The change point τ∗ instant is unknown and is to be estimated, along with θ∗1and θ∗2 , from the observations sampled from the path of (X,Y ).

An application to the recent financial crisis showed that...

- Lehman Brothers

- DJ Stoxx Americas 600 Banks - DJ Stoxx 600 Banks - Deutsche Bank - HSBC - Barclays - Deutsche Bank (Ger) - CAC �

- DJ Stoxx Global�1800 Banks �

- S&P/MIB - Nikkei 225

- FTSE�- DJ Stoxx 600�

- Lehman Brothers

- DJ Stoxx�600 Banks

- Goldman �Sachs�

- Deutsche Bank - HSBC

- Nyse - DJ Stoxx Global 1800 - Dow Jones - MSCI World�- S&P 500 - Morgan Stanley�- FTSE - Bank of America�- DAX - Barclays �- S&P MIB - RBS - CAC - Unicredit�- IBEX - Intesa Sanpaolo�- SMI - Deutsche Bank (Ger)�- Nikkei 225 - Commerzbank �

- DJ Stoxx 600

- Nasdaq - DJ Stoxx Asia Pacific 600 Banks - JP Morgan Chase

Page 43: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

LASSO estimation

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

43 / 56

LASSO estimation

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

44 / 56

LASSO is nothing but estimation under constraints on the parameters. Usuallystudied for the least squares estimation method, can be applied here using theQMLE approach for the following diffusion model

dXt = b(α,Xt)dt+ σ(β,Xt)dWt

where α ∈ Rp, β ∈ Rq , p, q ≥ 1The target function is the minimization of Hn(α, β) = minus the log of theapproximated likelihood,

minα,β

Hn(α, β) +

p∑

j=1

λn,j |αj |+q∑

k=1

γn,k|βk|

Lasso tries to set the maximal number of parameters to 0. In this senseoperates model selection jointly with estimation.

Page 44: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Interest rates LASSO estimation examples

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

45 / 56

LASSO estimation of the U.S. Interest Rates monthly data from 06/1964 to12/1989. These data have been analyzed by many author including Nowman(1997), Aıt-Sahalia (1996), Yu and Phillips (2001) and it is a nice application ofLASSO.

Reference Model α β γMerton (1973) dXt = αdt+ σdWt 0 0Vasicek (1977) dXt = (α+ βXt)dt+ σdWt 0Cox, Ingersoll and Ross (1985) dXt = (α+ βXt)dt+ σ

√XtdWt 1/2

Dothan (1978) dXt = σXtdWt 0 0 1Geometric Brownian Motion dXt = βXtdt+ σXtdWt 0 1Brennan and Schwartz (1980) dXt = (α+ βXt)dt+ σXtdWt 1

Cox, Ingersoll and Ross (1980) dXt = σX3/2t dWt 0 0 3/2

Constant Elasticity Variance dXt = βXtdt+ σXγt dWt 0

CKLS (1992) dXt = (α+ βXt)dt+ σXγt dWt

Interest rates LASSO estimation examples

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

46 / 56

Model Estimation Method α β σ γVasicek MLE 4.1889 -0.6072 0.8096 –

CKLS Nowman 2.4272 -0.3277 0.1741 1.3610

CKLS Exact Gaussian 2.0069 -0.3330 0.1741 1.3610(Yu & Phillips) (0.5216) (0.0677)

CKLS QMLE 2.0822 -0.2756 0.1322 1.4392(0.9635) (0.1895) (0.0253) (0.1018)

CKLS QMLE + LASSO 1.5435 -0.1687 0.1306 1.4452with mild penalization (0.6813) (0.1340) (0.0179) (0.0720)

CKLS QMLE + LASSO 0.5412 0.0001 0.1178 1.4944with strong penalization (0.2076) (0.0054) (0.0179) (0.0720)

LASSO selected: Cox, Ingersoll and Ross (1980) model

dXt =1

2dt+ 0.12 ·X3/2

t dWt

Page 45: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Asymptotic Expansion

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

47 / 56

Estimation of functionals

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

48 / 56

The yuima package can handle asymptotic expansion of functionals ofd-dimensional diffusion process

dXεt = a(Xε

t , ε)dt+ b(Xεt , ε)dWt, ε ∈ (0, 1]

with Wt and r-dimensional Wiener process, i.e. Wt = (W 1t , . . . ,W

rt ).

The functional is expressed in the following abstract form

F ε(Xεt ) =

r∑

α=0

∫ T

0fα(X

εt , d)dW

αt + F (Xε

t , ε), W 0t = t

Page 46: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Estimation of functionals. Example.

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

49 / 56

Example: B&S asian call option

dXεt = µXε

t dt+ εXεt dWt

and the B&S price is related to E{max

(1

T

∫ T

0Xε

t dt−K, 0

)}. Thus the

functional of interest is

F ε(Xεt ) =

1

T

∫ T

0Xε

t dt, r = 1

Estimation of functionals. Example.

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

49 / 56

Example: B&S asian call option

dXεt = µXε

t dt+ εXεt dWt

and the B&S price is related to E{max

(1

T

∫ T

0Xε

t dt−K, 0

)}. Thus the

functional of interest is

F ε(Xεt ) =

1

T

∫ T

0Xε

t dt, r = 1

withf0(x, ε) =

x

T, f1(x, ε) = 0, F (x, ε) = 0

in

F ε(Xεt ) =

r∑

α=0

∫ T

0fα(X

εt , d)dW

αt + F (Xε

t , ε)

Page 47: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Estimation of functionals. Example.

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

50 / 56

So, the call option price requires the composition of a smooth functional

F ε(Xεt ) =

1

T

∫ T

0Xε

t dt, r = 1

with the irregular functionmax(x−K, 0)

Monte Carlo methods require a HUGE number of simulations to get the desiredaccuracy of the calculation of the price, while asymptotic expansion of F ε

provides unexpectedly accurate approximations.

The yuima package provides functions to construct the functional F ε, andautomatic asymptotic expansion based on Malliavin calculus starting from ayuima object.

setFunctional method

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

51 / 56

# dXt^e = Xt^e * dt + e * Xt^e * dWt

> diff.matrix <- matrix( c("x*e"), 1,1)

> model <- setModel(drift = c("x"), diffusion = diff.matrix)

> T <- 1

> xinit <- 1

> f <- list( expression(x/T), expression(0))

> F <- 0

> e <- .3

> yuima <- setYuima(model = model, sampling = setSampling(Terminal=T, n=1000))

> yuima <- setFunctional( yuima, f=f,F=F, xinit=xinit,e=e)

the definition of the functional is now included in the yuima object (someoutput dropped)> str(yuima)

Formal class ’yuima’ [package "yuima"] with 5 slots

..@ data :Formal class ’yuima.data’ [package "yuima"] with 2 slots

..@ model :Formal class ’yuima.model’ [package "yuima"] with 16 slots

..@ sampling :Formal class ’yuima.sampling’ [package "yuima"] with 11 slots

..@ functional :Formal class ’yuima.functional’ [package "yuima"] with 4 slots

.. .. ..@ F : num 0

.. .. ..@ f :List of 2

.. .. .. ..$ : expression(x/T)

.. .. .. ..$ : expression(0)

.. .. ..@ xinit: num 1

.. .. ..@ e : num 0.3

Page 48: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

YuimaSampling

Data

Model

Functional

Estimation of functionals. Example.

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

53 / 56

Then, it is as easy as> F0 <- F0(yuima)

> F0

[1] 1.716424

> max(F0-K,0) # asian call option price[1] 0.7164237

Page 49: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Estimation of functionals. Example.

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

53 / 56

Then, it is as easy as> F0 <- F0(yuima)

> F0

[1] 1.716424

> max(F0-K,0) # asian call option price[1] 0.7164237

and back to asymptotic expansion, the following script may work> rho <- expression(0)

> get_ge <- function(x,epsilon,K,F0){

+ tmp <- (F0 - K) + (epsilon * x)

+ tmp[(epsilon * x) < (K-F0)] <- 0

+ return( tmp )

+ }

> K <- 1 # strike

> epsilon <- e # noise level

> g <- function(x) {

+ tmp <- (F0 - K) + (epsilon * x)

+ tmp[(epsilon * x) < (K-F0)] <- 0

+ tmp

+ }

Add more terms to the expansion

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

54 / 56

The expansion of previous functional gives> asymp <- asymptotic_term(yuima, block=10, rho, g)

calculating d0 ...done

calculating d1 term ...done

> asymp$d0 + e * asymp$d1 # asymp. exp. of asian call price

[1] 0.7148786

> library(fExoticOptions) # From RMetrics suite

> TurnbullWakemanAsianApproxOption("c", S = 1, SA = 1, X = 1,

+ Time = 1, time = 1, tau = 0.0, r = 0, b = 1, sigma = e)

Option Price:

[1] 0.7184944

> LevyAsianApproxOption("c", S = 1, SA = 1, X = 1,

+ Time = 1, time = 1, r = 0, b = 1, sigma = e)

Option Price:

[1] 0.7184944

> X <- sde.sim(drift=expression(x), sigma=expression(e*x), N=1000,M=1000)

> mean(colMeans((X-K)*(X-K>0))) # MC asian call price based on M=1000 repl.

[1] 0.707046

Page 50: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Roadmap

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

55 / 56

Where & When?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

56 / 56

� Where: R-Forge.R-Project.org/projects/yuima

Page 51: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Where & When?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

56 / 56

� Where: R-Forge.R-Project.org/projects/yuima

� When: beta release, march 2010; stable release by summer 2010

Where & When?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

56 / 56

� Where: R-Forge.R-Project.org/projects/yuima

� When: beta release, march 2010; stable release by summer 2010

� Documentation: planned a R/Rmetric e-book for developers and users

Page 52: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Where & When?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

56 / 56

� Where: R-Forge.R-Project.org/projects/yuima

� When: beta release, march 2010; stable release by summer 2010

� Documentation: planned a R/Rmetric e-book for developers and users

� Parallelization of simulators: the foreach approach in 2010

Where & When?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

56 / 56

� Where: R-Forge.R-Project.org/projects/yuima

� When: beta release, march 2010; stable release by summer 2010

� Documentation: planned a R/Rmetric e-book for developers and users

� Parallelization of simulators: the foreach approach in 2010

� User friendly (point&click) GUI: we have plans

Page 53: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Where & When?

Overview of the YuimaProject

Overview of the yuimapackage

What contains a yuimaobject ?

What is possible to dowith a yuima object inhands?

How it is supposed towork?

Inference

Change-point Analysis

LASSO estimation

Asymptotic Expansion

Roadmap

56 / 56

� Where: R-Forge.R-Project.org/projects/yuima

� When: beta release, march 2010; stable release by summer 2010

� Documentation: planned a R/Rmetric e-book for developers and users

� Parallelization of simulators: the foreach approach in 2010

� User friendly (point&click) GUI: we have plans

Thanks!

Q & A

Page 54: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 2

JURI HINZ

40

Page 55: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

A Monte Carlo method for optimal stochastic control problems with convex value functions

Juri Hinz

National University of Singapore Department of MathematicsFaculty of Science

Abstract

We present a method for calculation of optimal control policies for problems with convex value functions. Such situations appear frequently in many applications and encompass important examples arising in the area of the so-called partially observed Markov decision processes.

We show that an increase of the calculation performance can be achievedby an adaptation of the classical least-square approach. The modifications are based on the convexity-preserving property of theconditional expectation, valid in our framework.

Page 56: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

A Monte Carlo method for problemsof optimal stochastic controlwith convex value functions.

Juri Hinz1

1NUS

Rmetrics, 20/02/2010, Singapore

Storage management

Commodity price process (Zk )k≥1 with state space Z ⊂ RStorage positions P (finite set: empty, full, half-full)Actions A (finite set: sell, buy one unit)Change of position by action(p,a) → α(p,a) = (p − a)+ ∈ P

Policy (p,a) �→ π(p,a) ∈ A yields actions and postions

aπk := π(pπk ,Zk ), pπk+1 := α(pπk ,aπk ), k ≥ 1

Reward R(p, z,a) = z(p − α(p,a))from decision agiven stock position pat the market price z

Page 57: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Ingredients

Revenue, discounted by γ ∈]0,1[

E(∑

k≥0

γkR(pπk ,Zk ,aπk ))

Value of the policy π is V π(p, z) given by solution to

V π(p, z) = R(p, z, π(p, z))+γ

ZV π(α(p, π(p, z)), z′) K (z,dz′)︸ ︷︷ ︸

P(Z2∈dz′|Z1=z)

Optimal control

Optimal policy π∗ is better than each other policy π

V π∗

(p, z) ≥ V π(p, z) for all (p, z) ∈ P × Z

Value function (value of an optimal policy) is obtained as theunique solution to

V ∗(p, z) = maxa∈A

(R(p, z, a) + γ

Z

V ∗(α(p, a), z ′)K (z, dz ′)

)

giving an optimal policy by

π∗(p, z) = argmaxa∈A

(R(p, z,a) + γ

ZV ∗(α(p,a), z′)K (z,dz′)

)

Page 58: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Solution method

By value-iteration, calculate recursively

V (n+1)(p, z) = maxa∈A

(R(p, z,a) + γ

ZV (n)(α(p,a), z′)K (z,dz′)

)

a sequence (V (n))n≥1 of pointwise converging functions whoselimit V ∗

V ∗(p, z) = limn→∞

V (n)(p, z) for all (p, z) ∈ P × Z

is the value function.

One problem only

How to calculate the Markov transition

(Tf )(z) :=∫

Zf (z′)K (z,dz′)

if the state space isnot countablehigh dimensionalwith complicated geometry

Page 59: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Solution

Suggest an approximation to Tsuitable for numerical calculations.

Approximate Tf in terms of basis functions

(Tf )(z) ≈M∑

j=1

λjψj(z) =

T f (z) Monte-Carlo transitionT f (z) Approximative transitionT f (z) Bounded appr. transition

Transition approximations

Idea is simple. Using conditional expectation

Tf (Z1) = E(f (Z2) |σ(Z1))

one recognizes the projection

Tf = ΠL⊗I(I⊗ f )

in the Hilbert space L2(Z × Z,P(Z1,Z2)). Now approximatereplace the measure by point measures from a sample

P(Z1,Z2) ≈1N

N∑

i=1

δ(zi ,z′i )

replace the image space of the projection

L⊗ I ≈ lin{ψj ⊗ I : j = 1, . . . ,M}

Page 60: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Monte-Carlo transition

T f =M∑

j=1

λjψj

with coefficients (λj)Mj=1 given by

the minimizer of the sum of squared errors∑Ni=1 |f (z′i )−

∑Mj=1 λjψj(zi)|2 over (λj)Mj=1 ∈ RM .

Problems with Tdepends on the basis and on the sampleenlarging the basis gives oscillations in the projectionto capture oscillations, the sample must be very large

Approximative transition

if Tf is non-negative and convex thenchose non-negative and convex basis functionstake only positive coefficients in the linear combinationsbasis can be arbitrary large, no oscillations occur dueconvexity.

Thus, under the standing assumption that

all basis functions (ψj)Mj=1 are non-negative:

0 ≤ ψj(z) for all z ∈ Z, j = 1, . . . ,M.

we define the approximative transition T f

Page 61: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

approximative transition T

is defined on non-negative functions only by

T f =M∑

j=1

λjψj , f ≥ 0

where (λj)Mj=1 solve the constrained quadratic minimization

minimize∑N

i=1 |f (z′i )−∑M

j=1 λjψj(zi)|2

subject to λj ≥ 0 for j = 1, . . . ,M.

Bounded approximative transition T

is defined on non-negative functions only by

T f =M∑

j=1

λjψj , f ≥ 0

where (λj)Mj=1 solve the constrained quadratic minimization

minimize∑N

i=1 |f (z′i )−∑M

j=1 λjψj(zi)|2

subject to λj ≥ 0 for j = 1, . . . ,M

maxz∈Z∑M

j=1 λjψj(z) ≤ maxz∈Z f (z)

Page 62: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Boundary is crucial

to ensure the existence of fixed point V ∗ to

V ∗(p, z) = maxa∈A

(R(p, z,a) + γT V ∗(α(p,a), ·)(z)

)

under slight additional assumptions.Proposition If all reward functions satisfy

0 ≤ R(a, ·,p) < ∞

and the the basis functions values on the sample

{(ψj (zi))Ni=1 : j = 1, . . . ,M} are linearly independent,

then there exists a solution V ∗.

How to use?

If value functions V ∗(p, ·) of the original problem arenon-negative and convex, then find V ∗(p, ·) for arbitrarily largecone of convex basis functions (no oscillations due convexity!).

Claim V ∗ ≈ V ∗

Still a problem: Computational problems with large basis.

Observation: Basis dimension can be low, if basis is properlychosen. Ideally, basis elements mimic the targeted valuefunctions.

Idea: After calculations with preliminary basis, change thebasis such that its elements are similar to the obtained byprojections. Apply such a procedure repeatedly.

Page 63: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Basis-free least-square optimal control

Suppose that for each φ a procedure determines a basis

Ψ(φ) = {ψ1, . . . , ψM},

whose approximative transition is denoted by TΨ(φ).

Given f and a φ0, proceed recursively

φk+1 = TΨ(φk )f , k ≥ 1.

Hopefully, improved projections (φk )k≥1 reduce the error∑N

i=1 |φk (zi )− f (z′i )|2 is decreasing in k ≥ 1 (1)

and converges to φ, which is non-improvable

φ = TΨ(φ)f .

Basis-free version

Given improvement operator Ψ(·) we suggest to study thefollowing problem:

Determine the solution V ∗ to the fixed point equations as

V ∗(p, z) = maxa∈A(R(p, z,a) + γTΨ(φ(α(p,a)))V ∗(α(p,a), ·)(z)

)

where φ(p) is a non-improvable projectionTΨ(φ(p))V ∗(p, ·) = φ(p) for all p ∈ P

Page 64: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Specific situation

if Tf is non-negative and convex then approximate

Tf ≈ TCf

where C spans the cone of all non-negative, convex functions.

To approach TC f , we construct improvement operators

Ψl(φ) = {φ, φ ∨ l} φ positive and convex, l affine linear.

It turns out that

TΨl(φ)f = φ for each affine-linear l =⇒ TC f = φ

which gives a stylized basis improvement procedure

Stylized procedure

to approach T f by improvement of two dimensional cones

0) Given f ≥ 0, chose a convex φ > 0.1) For an affine linear l and calculate TΨl(φ)f .

2) If TΨl(φ)f = φ, then repeat 1) with the same φ but another l .

3) If TΨl(φ)f �= φ, then repeat 1) with the new φ := TΨl(φ)f andthe same l .

4) Terminate if 1)– 2) follows sufficiently many times.

Page 65: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

A more formal algorithm

Step 0 (Initialization) For f ≥ 0, set β := (f (z′i ))Ni=1.

Specify positive convex {ϕ1, . . . , ϕF} and affine linear{l(0)1 , . . . , l(0)L }. For positive and convex φ(0), define

Ψ(0) = {ϕ1, . . . , ϕF , φ(0), φ(0) ∨ l1, . . . , φ(0) ∨ lL}.

Step 1 (Minimization) Given Ψ(k) = {ψ(k)1 , . . . , ψ

(k)M },

M(k)ij := ψ

(k)j (zi), i = 1, . . . ,N, j = 1, . . . ,M.

Determine λ(k) = (λ(k)i )Mj=1 ∈ [0,∞[M as the minimizer to

[0,∞[M→ [0,∞[M , λ �→ λ M(k) M(k)λ− 2λ M(k) β.

and calculate φ(k) :=∑M

j=1 λ(k)j ψj .

A more formal algorithm

Step 2 (Test for Termination) Determine the projectionerror

E (k) =

( N∑

i=1

|φ(k)(zi)− f (z′i )|2

) 12

,

if E (k) − E (k−1) < ε then finish and return φ(k), 0therwiseproceedStep 3 (Basis change) Define

Ψ(k+1) = {ϕ1, . . . , ϕF , φ(k), φ(k) ∨ l(k)1 , . . . , φ(k) ∨ l(k)L }

and go to the Step 1.

Page 66: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Example:

Z2 = Z1 + X where Z1,X ∼ N(0,1) then

f : z �→ z2 ⇒ Tf : z �→ z2 + 1.

−2 −1 0 1 2 3

05

1015

sample realizations

is obtained with (zi , f (z′i ))200i=1

Approximation is better than theoretical result

( N∑

i=1

|φ(zi)− f (z ′i )|

2

) 12

≈ 30.644,

( N∑

i=1

|Tf (zi)− f (z ′i )|

2

) 12

≈ 31.913.

−2 −1 0 1 2 3

05

1015

sample realizations

Page 67: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Example: optimal stopping

Suppose that (Zk )k≥1 follows an auto-regression

Zk+1 = 0.9Zk+Xk+1, k ≥ 1 (Xk )k≥1 iid, N(0,0.09)-distributed.

Positions P = {stopped, goes}

Actions A = {stop, go}

Position change[α(stopped, stop) α(goes, stop)α(stopped, go) α(goes, go)

]=

[stopped stoppedstopped goes

].

Example: optimal stopping

Reward is paid only when the system stops[R(stopped, z, stop) R(goes, z, stop)R(stopped, z, go) R(goes, z, go)

]=

[0 ez0 0

]

Given path realization (zk )400k=1 and λ = 0.95 one obtains V ∗ by

value iterationbasis improvement in each step

Page 68: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Example: optimal stopping

The value function V ∗(′goes′, ·)

−2 −1 0 1

01

23

45

6

state variable

valu

e fu

nctio

n

Stop if the state variable is above z∗ (line intersection).Otherwise, wait.

Outlook

How about non-convex value functions?

Represent non-convex functions by a difference of convexfunctions and adapt basis improvement accordingly.

Example of(T cos)(z) =

∫cos(z + x)N(0, σ2

X )(dx) = cos(z)e−σ2X /2

−5 0 5 10

−1.0

−0.5

0.0

0.5

1.0

Page 69: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Conclusion

Knowing particular properties of conditional expectationhelps to improve the calculation of least square projectionConvexity is the key property hereAdaptive basis improvement seems to workUsing this, Markov decision algorithm can be adapted tocomplicated and high dimensional spaces, no basis isconstruction is required

Thank you!

Page 70: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 3

DAVID SCOTT

56

Page 71: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Modeling Financial Return Distributions Using theGeneralized Lambda Distribution

Yohan Chalabi1, David Scott2,∗ , Diethelm Wurtz1

1. ETH Zurich2. University of Auckland

* Contact author: [email protected]

Keywords: distributions; financial returns; generalized lambda distribution

We investigate the generalized lambda distribution with infinite support for modeling financial returnseries with power law tails. We derive expressions for the distribution, for random number generation, andfor financial risk measures including value at risk, expected shortfall and tail indices.

We introduce a new method of obtaining parameter estimates in which the data is standardized to havezero median and unit interquartile range and then a generalized lambda distribution with zero median andunit interquartile range is fitted to the data. This reduces the number of parameters to two allowing formore efficient parameter estimation. Using this idea we demonstrate a simple robust method of momentsestimation approach using moments based on Bowley’s skewness and Moors’ kurtosis.

We compare the performance of several further estimation approaches including maximum log likelihood,maximum product spacing, goodness of fit testing, and histogram binning using Monte Carlo simulation withdata derived from the NASDAQ-100 returns.

Page 72: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Modeling Financial Return DistributionsUsing the Generalized Lambda Distribution

Yohan Chalabi1 David Scott2 Diethelm Wurtz1

1Institut fur Theoretische PhysikETH Zurich

2Department of StatisticsThe University of Auckland

February 19, 2010

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Outline

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 73: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Outline

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Outline

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 74: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Outline

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Outline

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 75: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Outline

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 76: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Generalized Lambda Distribution

[Ramberg and Schmeiser, 1974] introduced thefour-parameter generalized lambda distribution (GLD) definedby the quantile function

F−1(p|λ) = F−1(p|λ1, λ2, λ3, λ4) = λ1 +pλ3 − (1− p)λ4

λ2(1)

where p are the probabilities, p ∈ [0, 1]λ1 and λ2 are the location and scale parameters

λ3 and λ4 are shape parameters jointly related to thestrengths of the lower and upper tails, respectively.

In the limiting case λ1 = 0 and λ2 = λ3 = λ4 = λ we obtainTukey’s lambda distribution which appeared in[Hastings et al., 1947]

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Space

λ1 can take any real value, λ2 must be positive

Only particular values of λ3 and λ4 produce proper statisticaldistributions

The support of the distribution changes with different valuesof the parameters λ3 and λ4

[Karian et al., 1996] identified six regions in which the shapeparameters can lie in which the shapes of the GLDs are similar

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 77: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Space

−2 −1 1 2

−2

−1

1

2

λ4

λ3

Region 1

Region 2

Region 3

Region 4

Region5

Region 6

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Support in Parameter Regions

Region λ1 λ2 λ3 λ4 Minimum Maximum

1 and 5 all < 0 < −1 > 1 −∞ λ1 + (1/λ2)

2 and 6 all < 0 > 1 < −1 λ1 − (1/λ2) ∞all > 0 > 0 > 0 λ1 − (1/λ2) λ1 + (1/λ2)

3 all > 0 = 0 > 0 λ1 λ1 + (1/λ2)all > 0 > 0 = 0 λ1 − (1/λ2) λ1

all < 0 < 0 < 0 −∞ ∞4 all < 0 = 0 < 0 λ1 ∞

all < 0 < 0 = 0 −∞ λ1

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 78: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Space for Financial Returns

For modeling financial returns the support should be infiniteto both left and right

For the GLD this corresponds to all the shape parameters (λ2,λ3 and λ4) being negative

This is region 4 in the parameter space, and in this region theGLD is unimodal: We will consider this case from now on

If the tail-weight parameters (λ3 and λ4) are equal, thedistribution is symmetric

The tail-weight parameters determine what moments exist

The k-th moment exists provide min(λ3, λ4) > −1/k

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Examples

−4 −2 0 2 4

0.0

0.5

1.0

1.5

x

Den

sity

−4 −2 0 2 4

0.0

0.2

0.4

0.6

0.8

1.0

x

Pro

babi

lity

Density and probability function for the GLD in parameter region4. The right tail is fixed at λ4 = −1/4 and the left tail varies inpowers of 2 in the range {−1/8,−1/4,−1/2,−1,−2}.

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 79: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Tail Behaviour

The lower (upper) tail of the distribution function of the GLDis regularly varying at −∞ (+∞) with index −1/λ3 (−1/λ4)For the density function f (x) we have

f (x) ∼ 1

λ3(−λ2x)

1/λ3−1 as x → −∞ (2)

and

f (x) ∼ 1

λ4(−λ2x)

1/λ4−1 as x → ∞ (3)

Moment existence and tail order change continuously with thevalues of the tail-weight parameters

For the stable distribution the moment existence changes in adiscontinuous fashion with the index (mean exists forindex> 1, all moments for index≥ 2)

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Value at Risk and Expected Shortfall

Value at Risk, VaR, and expected shortfall risk, ESα, arerelated to the quantiles of the distribution and are easilycalculated

VaRα = F−1(α|λ) (4)

= λ1 +αλ3 − (1− α)λ4

λ2

ESα =

∫ VaR

−∞xf (x |λ)dx =

∫ α

0F−1(p|λ)dp (5)

= λ1α+1

λ2(λ3 + 1)αλ3+1 +

1

λ2(λ4 + 1)

[(1− α)λ4+1 − 1

]

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 80: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Fitting Methods

Many methods have been proposed including

the method of moments, [Ramberg et al., 1979]least squares, [Ozturk and Dale, 1985]fitting using percentiles, [Karian and Dudewicz, 1999]search routines, [King and MacGillivray, 1999]fitting using L-moments, [Asquith, 2007]histogram fitting, [Su, 2005]maximum likelihood, [Su, 2007]

Combinations of methods have been suggested to deal withthe problem of finding starting solutions for optimization, forexample [Su, 2007]

Combination approaches seem the most sensible

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 81: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Fitting Methods

Many investigators nonetheless seem to suggest using methodof moments

Nonsensical in our case when moments of order 4 or even lesscan be infinite

Percentile methods and L-moments are usable

We have implemented a variation to these approaches usingrobust moments as investigated by [Kim and White, 2004]

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Robust Moments

The first two robust moments are the median, µr andinterquartile range, σr

The next two moments are the robust skewness and kurtosis,sr and κr

µr = π1/2

σr = π3/4 − π1/4

sr =π3/4 + π1/4 − 2π2/4

π3/4 − π1/4

κr =π7/8 − π5/8 + π3/8 − π1/8

π6/8 − π2/8

(6)

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 82: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Robust Moments

There are the obvious estimators where pq indicates thesample qth quantile and the hat that the statistic is a samplequantity:

µr = p1/2

σr = p3/4 − p1/4

sr =p3/4 + p1/4 − 2p2/4

p3/4 − p1/4

κr =p7/8 − p5/8 + p3/8 − p1/8

p6/8 − p2/8

(7)

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Fitting Using Robust Moments

Defining Sλ3,λ4(p) as

Sλ3,λ4(p) = S(p|λ3, λ4) = pλ3 − (1− p)λ4 (8)

sr and κr are independent of λ1 and λ2:

µr = λ1 +Sλ3,λ4(1/2)

λ2

σr = −Sλ3,λ4(3/4)− Sλ3,λ4(1/4)

λ2

sr =Sλ3,λ4(3/4) + Sλ3,λ4(1/4)− 2Sλ3,λ4(1/2)

Sλ3,λ4(3/4)− Sλ3,λ4(1/4)

κr =Sλ3,λ4(7/8)− Sλ3,λ4(5/8) + Sλ3,λ4(3/8)− Sλ3,λ4(1/8)

Sλ3,λ4(6/8)− Sλ3,λ4(2/8)

(9)

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 83: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Fitting Using Robust Moments

We first estimate λ3 and λ4 by inverting the nonlinearequations:

sr = sr (λ3, λ4)

κr = κr (λ3, λ4).(10)

Then

λ2 = −Sλ3,λ4(1/2)

σr(11)

and

λ1 = µr −Sλ3,λ4(3/4)− Sλ3,λ4(1/4)

λ2(12)

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Fitting Using Robust Moments

This approach is very similar to the method of momentsapproach originally suggested by [Karian et al., 1996], butallows for the case of infinite moments

Also similar to the percentile and L-moments methods butmore stable and intuitive than the percentile approach (wherethe use of 0.1 and 0.9 percentile estimates is often suggested),and simpler and more intuitive than the use of L-moments

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 84: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

The Data Set

The NASDAQ-100 Index includes 100 of the largest USdomestic and international non-financial securities listed onthe Nasdaq Stock Market based on market capitalizationWe expect the distributions of returns to be heavy tailedSince the index composition has changed over time, thelengths of the time series vary—record lengths are shownbelow:

0 20 40 60 80 100

020

0060

00

Leng

th

Number of Daily Records

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 85: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Stock Symbols for the NASDAQ-100

AAPL ADBE ADP0 ADSK AKAM ALTRAMAT AMGN AMZN APOL ATVI BBBYBIDU BIIB BRCM CA00 CELG CEPHCHKP CHRW CMCSA COST CSCO CTASCTSH CTXS DELL DISH DTV0 EBAYERTS ESRX EXPD EXPE FAST FISVFLEX FLIR FSLR FWLT GENZ GILDGOOG GRMN HANS HOLX HSIC IACIILMN INFY INTC INTU ISRG JAVAJBHT JNPR JOYG KLAC LBTYA LIFELINTA LLTC LOGI LRCX MCHP MICCMRVL MSFT MXIM NIHD NTAP NVDANWSA ORCL ORLY PAYX PCAR PDCOPPDI QCOM RIMM ROST RYAAY SBUXSHLD SIAL SPLS SRCL STLD STX0SYMC TEVA URBN VRSN VRTX WCRXWYNN XLNX XRAY YHOO

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Skewness and Kurtosis vs. Shape Parameters

The package akima was used to fit akima splines tonumerically invert the map from λ3 and λ4 to sr and κr

Estimates of λ3 and λ4 for the NASDAQ-100 equities werederived from the robust quantile estimates

Results are displayed on the next slide

The upper two graphs show scatterplots for the robust sampleskewness and kurtosis on top of an image and contour plot forthe parameter estimates λ3 and λ4. The correlation ellipsecontains 90% of the data.

The lower two graphs show the inverted map plotting theparameter estimates λ3 versus λ4. Here the contours showconstant levels of the skewness and kurtosis. The dotsrepresent the NASDAQ equities and the closed line thecorrelation transformed ellipse. The diagonal line representsthe case of symmetric GLDs.

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 86: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Skewness and Kurtosis vs. Shape Parameters

−0.6 −0.4 −0.2 0.0 0.2 0.4 0.6

1.4

1.6

1.8

2.0

2.2

2.4

2.6

lambda 3

Skewness

Kurto

sis

−0.25

−0.5

−0.75

−1

−1.25

● ●●●

●●

●●

●●●

●●

●●●

●●●

●●

●●

●●

●●

●●● ●

●●

●●●

●●●

●●

●●

●●

● ●●●

●●

●●●

●●●●●

●●●● ●●

−0.6 −0.4 −0.2 0.0 0.2 0.4 0.6

1.4

1.6

1.8

2.0

2.2

2.4

2.6

lambda 4

Skewness

Kurto

sis

−0.25

−0.5

−0.75

−1

−1.25

● ●●●

●●

●●

●●●

●●

●●●

●●●

●●

●●

●●

●●

●●● ●

●●

●●●

●●●

●●

●●

●●

● ●●●

●●

●●●

●●●●●

●●●● ●●●

−1.4 −1.0 −0.6 −0.2

−1.4

−1.0

−0.6

−0.2

Skewness

−0.5 −0.4 −0.3 −0.2

−0.1 0

0.1 0.2

0.3 0.4

0.5

lambda 3

lam

bda

4

●●

●●

●●

●●

●●

●●

●●●●

● ●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●●

●●

●●●●●

●●

● ●

−1.4 −1.0 −0.6 −0.2

−1.4

−1.0

−0.6

−0.2

Kurtosis

1.4

1.6

1.8

2

2.2

2.4

2.6 2.8

2.8

2 8

lambda 3

lam

bda

4

●●

●●

●●

●●

●●

●●

●●●●

● ●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●●

●●

●●●●●

●●

● ●

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Results

Fourth moments exist only for equities for which both λ3 andλ4 are greater than −0.25The variance exists only for equities for which both λ3 and λ4are greater than −0.5We observe

for a reasonable number of equities, the fourth moment existsfor the bulk of the equities, at least the variance existsfor some of the equities, the variance does not exist

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 87: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Optimization

The robust method of moments approach only constitutes thefirst stage of fitting the GDL to a data set

We considered a number of approaches to optimizing the fit,using the robust method of moments estimates as a startingpoint

histogram methodsgoodness of fit criteriamaximum likelihoodmaximum product spacing

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 88: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Optimization

Histogram methods vary according to the way breaks arechosen. We used the choice of breaks due to Freedman andDiaconis

There are many goodness of fit measures which have beenused for fitting distributions. We used the Anderson-Darlingstatistic

Maximum product spacing does not appear to have been usedpreviously with the GLD

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Optimization Example: Google

●●●

●●

●●

●●

●●●

●●

●●●●

●●

●●

●●●

●●●●

●●●

●●

−10 −5 0 5 10 15

−8−6

−4−2

x

log

f(x)

GOOG Parameter Estimation

Results from the MLE (blue), MPS (red), AD (orange), and FD(green) approaches. The full lines are drawn from the fitteddistribution function and the points are taken from a kernel densityestimate of the simulated series.

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 89: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Results

We observe that there is very little difference discernablebetween the goodness of fit (AD) and MPS approaches

The MLE fit differs from AD and MPS in the tails by a smallamount

The tail fit for the histogram (FD) approach is substantiallydifferent in the upper tail.

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 90: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Simulating Financial Returns

To simulate a set of typical financial returns we used the GLDdistribution with sampled λ parameters

First note that the inter-quartile range and the tail relatedshape parameters are highly correlated

We introduced a modified set of parameters {λ1, λ2, δ, β}where δ = λ3 − λ4, and β = λ3 + λ4

Then the only substantial correlations are λ1 with δ and λ2with β

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Correlation

lambda1

● ●●

●●

●●●

● ●

●●

●●

● ●●

●● ●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●●●

●●

●●

●●●

lambda2

●●●

●●

●●

●●

●●

● ●

●● ●

●●

●●

●●

●●

●●

● ●●

●●●●

●● ●●

●●●●

●●

●●

●●●

●●●●● ●

●● ●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

● ●●

●●●●

●● ●●

●●●●

●●

●●

●● ●

●●●

●● ●

lambda3

●●● ●●

●●●

●●

●●

● ●

●●

●●

●●●

● ●

●● ●

●●●

●●

●●

●●

●●

●●●

●●●

●● ●●●

●●●

●●

●●●

●●

●●

●●

●●●

●●

●● ●●

●● ●

●●

●●

●●

●●

●●●

●●

● ●●●●

●●●●

●●

●●●

●●

●●

● ●

● ●●

●●

●●●

●●●

●●

●●●

●●

●●

●●●

●●●

lambda4

Tail Index Parameterization

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 91: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Correlation

lambda1

● ●●

●●

●●●

● ●

●●

●●

● ●●

●● ●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●●●

●●

●●

●●●

lambda2

● ●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●●

●●

●●

●●

● ●

●●

● ●●

●●

●●

●●

●●

●●

● ●

●●

● delta

●●●

●●● ●

● ●

●●

●●

● ●●

●●

●●

●●

● ●

●●

●●

●● ●●

●●●

●●

●●●●

● ●

●●

●●●

●●

●●

●●

●● ●

●●● ●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●● ●●

●● ●●●

●●●●

● ●

●●

●● ●

●●

●●

●●

●● ●

●●● ●

● ●

●●

●●

● ●●

●●

●●

●●

● ●

●●

●●

●● ●●

●●●

●●

●●●●

● ●

●●

●● ●

●●

●●

●●

beta

Skewness/Kurtosis Parameterization

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Parameter Simulation

Estimate the median, the inter-quartile range, and the robustskewness and kurtosis parameters from the 100 NASDAQequities, and obtain the sample λ1, λ2, δ and βs.

Compute from the parameters λ1, λ2, β, and δ densityestimates using the smoothing spline ANOVA approach of[Gu, 2002] and [Gu and Wang, 2003]

Estimate the dependency structures of λ1 vs. δ and λ2 vs βfrom two bivariate Gaussian copulas

Generate random variates for the probabilities from thecopulas and compute from the marginal distributions theparameters λ1, λ2, δ, and β. λ3 and λ4 are recalculated fromδ and β

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 92: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Marginal Parameters

lambda 1

s

Den

sity

−0.6 −0.2 0.0 0.2 0.4 0.6

01

23

4

delta

s

Den

sity

−0.08 −0.04 0.00 0.04

05

1015

2025

lambda 2

s

Den

sity

−1.0 −0.8 −0.6 −0.4 −0.2 0.0

01

23

45

beta

s

Den

sity

−0.7 −0.5 −0.3 −0.1

01

23

4

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Copula Simulation

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

● ●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●●

●●

●●

● ●●

● ●

●●

●●

●●

●●

●●

●●

● ●

●●

● ●

● ●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

● ●

●●

● ●

●●

●●

●●

● ●

● ●

−0.4 −0.2 0.0 0.2 0.4

−0.0

8−0

.04

0.00

0.02

0.04

Correlation: lambda 1 | delta

r | lambda 1

r | d

elta

●●

●●

●●

● ●

●●

●●

●●

● ●

●●

●●

●●

●●

● ●

● ●

●●

●●

●●

● ●

● ●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

Copula: lambda 1 | delta

p | lambda 1

p | d

elta

●●

● ●

●●

● ●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ● ●

●●

●● ●

●●●

●●

●●

● ●

● ●

●●

● ●

●●

●●

●● ●

●●

●●

● ●

●●●

●●

●●

●●

●●

●●●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

−0.8 −0.6 −0.4 −0.2 0.0

−0.6

−0.5

−0.4

−0.3

−0.2

−0.1

Correlation: lambda 2 | beta

r | lambda 2

r | b

eta

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

● ●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

● ● ●

●●

●●●

●●●

●●

● ●

● ●

● ●

● ●

●● ●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

Copula: lambda 2 | beta

p | lambda 1

p | b

eta

●●

● ●

●●

● ●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

● ●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

● ●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

● ●

● ●

● ●

●●

●●

●●

●●

●●

●●

●●

● ●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

● ●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

● ●●●

●●

● ●

●●

●●●

−0.4 −0.2 0.0 0.2 0.4

−0.8

−0.6

−0.4

−0.2

0.0

Correlation: lambda 1 | lambda 2

r | lambda 1

r | la

mbd

a 2

●●

●●

●●

● ●

●●

●●

●●

●●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

● ●

●●

● ●

●●

●●

● ●

●●

●●

●●

●●

● ●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

● ●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

● ●●

●●

●●

● ●

●●

●●

● ●●

●●

● ●

●●

●●

−0.6 −0.5 −0.4 −0.3 −0.2 −0.1

−0.6

−0.5

−0.4

−0.3

−0.2

−0.1

Correlation: lambda 3 | lambda 4

r | lambda 1

r | la

mbd

a 2 ●

●●

● ●

●●

●●

●●

●●●

●●

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 93: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

1 Introduction

2 Fitting the Generalized Lambda Distribution

3 The NASDAQ-100

4 Parameter Optimization

5 Simulating Financial Returns

6 Conclusions

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Conclusions

The generalized lambda distribution is useful in fitting thedistribution of returns for equities

It is easier to use and the results are more informativecompared to the use of the stable distribution

It is possible to realistically simulate financial returns usingthe generalized lambda distribution

Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 94: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outline Introduction Fitting The NASDAQ-100 Optimization Simulating Financial Returns Conclusions

Bibliography

Asquith, W. H. (2007).L-moments and TL-moments of the generalized lambdadistribution.Computational Statistics & Data Analysis, 51(9):4484–4496.

Gu, C. (2002).Smoothing Spline ANOVA Models.Springer Series in Statistics. Springer-Verlag, New York.

Gu, C. and Wang, J. (2003).Penalized likelihood density estimation: Direct cross-validationand scalable approximation.Statistica Sinica, pages 811–826.

Hastings, C., Mosteller, F., Tukey, J. W., and Winsor, C. P.(1947).Low moments for small samples: A comparative study of orderstatistics.Th A l f M h i l S i i 18(3) 413 426Yohan Chalabi, David Scott, Diethelm Wurtz Generalized Lambda

Page 95: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 96: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 4

MARC PAOLELLA

82

Page 97: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

An Asymmetric Multivariate Student's t Distribution Endowed with Different Degrees of Freedom

Marc S. Paolella

Swiss Banking Institute University of Zurich Zurich, Switzerland

An open and active question concerns the construction of a multivariate distribution whose marginals are Student's t but with potentially different degrees of freedom. This is of particular value in empirical finance, where it is well known that the tail indices, or maximally existing moments of the returns, differ markedly across assets. While several constructions can be found in the literature, all have weaknesses. In this paper, we propose a new construction, which is also easily endowed with a different asymmetry parameter for each marginal. While the computation of the density via the definition is possible but time-consuming, thus prohibiting direct calculation and optimization of the likelihood, we discuss how the method of indirect inference can be used. An example using series comprising the DJIA is illustrated.

Page 98: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 99: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

PART II

FRIDAY AFTERNOON

85

Page 100: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 5

VIKRAM KURIYAN

86

Page 101: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Global Financial Crises of 2008-2009

Vikram Kuriyan

K3 Advisors, New York

We will present an analytical approach that takes an investment management point of view to look at the financial landscape. This talk will focus on the path of the crisis, trace the mechanisms through which the crisis was transmitted globally and offer some ideas for the future. We will aim to understand the drivers of bank balance sheet exposures that are the drivers of this crises. We will also look at bank balance sheets from the eye of a derivative trader to demonstrate that the banking system has implicit but often not well-understood asymmetric payoff structures and how a deep understanding of derivatives can make the banking system less fragile. We will also examine the role of regulators and rating agencies as inadvertent catalysts for this particular collapse. Lastly, we will offer some suggestions for the future.

Page 102: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Reflections�on�the�current�financial�crisis:

Banking,�Credit��and�PanicSingapore�2010

sponsored�by�

ETH�Zurich

Risk�Management�Institute,�National�University�of�Singapore

Current�Environment

A�Quick�Review:

� We�are�coming�off�of�the�greatest�global�economic�contraction�since�the�Great�Depression

� Massive�governmental�intervention�was�necessary�to�prevent�large�parts�of�the�global�financial�system�from�collapsing

� United�States� United�Kingdom� Iceland�� Dubai� Greece

Page 103: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

In�Other�Words…

Unprecedented�Collapse�PLUS

Unprecedented�Government�Support�EQUALS

Unprecedented�Changes�in�Asset�Valuations

Will�the�future�be�a�repeat�of�the�70’s….or�a�repeat�of�the�lost�decades�in�Japan?

Outline�of�talk

• Theory

• Multiple�Models

• Bank�Stocks�in�an�asset�allocation

• Credit�as�a�Put�Option

• Demand�deposit�as�a�de4stabilizer

• Practice

• This�present�crisis

• Robust�Systems

Page 104: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Multiple�Models

• You’ve�got�to�have�models�in�your�head.�And�you’ve�got�to�array�your�experience,�both�vicarious�and�direct,�on�this�latticework�of�models.�– Charles�Munger.

As�a�practitioner,Asset�Allocation�is�the�starting�point

• Real�money�– individuals�through�institutions�– typically�allocate�and�re4balance�capital�within�the�framework�of�a�long�term�asset�allocation�strategy.

• The�Endowment�model�(Harvard�and�Yale)�is�a�good�prototype

Page 105: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Tradeoff�Return�vs�Risk

• The�core�asset�classes�– Stocks– Bonds– Real�Assets�(including�real�estate,�commodities,…)– Hedge�Funds– Private�Equity

• Think�about�Risk�of�each�segment:�Volatility,�correlations,�macro�environments,�leverage,�fat�tails.

• Think�about�Risk�in�a�portfolio�context.

Bank�stocks�as�an�investment�management�allocation

• Undiversified• Fat�tail�risk• Highly�levered• Fund�themselves�with�hot�money• Own�a�lot�of�illiquid�assets• Accrual�Accounting• Similar�exposures�to�peers• Herd�behaviour extrapolating�the�past�into�the�future�(historical�VaR,�historical�default�rates,…)

Source: Bridgewater Daily Observations 12/3/2008

Page 106: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Typical�Bank�Capital�Structures

Source: Bridgewater Daily Observations 12/3/2008

Macro�exposures�of�typical�bank

Source: Bridgewater Daily Observations 12/3/2008

Page 107: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Simulation�from�Monthly�Rebalancing

Source: Bridgewater Daily Observations 12/3/2008

Source: Bridgewater Daily Observations 12/3/2008

Page 108: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Asset�Sales�to�keep�leverage�constant

Source: Bridgewater Daily Observations 12/3/2008

Simulation�from�Annual�Rebalancing

Source: Bridgewater Daily Observations 12/3/2008

Page 109: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Source: Bridgewater Daily Observations 12/3/2008

Now�throw�in�implicit�derivative�exposures:Merton�Model�for�Risky�Debt

• Credit�=�Risk�Free�Debt�– Guarantee

• Credit�=�Risk�Free�Debt�4 Put(Asset,�strike�price)

• All�credit�=�Risk�Free�Debt�+�Short�Put�Option

• …

• Applies�to�all�credit:�corporate�debt,�cards,�Mortgages,��…�and,�in�particular,�accrual�books

Page 110: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Now�throw�in�implicit�derivative�exposures:Merton�Model�for�Risky�Debt

Now�throw�in�implicit�derivative�exposures:Merton�Model�for�Risky�Debt

• Applies�to�all�credit:�corporate�debt,�CDS,�Mortgages,�…

• As�derivative�modellers,�you�know�that�the�put�delta�goes�up�as�the�asset�price�collapses�and�so�risk�goes�up�too.

• Already�have�4�decades�of��experience�with�derivative�models�to�explain�what�went�on�and�what�can�happen�!!

• Do�not�need�new�models�or�technologies�to�analyze�risk

• Derivative�models�explain�how�bank�equity�will�behave�in�times�of�stress.

Page 111: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Bank�Runs�and�Nash�Equilibria

• The�structure�of�the�demand�deposit�contract�can�induce�a�bank�run�as�a�stable�equilibrium!�Prisoners�Dilemma:�

D/D D/R

R/D R/R

Bank�Runs�and�Nash�Equilibria

• Powerful�model�of�how�runs�can�“just�happen”�– no�reasons�required.�Just�need�changes�in�mass�psychology.�

D/D D/R

R/D R/R

Page 112: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Flawed�Portfolio�Structures

• Rely�on�government�backing�for�deposits• Rely�on�Accrual�Accounting• No�explicit�of�modelling of�credit�risk�as�being�short�a�put�option

• ….• Given�this�structure,�stress�has�to�be�expected• The�only�question�is�the�timing�and�the�severity.�(Not�a�Black�Swan).

Flawed�Portfolio�Structures

• How�much�capital�would�a�hedge�fund4of4fund�allocator�put�out�to�risk�in�such�portfolio�structures?

• How�much�credit�should�CEOs’�of�such�structures�take�as�their�own?

• ….

• How�do�we�make�the�system�more�robust?

Page 113: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Robust�Systems

• “it�is�the�exposure�(or�payoff)�that�creates�the�complexity�—and�the�opportunities�and�dangers— not�so�much�the�knowledge�(�i.e.,�statistical�distribution,�model�representation,�etc.)”��Nassim�Taleb�in�http://www.edge.org/3rd_culture/taleb08/taleb08_index.htm

Finance�Companies�with�simple�structures

• Asset�Management�companies

• Money�Market�funds�with�variable�NAVs

• Highly�Regulated�retail�banks�(utilities)

• Islamic�Banks

Page 114: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Animal�Spirits

• 2007�RBS�paid�$100�billion�– mainly�in�cash�–to�buy�ABN�Amro

• A�year�later,�you�could�buy– Citibank�(20b),�Morgan�Stanley�(11b),�Goldman�Sachs�(20b),�Deutsche�Bank�(13b),�Barclays�(13b),�

• And�still�have�change�left�over

This�particular�crisis

Page 115: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

This�particular�crisis

• “Virtually�everybody�in�the�country�had�this�model�in�their�heads,�formal�or�otherwise,�that�house�prices�could�not�fall�significantly.”�Warren�Buffett

This�particular�crisis

• Collapse�of�a�housing�bubble

• New�types�of�mortgage�products�added�fuel�to�propel�the�housing�bubble

• http://www.youtube.com/watch?v=mzJmTCYmo9g

Page 116: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

This�particular�crisis

• Excessive�reliance�by�investors�and�regulators�on�rating�agencies

• Credit�Rating�trumped�due�diligence

This�particular�crisis

• Excessive�leverage�permeated�the�system– Hedge�funds

– Private�Equity

– Banks�(especially�acquisitive�banks)

– Non4bank�finance�sector�particularly�mortgage�related

– Pensions�and�Endowments�by�committing�to�future�purchases�of�private�equity

Page 117: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

This�particular�crisis

• “Run”�on�capital�markets

• Money�Market�funds�withdrew�from�CP�market�after�Lehman�collapse

• Bond�funds�pulled�back�from�direct�lending�to�corporations

• Repo�margin�requirements�changed�dramatically

• “Shadow�banking”�came�to�a�virtual�halt

Crisis�PicturesNegative�Swap�Spreads/Limits�of�Arbitrage

Page 118: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Crisis�PicturesVolkswagen

• VoW

This�Particular�Crisis:�Regulators

• FNM�and�FRE�had�one�regulator,�OFHEO,�to�themselves

• SEC�– Failed�to�find�Madoff�even�when�presented�to�them�by�Harry�Markopoulos

http://www.deepcapture.com/

• FINRA�– Madoff�and�his�brother�were�on�the�board�of�directors

Page 119: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

This�particular�Crisis:There�is�nothing�new�under�the�sun

• A�Minsky�moment is�the�point�in�a�credit�cycle or�business�cycle when�investors�have�cash�flow�problems�due�to�spiraling�debt�they�have�incurred�in�order�to�finance�speculative�investments.�At�this�point,�a�major�selloff�begins�due�to�the�fact�that�no�counterparty can�be�found�to�bid�at�the�high�asking�prices�previously�quoted,�leading�to�a�sudden�and�precipitous�collapse�in�market�clearing�http://en.wikipedia.org/wiki/Minsky_moment

• Bank�Runs,�Nash�Equilibria and�Self4Fulfilling�Prophecy�– John�Nash,�Robert�K�Merton

Derailed�by�De4regulation�Robust�Systems:�As�a�policy�maker

• Highly�regulated�banks?

• Small�banks�?�– No�systemic�effect�when�the�neighborhood�restaurant�goes�out�of�business

• Global�banks?

• Global�regulators�?

• Basel�3�?

• What�about�unregulated�entities�– hedge�funds,�insurance�companies�?

Page 120: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Robust�Systems:Talebs rules�for�a�black4swan�free�

world• More�regulation?�No

• Small�banks?�Yes.

• No�socialization�of�losses�and�privatization�of�gains

• Do�not�let�someone�with�an�“incentive”�bonus�manage�a�nuclear�plant�– or�a�bank

• Minimize�complexity.�Minimize�leverage.�Embrace�simplicity.

Robust�Systems:�Simplicity• Get�rid�of�stable�NAV�products.�Introduce�variable�NAV�money�market�funds.�This�will�stabilize�the�shadow�banking�system.

• Any�entity�that�receives�an�implicit�or�explicit�government�guarantee�(eg:�Retail�bank)�must�face�restrictions�on�size,�activity�and�geography.

• Separate�risk4taking�(eg:�investment�banks)�from�commercial�banks.�Glass4Steagall was�a�good�idea.

• Encourage�hedge�funds�as�the�vehicle�for�risk�taking.�Monitor�and�limit�their�leverage�and�size.

• Put�derivative�experts�on�the�boards�of�banks.

Page 121: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Robust�Systems:�As�an�investor

• As�an�investor,�you�have�the�ability�to�avoid�this�issue�completely�!

• Avoid�Fat�Tailed�Risk• Diversify• “When�a�management�with�a�reputation�for�brilliance�tackles�a�business�with�a�reputation�for�bad�economics,�it�is�usually�the�reputation�of�the�business�that�remains�intact.�You�should�invest�in�a�business�that�even�a�fool�can�run,�because�someday�a�fool�will.”�4 Warren�Buffett

End:�On�a�positive�note

� A�Global�Migration�Toward�A�Capitalistic�Economy:�Russia,�Eastern�Europe,�China,�Brazil,�India,�etc.

� Improvement�in�Decisions�by�Policymakers�� “We�are�all�Keynesians’�now.”

� Central�Bank�Response�to�2007/2008�Credit�Crises

� Increased�Coordination�Across�Regulatory�Entities:

� Bank�Regulatory�Standards�with�new�Basel�requirements

� Scenario�Analysis�and�Stress�Testing

� Caveat:�Be�cautious�about�all�fat4tailed�stress�tests

Page 122: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

References

• Bank�Runs,�Deposit�Insurance,�and�Liquidity�by�Douglas�Diamond,�Philip�Dybvig The�Journal�of�Political�Economy�Vol.�91,�No.�3.�1983�.

• Bridgewater�Daily�Notes�12/03/2008

• JPM�2008�Annual�Report

• Niall�Ferguson,�“The�Ascent�of�Money”

• Robert�Merton,�MIT�OpenWorld lecture�http://mitworld.mit.edu/video/659

• Vikram�Kuriyan,�Essays�on�Destabilizing�Events�in�Financial�Markets,�1991.

The�Role�of�Risk�Management

�Crisis�has�demonstrated�the�need�for�stress��testing�and�scenario�analysis�at�every�level�of�the�economy.

�Wisdom�is�when�you�start�looking�beyond�the�numbers�to�causal�relationships�and�to�understand�when�structural�breaks�can�occur.

Page 123: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Risk�Taxonomy

We�categorize�risks�by�the�nature of�their�origin�and�the�frequency of�occurrence.

The�fundamental�categories�are�

• Transactional�Risk

• Operating�Risk

• Episodic�Risk

Risk�Taxonomy�in�more�detail

• Transactional�Risk– Market�Risk

– Credit�Risk

• Operational�Risk

• Episodic�Risk– Liquidity�Risk

– Strategic�Risk

– Macroeconomic�Risk

Page 124: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Transactional�Risks

Market�Risk Credit�Risk

+

Episodic�Risks

Liquidity�Risk

Operational�Risk

Strategic�RiskMacro4

economic�RiskBlack�Swan

Risk

+

Operating�Risks

GARP Functional Taxonomy of Risk Factors

Historical�Data�Analysis�4 Objective

• To�obtain�a�yardstick�against�which�market�risk�situations�can�be�compared

• To�analyze�historical�data�in�order�to�obtain�plausible�stress�situations

• To��obtain�the�stress�levels�after�historical�financially�catastrophic�events

Page 125: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Sample�Data

20�year�daily�data�of�

• 14�major�stock�indices�&�4�commodities�

• 30�major�currencies�

• 26�interest�rates�in�16�major�currencies

• 36�swap�rates�in�20�major�currencies

Data�Analysis

• Calculation�of�daily,�weekly,�monthly,�quarterly,�semi4annual�and�annual�returns�on�a�rolling�basis

• Statistical�analysis�of�data

• Classification�of�fluctuations�into�business4as4usual,�mild�stress,�moderate�stress,�extreme�stress,�and�historical�worst�case

Page 126: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Stress�Scenario�Classification

• Median�=�business�as�usual

• 1�Q =�mild�stress

• 2�Q =�moderate�stress

• 3�Q =�extreme�stress

• Historical�low=�worst�case�scenario

Stress�Events�Analysis

Data�analyzed�for��3�major�stress�events

• Black�Monday

• 9/11�&�subsequent�recession�

• Lehman�Bankruptcy

Maximum�drawdown�in�1�week,�1�month,�1�quarter,�6�months�and�1�year�from�trigger�event�measured�to�analyze�impact�of�event

Page 127: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Weekly�Swap�rate�movement

InstrumentBusiness�as�Usual

Positive�Fluctuation Negative�Fluctuation

Mild Moderate ExtremeHistorical�maximum

Mild Moderate ExtremeHistorical�maximum

AUD�IR�SWAP10�YEAR��

� 0 10 19 29 71 �10 �19 �29 �67AUD�IR�SWAP2�YEAR��

� 0 10 19 29 88 �10 �19 �29 �79CAD�IR�SWAP1�YEAR

� 0 7 13 20 56 �7 �13 �20 �72CAD�IR�SWAP10�YEAR��

� 0 8 17 25 48 �8 �17 �25 �47CHF�IR�SWAP10�YEAR��

� 0 6 11 17 42 �6 �11 �17 �37DEM�IR�

SWAP�1�YEAR� 0 4 9 13 23 �4 �9 �13 �23DEM�IR�SWAP�10�YEAR�� 0 6 12 18 37 �6 �12 �18 �35DKK�

INTERBANK�3MONTH

� 0 5 10 15 55 �5 �10 �15 �56DKK�IR�SWAP10�YEAR��

� 0 7 14 21 42 �7 �14 �21 �55

Swap�rates�during�stress�events

Black�Monday 9/11�&�subsequent�recession Lehman�Bankruptcy

Instrument

October�19874March�1988 September�20014 February�2002 September�20084February�2009

Highest�1�week�deviation�for��time

period�

Highest�drawdown�in�1�week�from�event

Highest�1�week�deviation�for��time

period�

Highest�drawdown�in�1�week�from�event

Highest�1�week�deviation�for��time

period�

Highest�drawdown�in�1�week�from�event

DEM�IR�SWAP�10�YEAR�� 25 40 27 7 36 21

GBP�IR�SWAP�10�YEAR�� 44 46 26 7 35 12

HKD�INTERBANK�3�MONTH�� 232 63 33 38 100 86

NOK�INTERBANK�3�MONTH�� 112 26 47 27 71 53

SGD�INTERBANK�3�MONTH�� 50 50 25 19 19 13

EURO�INTERBANK�3MONTH

� � � 36 46 11 7USD�IR�SWAP�10�

YEAR�� 131 126 45 22 47 29

Page 128: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

In�times�of�trouble…• In a crisis, uncorrelated assets can become

correlated, as we saw in the volatile summer of 2007

High Yield EM Financial Mtl & Mining USD vs.Bonds Stocks Stocks Stocks JPY AVG

July 99% 100% 99% 95% 80% 95%Hist Average -8% 53% 36% 26% -2% 21%

* Rolling 3m Correlations to the S&P 500 since 1970

Correlation to S&P 500 Index*

Risk�Management�versus�Uncertainty�Management

• Frank�Knight�1921– “Uncertainty�must�be�taken�in�a�sense�radically�different�from�the�familiar�notion�of�Risk”

– “A�measurable uncertainty,�or�Risk�….�Is�so�far�different�from�an�unmeasurable one”

• Finance�Profession�needs�to�move�more�toward�embracing�the�possibility�of�black�swans�and�coming�up�with�responses�to�extreme�events�and�less�enamoured with�the�precision�of�risk�reports

Page 129: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Risk�Management

• Real�money�– individuals�through�institutions�– typically�allocate�and�re4balance�capital�within�the�framework�of�a�long�term�asset�allocation�strategy.

• Rapid�changes�in�the�entire�asset4allocation�pie�is�a�potential�cause�of�stress.

Risk�Management

• The�core�asset�classes�– Stocks– Bonds– Real�Assets�(including�real�estate,�commodities,…)– Hedge�Funds– Private�Equity

• All�of�the�above�must�be�monitored.�Bubbles/depressions�in�any�one�asset�class�can�point�to�the�next�source�of�stress

• Concentration�and�over4crowding�in�any�one�asset�class�is�also�a�point�of�stress– Source�of�risk�in�of�themselves– Multiplier�effects�through�credit�extended�on�collateral

Page 130: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Risk�Management

• The�dangerous�“bubble”�asset�classes�– Equities

– Debt

– Real�Assets�(including�real�estate,�commodities,…)

• Debt�bubbles�(credit�traps)�tend�to�be�the�most�dangerous�because�it�is�the�least�observable

Other�sources�of�risk

• Macro�Environment– Inflation,�deflation

– Growth,�recession

– Normal�credit�cycle,�credit4deflationary�bust

• Long�cycle�times

• Stress�points�are�few�and�far�between

• Not�enough�data�to�model�robustly

Page 131: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Other�sources�of�risk

• Catastrophe�Risk– Weather�(Hurricanes)– Earthquakes– Wars– Terrorism

• Will�affect�real�economy�through�liquidity�demands,�asset�prices,�systemic�collusion

• Poisson�processes,�hard�to�model,�but�real�and�inevitable

Collapse by�Jared�Diamond�

• Diamond’s�celebrated�book�– which�added�to�the�reputation�he�earned�through�Guns,�Germs�and�Steel, a�Pulitzer�prize4winner�about�why�some�societies�triumph�over�others�–sought�to�discover�what�makes�civilisations,�many�at�their�apparent�zenith,�crumble�overnight.�The�Maya�of�Central�America,�the�stone4carving�civilisation of�Easter�Island,�and�the�Soviet�Union�– all�suddenly�shattered.

Page 132: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Societal�Risk:�Overfishing

• “If�I�was�Japan’s�worst�enemy�trying�to�figure�out�a�strategy�to�drive�it�into�a�crisis�in�10�years’�time,�my�strategy�would�be�to�get�the�Japanese�to�do�exactly�what�they�are�doing,�which�is�to�over4harvest�their�main�source�of�protein.”�Humans’�ability�to�destroy�the�basis�of�their�own�livelihood�is�a�recurring�Diamond�theme.

Societal�Risk:�Over4consumption

• “There�is�a�parallel�based�on�the�same�fundamental�mechanisms�of�the�economic�collapse�that�we’re�seeing�now�and�the�collapse�of�past�civilisations such�as�the�Maya,”�he�continues.�“The�message�is�that�when�you�have�a�large�society�that�consumes�lots�of�resources,�that�society�is�likely�to�collapse�once�it�hits�its�peak.”

Page 133: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Societal�Risk:�Over4consumption

• “The�average�per4person�consumption�rate�in�the�first�world�of�metal�and�oil�and�natural�resources�is�32�times�that�of�the�developing�world,”�says�Diamond.�“That�means�that�one�American�is�consuming�like�32�Kenyans.”�The�problem�is�not�the�number�of�Kenyans,�the�problem�is�when�Kenyans�or,�more�pressingly,�big�developing�countries�such�as�China,�gain�the�ability�to�consume�like�Americans.

Page 134: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 6

BERNARD LEE

120

Page 135: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

An Analysis of Extreme Price Shocks and Illiquidity Among Systematic Trend Followers

Bernard LeeSingapore Management University - School of Economics

Shih-Fen ChengSingapore Management University - School of Information Systems

Annie Koh Singapore Management University - School of Business

Abstract

We construct an agent-based model to study the interplay between extreme price shocks and illiquidity in the presence of systematic traders known as trend followers. The agent-based approach is particularly attractive in modeling commodity markets because the approach allows for the explicit modeling of production, capacities, and storage constraints. Our study begins by using the price stream from a market simulation involving human participants and studies the behavior of various trend-following strategies, assuming initially that their participation will not impact the market. We notice an incremental deterioration in strategy performance as and when strategies deviate further and further from the theoretical strategy of lookback straddles (Fung and Hsieh 2001), due to the negative impacts of transaction cost and imperfect execution. Next, the trend followers are allowed to participate in the market, trading against “uninformed” computer traders making randomized bids and offers. We notice that market prices begin to break down as the percentage of trend followers in the market reaches 80%. In addition, in a market dominated by “smart traders”, it becomes increasingly difficult for any of them to generate profits using what is supposed to be a “long gamma” strategy. After all, trading is a zero-sum game: It is not feasible for any “long gamma” trader to generate a consistent profit unless someone else is willing to be on the other side of his/her trades. In any such market dominated by “smart traders” with low liquidity and extreme price instability, one proposed solution (as proposed earlier by the U.S. Commodity Futures Trading Commission) is to control position size limits, by either decreasing them (in the original proposal) or increasing them (for completeness in our analysis). Based on our simulation results, we have found no evidence supporting that such a solution will be effective; in fact, doing so will only lead to erratic price behavior as well as a variety of practical issues when imposing such changes to position size limits. An alternative proposal is to intervene in the market direct/indirectly, such as by using a market maker to inject/reduce liquidity. Our simulation results show evidence that injecting and reducing liquidity by the market maker can both be effective. However, a market maker can accumulate a large negative P&L by buying in a one-sided, falling market in which it is the only bidder, or vice versa. Therefore, in practice, no market maker may volunteer to participate in any such “market rescue” efforts unless governments are willing to underwrite some of its large potential losses. In short, direct/indirect intervention by controlling liquidity is not a panacea, and there are practical limits to its effectiveness.

Page 136: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 7

KAM FONG CHAN

122

Page 137: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Spillover effect between the Credit Default Swaps (CDS) and the stock market using a general stochastic volatility with jumps model

Kam Fong Chan

Risk Analytics Division Risk Management Department United Overseas Bank (UOB) Ltd This paper investigates the time-series dynamics governing the credit default swap indices (CDX), and volatility and jump spillover between the stock and CDX markets. We use daily returns data on the S&P500 and Dow Jones CDX North American Investment Grade 5-year (CDX.NA.IG.5Y) indices over the period between June 1, 2004 and June 30, 2009. Our empirical evidence suggests the presence of two components - (i) diffusive stochastic volatility; and (ii) jumps in returns and volatility - in both the stock and CDX markets. Further, our results show that the contemporaneous correlation between the stochastic volatilities of both markets decreased during financial crisis, suggesting greater diversification benefits between the stock and CDX markets in periods of financial downturn. In addition we find evidence of strong bidirectional Granger-causality between the stochastic volatility in the stock and CDX markets during the crisis period. We find no evidence, however, to suggest lagged jumps in the CDX market predict jumps in the stock marketand vice versa.

Common work with Alastair Marsden from University of Auckland, New Zealand.

Page 138: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Stock and CDXK. F. Chan

Volatility and Jump Spillover Between Stock and CDX Markets: Evidence during Global Financial Crisis

Kam Fong Chan*

(United Overseas Bank, Singapore)

&

Alastair Marsden

(University of Auckland, New Zealand)

19 February 2010

* The views here are those of the authors and do not necessarily reflect the views of UOB Singapore.

United Overseas Bank

Introduction

Stock and CDXK. F. Chan

Outline of the presentation:

CDS and CDX

Graphical analysis

Objectives of the study

The model

Econometric method

Empirical results

Page 139: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Credit Default Swaps

Stock and CDXK. F. Chan

What are credit default swaps (CDS)?

A bilateral contract acting as an insurance against credit risk

Reference entity

Protection buyer Protection seller

CDS spread/premium

Credit Default Swaps

Stock and CDXK. F. Chan

What are credit default swaps (CDS)?

Reference entity

Protection buyer Protection seller

1 – recovery rate (%)

Credit event

Page 140: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Credit Default Swaps

Stock and CDXK. F. Chan

The CDS market between 2002 and 2009:

Credit event

-

10,000.00

20,000.00

30,000.00

40,000.00

50,000.00

60,000.00

70,000.00

Not

iona

l am

ount

(in

US

D$

billi

on)

1sthalf

2002

2ndhalf

2002

1sthalf

2003

2ndhalf

2003

1sthalf

2004

2ndhalf

2004

1sthalf

2005

2ndhalf

2005

1sthalf

2006

2ndhalf

2006

1sthalf

2007

2ndhalf

2007

1sthalf

2008

2ndhalf

2008

1sthalf

2009

Credit Default Swap Indices

Stock and CDXK. F. Chan

What are Credit Default Swap Indices (CDX)?

It tracks the default risk on a basket of credit entities

Represent changes in market perceptions of default risk

Provide important information to traders

Page 141: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Graphical Analysis

Stock and CDXK. F. Chan

0

50

100

150

200

250

30006

200

4

09 2

004

01 2

005

05 2

005

09 2

005

12 2

005

04 2

006

08 2

006

12 2

006

04 2

007

08 2

007

11 2

007

03 2

008

07 2

008

11 2

008

03 2

009

CDX

600

800

1000

1200

1400

1600

S&P5

00

CDXS&P500

Figure : Daily prices of S&P500 and CDX.NA.IG.5Y (CDX) between June 1, 2004 and June 30, 2009

Note: CDX.NA.IG.5Y refers to the Dow Jones CDX North American Investment Grade 5-Year index

Graphical Analysis

Stock and CDXK. F. Chan

-25-20-15-10-505

10152025

01 0

6 04

01 1

0 04

01 0

2 05

01 0

6 05

01 1

0 05

01 0

2 06

01 0

6 06

01 1

0 06

01 0

2 07

01 0

6 07

01 1

0 07

01 0

2 08

01 0

6 08

01 1

0 08

01 0

2 09

01 0

6 09

-25-20-15-10-505

10152025

01 0

6 04

01 1

0 04

01 0

2 05

01 0

6 05

01 1

0 05

01 0

2 06

01 0

6 06

01 1

0 06

01 0

2 07

01 0

6 07

01 1

0 07

01 0

2 08

01 0

6 08

01 1

0 08

01 0

2 09

01 0

6 09

(a) S&P500

(b) CDX

Figure : Daily returns of S&P500 and CDX.NA.IG.5Y (CDX) between June 1, 2004 and June 30, 2009

Page 142: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Objectives

Stock and CDXK. F. Chan

Objectives of the study:

Investigate the time-series properties of the CDX returns.

Examine volatility and jump spillover between the CDXand stock markets.

The Model

Stock and CDXK. F. Chan

The SVCJ model:

Stochastic Volatility with Correlated Jumps (SVCJ).

Belong to the affine jump-diffusion model class of Duffie etal. (2000).

Has been examined in the stock market by Eraker et al.(2003), Eraker (2004), Broadie et al. (2006) and Li et al.(2006).

Page 143: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The Model

Stock and CDXK. F. Chan

The SVCJ model:

� measures the correlation between returns and volatility.

NY and NV are Poisson jumps in returns and volatility,respectively.

�Y and �V are the jump sizes in returns and volatility,respectively.

The Model

Stock and CDXK. F. Chan

The SVCJ model:

Assume NY = NV = N

�V ~ exp(�V)

�Y ~ N(�Y + �J �V, �2)

Assume �J = 0

Page 144: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Econometric Method

Stock and CDXK. F. Chan

The SVCJ model is discretized as:

We have the followings to estimate:

Latent volatility variables

Latent jump sizes

Latent jump times

Model parameters

Econometric Method

Stock and CDXK. F. Chan

We estimate the model using Markov Chain Monte Carlo(MCMC) method.

The idea is to estimate the latent variables and modelparameters from their joint posterior density:

Page 145: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Empirical Results

Stock and CDXK. F. Chan

Stock and CDXK. F. Chan

Figure : Stochastic volatilities of the S&P500 and CDX indices

0

5

10

15

20

25

30

35

40

02 06 04

02 12 04

02 06 05

02 12 05

02 06 06

02 12 06

02 06 07

02 12 07

02 06 08

02 12 08

02 06 09

CDXS&P500

Empirical Results

Page 146: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Stock and CDXK. F. Chan

Figure : Jump probabilities of the S&P500 and CDX indices

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

02 06 04

02 12 04

02 06 05

02 12 05

02 06 06

02 12 06

02 06 07

02 12 07

02 06 08

02 12 08

02 06 09

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

02 06 04

02 12 04

02 06 05

02 12 05

02 06 06

02 12 06

02 06 07

02 12 07

02 06 08

02 12 08

02 06 09(a) S&P500

(b) CDX

Empirical Results

Contemporaneous Volatility Spillover

Stock and CDXK. F. Chan

We test for contemporaneous volatility spillover betweenS&P500 and CDX markets.

We split the sample period into two: (i) pre-crisis (June 2,2004 – Feb 6, 2007); and (ii) crisis (Feb 7, 2007 – June30, 2009).

Pearson and Spearman correlation estimates of SVt arelower during crisis period, suggesting for benefits ofdiversification.

Page 147: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Inter-Temporal Volatility Spillover

Stock and CDXK. F. Chan

We test for inter-temporal volatility spillover betweenS&P500 and CDX markets.

We find evidence of Granger-causality relationship onlyduring the ‘crisis’ period.

Implication: The CDX market contains some informationbeyond what is offered by the stock market duringeconomic downturns.

Contemporaneous & Inter-Temporal Jump Spillover

Stock and CDXK. F. Chan

We test for contemporaneous and inter-temporal jumpspillover between S&P500 and CDX markets.

There was contemporaneous jump spillover betweenboth markets; but there was no inter-temporal jumpspillover effect.

Page 148: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 8

ANDREW ELLIS

134

Page 149: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The R/Rmetrics Open Source Project

Rmetrics Association ZurichRmetrics Core Team

Presented by Andrew Ellis

Rmetrics is a collection of R packages originally created for teaching com-putational finance and financial engineering by the Econophysics Group at ETH Zurich. The Rmetrics packages cover a wide range of topics such as time series analysis, hypothesis testing, volatility forecasting, extreme value theory, pricing of derivatives, portfolio analysis, risk management, trading analysis and many more. Rmetrics offers an open source teaching solution with state-of-the-art algorithms to help the integration of academic research to industry. All packages are released under the GNU GPL license.

Many of the functions contained in this collection are not only used by students in education at the ETH in Zurich, but also in many other academic institutes and business schools worldwide. Furthermore, the Rmetrics packages are increasingly being used as a code archive for rapid model prototyping in business environments such as banks, fund management firms, and insurance companies.

Beside the software development the Rmetrics Association supports furtherfields: A high quality documentation project with the publication of ebooks and user guides for R/Rmetrics packages, supporting the R-in-Finance special interest group, the organization of user and developer workshops, summer schools and conferences, and the organization of student internships at ETH Zurich. The Rmetrics Association is a non-profit foundation under Swiss law.

www.rmetrics.org

Page 150: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

What is Rmetrics?Andrew Ellis

Rmetrics Association &ETH Zurich

www.rmetrics.org/

1

1Friday, 19 February 2010

R

• the S language was developed by John Chambers at Bell labs

• R is the open source version of S, and has become the standard software in statistics

• R has hundreds of contributed packages, available on CRAN

• You can find out more about R here: www.r-project.org

2

2Friday, 19 February 2010

Page 151: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Rmetrics packages

• A collection R packages originally created for teaching computational finance and financial engineering by the Econophysics Group at ETH Zurich

• Rmetrics packages cover a wide range of topics such as time series analysis, portfolio optimization, extreme value theory, risk management

3

3Friday, 19 February 2010

Rmetrics packages

• All packages are released under the GNU Public license (GPL)

• Rmetrics packages contain open source implementations of the latest research, thus making the resulting methods and techniques available to everybody

4

4Friday, 19 February 2010

Page 152: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Rmetrics packages

• Rmetrics packages are available on CRAN (stable versions)

• Development version are available on Rforge

• find out more here: www.rmetrics.org/

5

5Friday, 19 February 2010

Rforge

• R-Forge offers a central platform for the development of R packages

• offers easy access to SVN repository

• packages are built and checked daily (binaries for Windows and OS X)

• mailing lists, bug tracking

• http://r-forge.r-project.org/

6

6Friday, 19 February 2010

Page 153: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Rforge

• http://r-forge.r-project.org/projects/rmetrics/

• Rmetrics has 47 packages on Rforge

• currently 20 developers

• packages include: fPortfolio, fGarch, fOptions, randtoolbox, Generalized Hyperbolic, fCopulae, and many more

7

7Friday, 19 February 2010

A brief history of Rmetrics

• 1997: Diethelm Wuertz started to use the S language for the assignments of his Econophysics lectures at ETH Zurich

• 1999: the software was ported to the open source R environment, creating the first R packages for basic financial functions and for financial time series analysis.

• 2001: Rmetrics project is born

8

8Friday, 19 February 2010

Page 154: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

A brief history of Rmetrics

• 2004: the Rmetrics packages were contributed to the CRAN Server, the official home for R packages

• Rmetrics packages are also included as part of the Debian Linux distribution

• R-sig-Finance mailing list is introduced

• 2008 packages are hosted on the new R-forge server in Vienna

9

9Friday, 19 February 2010

Organization of Rmetrics

• Rmetrics Association was founded as an interest group, and is now organized as a non-profit association under Swiss law

• The Rmetrics Association provides software packages, writes documentation, organizes and funds student projects and workshops

10

10Friday, 19 February 2010

Page 155: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Who uses Rmetrics packages?

• Created for teaching computational finance and financial engineering at ETH, now used at many universities worldwide

• because everything is open source, you can look at every piece of code

11

11Friday, 19 February 2010

Who uses Rmetrics packages?

• Rmetrics packages are increasingly being used as a code archive for rapid model prototyping in business environments such as banks, fund management firms, and insurance companies

• Bank Clariden (Zurich), Bank of America(Chicago), Bank Santander & Credit Suisse (Madrid), European Central Bank, (Frankfurt), Government Investment Corp, (Singapore), Merrill Lynch (Houston)

12

12Friday, 19 February 2010

Page 156: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Where can I get help on R/Rmetrics?

• There is a mailing for R in Finance

• https://stat.ethz.ch/mailman/listinfo/r-sig-finance

13

13Friday, 19 February 2010

Rmetrics documentation

• Rmetrics aims to provide first class documentation of packages

• Published electronically; books can kept up-to-date

• www.rmetrics.org/ebooks

14

14Friday, 19 February 2010

Page 157: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Available ebooks

• Basic R for Finance (published as draft)

• A Discussion of Time Series Objects for R in Finance (free)

• Portfolio Optimization with R/Rmetrics

• books can be purchased (or downloaded) from our website

• you get updates to the ebooks for one or two years

15

15Friday, 19 February 2010

Planned ebooks

• Advanced Portfolio Optimization with R/Rmetrics

• Chronological Objects with Rmetrics

• Books by authors of other packages

16

16Friday, 19 February 2010

Page 158: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Publish a book with Rmetrics

• Due to the nature of electronic publishing, Rmetrics is able to offer more interesting conditions for authors than most other publishing companies

• 3 models: get paid, donate proceeds to the Rmetrics Association, give book away for free

17

17Friday, 19 February 2010

Rmetrics Events

• Meielisalp workshop: takes place every year in June/July in the Swiss mountains (limited to 50 participants, so register early)

• Computational Topics in Finance conference in Singapore

• Training courses: Basic R, Using R for Finance, Portfolio Optimization with R/RMetrics

• https://www.rmetrics.org/events18

18Friday, 19 February 2010

Page 159: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Student internships

• Rmetrics provides student internships at the Econophysics Group, Institute of Theoretical Physics, ETH Zurich

• Students work on package development or documentation

• Rmetrics is continuously looking for sponsors for these internships

19

19Friday, 19 February 2010

Sponsorship

• Sponsor for sudent internships and events so far include: Finance Online (Zurich), Insightful (Tibco), Reechem (Hedge Fund), Invesco, Theta Fund, Revolution, Mango Solutions, ETH, RMI

20

20Friday, 19 February 2010

Page 160: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Join Rmetrics

• add your packages to the Rmetrics project

• support student interships

• buy the books

• sponsorship for workshops, conferences

• www.rmetrics.org� �

21

21Friday, 19 February 2010

Page 161: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 162: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 9

ANMOL SETHY

148

Page 163: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

fxregime: A tool for exchange rate analytics Achim Zeileis1, Ajay Shah2, Anmol Sethy3, Ila Patnaik2, Vimal Balasubramaniam2

Measurement of de facto exchange rate regimes has been an area of interest to the economics community as well financial market traders, albeit for different purposes. A continuous measurement of exchange rate flexi1bility at low frequency is useful to economists in obtaining results that provide a glimpse into the open-macro-economy framework. Traders on the other hand are more interested in looking for high frequency changes in the exchange rate regime to assimilate new information in expectations for currency movements. In the economics literature, the existing measures of de facto currency regimes do not provide a fine structure of classifying exchange rate regimes, and often redefine classifications making comparison over time difficult. The situation is further complicated by the fact that information from the central banks is often limited and sometimes misleading as well. The de facto exchange rate regime can be easily estimated by a least-squares regression for exchange rate returns and changes in the exchange rate regime correspond to changes in the regression parameters. However, unlike in classical least-squares methods (such as the Bai & Perron framework for structural change analysis), the error variance is not a nuisance parameter but of prime interest as well as it corresponds to the flexibility of the exchange rate regime. Hence, we extend the standard structural change framework to maximum likelihood models where we can easily incorporate the error variance as a full model parameter in an (approximately) Gaussian model. In this model we can perform testing (in historical data), monitoring (in incoming data to evaluate its divergence from historical data), and dating of structural changes in exchange rate regimes. All three techniques (testing, monitoring, dating) are provided in the R package "fxregime". A particular challenge, however, is the dating of structural changes as the algorithm's complexity is of order O(n^2). A simple way to speed this process up is to parallelize the search for the breakpoints. This has been implemented through the use of foreach package in R. This is done in a manner that the code becomes impervious to whether the underlying system is a multicore (in which case the library deployed by the user is multicore) or a cluster (in which case the library snow is employed). Parallel computing, however, leads to computational and process time gain only when the time series under study is long.

Page 164: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Package “fxregime”Continuous measure of de facto currency regimes

Achim Zeileis1 Ajay Shah2 Ila Patnaik2

Balasubramaniam Vimal2 Anmol Sethy3

1WU Wirtschaftsuniversitt Wien (Austria)

2National Institite of Public Finance and Policy(India)

3Citigroup (Singapore)

February 19, 2010

Package “fxregime”

Outline

1 Outline

2 De facto exchange rate regimes

3 Purpose of measuring currency regimes

4 Estimation Technique

5 Some results

6 Recap

Page 165: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

De facto exchange rate regimes

What is an exchange rate regime?

An exchange rate regime is the way a country manages itscurrency with respect to other currencies

Management of currency and its benefits are not entirely clearin academic literature

The exchange rate regime has an impact on

1 Financial flows and market efficiency2 Value of trade (imports and exports)3 On inflation in the economy4 On interest rates in the economy

Package “fxregime”

De facto exchange rate regimes

Importance of measuring de facto currency regimes

Important to understand the operating environment forbusiness in order to ascertain:-

1 Currency exposure2 Risk of macroeconomic crisis

Policy implications:-

1 Long-term understanding where an economy stands, vis-a-visthe impossible trinity

2 Risk of macroeconomic crisis and build up in pressure3 Financial Development4 Assessment of central bank policy on exchange rate

management

Page 166: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

De facto exchange rate regimes

Different classification of exchange rate regimes

Stated intention of central bank do not reflect reality

Measurement of de facto currency regimes becomessignificant given such differences

Academic literature has used various measures to classifyexchange rate regimes into various categories that depend oncentral bank sources and multiple variables.

Often, these classification miss the fine structure of theexchange rate regime. that are limited and misleading inmeasuring de facto currency regimes.

Package “fxregime”

Purpose of measuring currency regimes

For economists

Helps in answering questions on:-

1 The nature of exchange rate regime and its consequences fortrade and finance

2 The position of economies vis-a-vis the impossible trinity

Aids in further analytical research on open macroeconomics inareas of finance, trade, monetary policy and so on.

Page 167: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Purpose of measuring currency regimes

For traders

Traders can use the monitoring system which can warn themof possible break away from recent behaviour.

Package “fxregime”

Estimation Technique

Frankel-Wei regression methodology

A valuable tool for understanding the de facto exchange rateregime in operation is a linear regression model based oncross-currency exchange rates (with respect to a suitablenumeraire, e.g., CHF).

If estimation involving the Singapore dollar (SGD) is desired,the model estimated is:

d log

(SGD

CHF

)= β1+β2d log

(USD

CHF

)+β3d log

(JPY

CHF

)+β4d log

(DEM

CHF

)+β5d log

(GBP

CHF

)+ε

Page 168: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Estimation Technique

Testing for structural breaks

Testing for parameter stability has:-

H0 : θ(i) = θ(0)H1 : θ(i) �= θ(0)

where θ is the k dimensional parameter we are interested in

Package “fxregime”

Estimation Technique

Testing Process

Fit a regression model once on the whole sample

Capture the cumulative sum of model deviations

The model deviations are the empirical estimating functionsfor testing parameter stability

Page 169: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Estimation Technique

Testing Process

t

y

2004 2006 2008 2010 2012

200

400

600

800

1000

1200

Package “fxregime”

Estimation Technique

Testing Process

t

y

2004 2006 2008 2010 2012

−400

0−2

000

020

0040

00

Page 170: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Estimation Technique

Dating structural change

On evidence of parameter instability, the attempt is to knowthe dates and the extent of change.

Either use an exhaustive search over all conceivable partitionsof order O(nm) or

Employ dynamic programming approach which can reduce thisto O(n2) as discussed in Perron and Bai (Econometrica,2002).

The technique relies of a triangular matrix of Ψ(i , j) for all 1≤i < j≤n , Ψ(i , j) = minβ,σ2

∑jk=i ψ(yk , xk , β, σ

2)

Package “fxregime”

Estimation Technique

Uniqueness of package fxregime

Assessing structural breaks is basically assesssing the stabilityof an exchange regression

Unlike usual methods where the error term is a nuisanceparameter,

ψRSS(β)=∑n

i=1(yi − xTi β)

For fx rates the variance of the error term has to beconsidered as a full parameter.

ψNLL(β, σ)=∑n

i=1(log(σ−1φ(

yi−xTi βσ )))

For a given number of breaks m, the optimal breaks can thusbe found.

To decide upon the number of breaks, information critera canbe used.

Page 171: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Estimation Technique

Monitoring currency regimes

Monitoring currency regimes is a continuation of the empiricalprocess as new data ticks in.

Compute the empirical estimating function for each incomingobservation and update the cumulative and recursive process

However an assumption has to be made about the modelinitially used to set up the efp

Package “fxregime”

Estimation Technique

Implementation issues

The dating of structural changes is a particular challenge asthe algorithm’s complexity is of order O(n2)

The attempt has been to speed this process up by parallelisingthe search for the breakpoints.

Page 172: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Estimation Technique

Parallel estimation

Packages foreach, multicore and snow have been employed totackle this issue.

This is useful only if the time series is long

Communication losses override computational gain when thetime series involved is not long.

Useful only when time series is long.

Computational time drops to an extent of 25-30%

Package “fxregime”

Some results

KRW Results of FW regression

Start End r2 USD DUR GBP JPY σ2

1 1991-01-11 2009-12-25 0.56 0.67 0.23 0.13 0.11 1.30

800

1000

1200

1400

1600

1800

2000

Time

US

D

1995 2000 2005 2010

Page 173: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Some results

The Korean Won

(Inte

rcep

t)

-3-2

-10

12

3

US

DC

HF

-3-2

-10

12

3-3

-2-1

01

23

JPY

CH

F

1995 2000 2005 2010

Time

DU

RC

HF

-3-2

-10

12

3

GB

PC

HF

-3-2

-10

12

3-3

-2-1

01

23

(Var

ianc

e)

1995 2000 2005 2010

Time

M-fluctuation test

Package “fxregime”

Some results

The Korean Won

800

1000

1200

1400

1600

1800

2000

Time

US

D

1995 2000 2005 2010

Page 174: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Some results

The Korean Won

Start End r2 USD DUR GBP JPY σ2

1 1991-01-11 1995-01-20 0.98 1.01 -0.00 -0.01 -0.02 0.072 1995-01-27 1997-11-14 0.83 0.87 -0.06 0.07 0.16 0.423 1997-11-21 1998-09-11 0.15 -1.03 1.27 1.17 -0.09 7.584 1998-09-18 2008-02-29 0.69 0.65 0.24 0.09 0.27 0.745 2008-03-07 2009-12-25 0.27 0.44 0.52 0.12 -0.27 3.13

Package “fxregime”

Some results

Monitoring results: Korean Won

010

020

030

0

TIME

Em

piric

al fl

uctu

atio

n pr

oces

s

2007 2008 2009 2010

Monitoring of FX model

900

1000

1100

1200

1300

1400

1500

Page 175: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Recap

In summary...

fxregime can aid in both historical analysis as well asmointoring of exchange rates

Employs generalized fluctuation tests for detecting strucuralbreaks

Extends usual methods for analysis by incorporating varianceas a full parameter

Parallelization for speedier computations

Package “fxregime”

Recap

References

Achim Zeileis, Ajay Shah, Ila Patnaik (2010).Testing,Monitoring, and Dating Structural Changes in Exchange RateRegimes. Computational Statistics & Data Analysis,Forthcoming. Preprint at http://statmath.wu.ac.at/

~zeileis/papers/Zeileis+Shah+Patnaik-2010.pdf

Achim Zeileis, Ajay Shah, Ila Patnaik, Anmol Sethy (2010).fxregime: Exchange Rate Regime Analysis. R package version1.0-0. URL:http://CRAN.R-project.org/package=fxregime

Page 176: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Package “fxregime”

Recap

Thank You

Page 177: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 178: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 10

KARIM CHINE

164

Page 179: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Elastic-Ra google docs-like portal for data analysis in the cloud

Karim Chine

Cloud Era Ltd, Cambridge UK

Abstract

Elastic-R is a new portal built using the Biocep-R platform. It enables statisticians, computational scientists, financial analysts, educators and students to use cloud resources seamlessly; to work with R engines and use their full capabilities from within simple browsers; to collaborate, share and reuse functions, algorithms, user interfaces, R sessions, servers; and to perform elastic distributed computing with any number of virtual machines to solve computationally intensive problems.

Page 180: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 181: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

PART III

SATURDAY MORNING

167

Page 182: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 11

DEFENG SUN

168

Page 183: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

A Majorized Penalty Approach for Calibrating Rank Constrained Correlation Matrix Problems

Sun Defeng

Risk Management InstituteNational University of Singapore

Abstract:

In this paper, we aim at finding a nearest correlation matrix to a given symmetric matrix, measured by the componentwise weighted Frobenius norm, with a prescribed rank and bound constraints on its correlations. This is in general a non-convex and difficult problem due to the presence of the rank constraint. To deal with this difficulty, we first consider a penalized version of this problem and then apply the essential ideas of the majorization method to the penalized problem by solving iteratively a sequence of least squares correlation matrix problems without the rank constraint. The latter problems can be solved by a recently developed quadratically convergent smoothing Newton-BiCGStab method. Numerical examples demonstrate that our approach is very efficient for obtaining a nearest correlation matrix with both rank and bound constraints.

This is a joint work with Yan GAO

Page 184: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

��

A Majorized Penalty Approach forCalibrating Rank Constrained Correlation

Matrix Problems

Defeng Sun

Department of Mathematics and Risk Management Institute

National University of Singapore

This is a joint work with Yan Gao at NUS

February 20, 2010

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 2 / 40

On January 15, 2010, I received the following email:From: [email protected]: Friday, January 15, 2010 5:14 PMTo: Sun DefengCc: XXX XXXSubject: Nearest Correlation Matrix: Faster code request

Dear Mr. Sun,Please let me introduce myself. My name is XXX and I work in one ofSpain’s major banks, BBVA. The position that I hold is QuantitativeAnalyst.

We have been looking for quite a while for ”nearest correlation matrixproblem” algorithms until we found your paper ”An augmentedLagrangian dual approach for the H-weighted nearest correlation matrixproblem” ...,

Page 185: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 3 / 40

which shows not only a feasible approach, but also robust and fastresults. I was also happy to check and test the MATLAB code that youprovide in your web page ..., with outstanding results.We are planning to apply your algorithm to large scale problems (around2000x2000 correlation matrixes) through a C++ implementation usingLAPACK library routines; this is why we are particularly interested inperformance.Could you please provide us with any faster code (MATLAB or other) forthis matter?Thank you in advance and sorry for any inconvenience this may causeyou.Regards,XXX

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 4 / 40

On November 18, 2009, I received the following email:From: [email protected]: Wednesday, November 18, 2009 5:11 PMTo: Sun DefengSubject: nearest correlation matrix

Dear Professor Sun,

For R&D purpose, I am currently using your algorithms CorNewton andCorNewton3−Wnorm, which I downloaded from your webpage.

The results look very satisfactory. I was wondering whether you wouldhave another version of the algorithm available in C or C++.

Best Regards,

Dr. XXX XXXBNP Paribas Equity Derivatives Quantitative Research

Page 186: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 5 / 40

On October 27, 2009, I received this from Universiteit van Tilburg:

My thesis is about correlations in a pension fund pooling. It is importantfor economic capital calculations. For some risks such as operationalrisk, I dont have data and hence I need to consult for an expert opinion.Then I might end up with not PSD matrices. Therefore, I need tocalculate nearest correlation matrix.

In my given correlation matrix, I want to fix the correlations, which aredata driven and I want the rest of the correlations not smaller than 0.1from original matrix.

Your code is very convenient for my study. However, ...

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 6 / 40

On November 3, 2009:

Thank you for your valuable time, comments and helping me aboutsolving my problem.

I gave no chance that my fixed constraints could be non-PSD before.Your advice solves the problem. I will modify my study in the light of it.

Page 187: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The model

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 7 / 40

In this talk, we are interested in the following rank constrainedcovariance matrix problem

min ‖H ◦ (X −G)‖Fs.t. Xii = 1, i = 1, . . . , n

Xij = eij, (i, j) ∈ Be ,

Xij ≥ lij, (i, j) ∈ Bl ,

Xij ≤ uij, (i, j) ∈ Bu ,

X ∈ Sn+ ,

rank(X) ≤ r ,

(1)

where Be, Bl, and Bu are three index subsets of {(i, j) | 1 ≤ i < j ≤ n}satisfying Be∩Bl = ∅, Be∩Bu = ∅, and lij < uij for any (i, j) ∈ Bl∩Bu.

continued

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 8 / 40

Here Sn and Sn+ are, respectively, the space of n× n symmetric

matrices and the cone of positive semidefinite matrices in Sn.

‖ · ‖F is the Frobenius norm defined in Sn.

H ≥ 0 is a weight matrix.

• Hij is larger if Gij is better estimated.

• Hij = 0 if Gij is missing.

A matrix X ∈ Sn+ is called a correlation matrix if X 0 (i.e., X ∈ Sn

+)and Xii = 1, i = 1, . . . , n.

Page 188: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

A simple correlation matrix model

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 9 / 40

min ‖H ◦ (X −G)‖Fs.t. Xii = 1 , i = 1, . . . , n

X 0 ,

rank(X) ≤ r .

(2)

The simplest corr. matrix model

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 10 / 40

min ‖(X −G)‖Fs.t. Xii = 1 , i = 1, . . . , n

X 0 ,

rank(X) ≤ r .

(3)

Page 189: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 11 / 40

In finance and statistics, correlation matrices are in many situationsfound to be inconsistent, i.e., X � 0.

These include, but are not limited to,

■ Structured statistical estimations; data come from different timefrequencies

■ Stress testing regulated by Basel II;

■ Expert opinions in reinsurance, and etc.

One correlation matrix

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 12 / 40

Partial market data1

G =

⎡⎢⎢⎢⎢⎢⎢⎣

1.0000 0.9872 0.9485 0.9216 −0.0485 −0.04240.9872 1.0000 0.9551 0.9272 −0.0754 −0.06120.9485 0.9551 1.0000 0.9583 −0.0688 −0.05360.9216 0.9272 0.9583 1.0000 −0.1354 −0.1229

−0.0485 −0.0754 −0.0688 −0.1354 1.0000 0.9869−0.0424 −0.0612 −0.0536 −0.1229 0.9869 1.0000

⎤⎥⎥⎥⎥⎥⎥⎦

The eigenvalues of G are: 0.0087, 0.0162, 0.0347, 0.1000, 1.9669, and3.8736.

1RiskMetrics (www.riskmetrics.com/stddownload edu.html)

Page 190: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Stress tested

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 13 / 40

Let’s change G to

[change G(1, 6) = G(6, 1) from −0.0424 to −0.1000]

⎡⎢⎢⎢⎢⎢⎢⎣

1.0000 0.9872 0.9485 0.9216 −0.0485 −0.10000.9872 1.0000 0.9551 0.9272 −0.0754 −0.06120.9485 0.9551 1.0000 0.9583 −0.0688 −0.05360.9216 0.9272 0.9583 1.0000 −0.1354 −0.1229

−0.0485 −0.0754 −0.0688 −0.1354 1.0000 0.9869−0.1000 −0.0612 −0.0536 −0.1229 0.9869 1.0000

⎤⎥⎥⎥⎥⎥⎥⎦

The eigenvalues of G are: −0.0216, 0.0305, 0.0441, 0.1078, 1.9609, and3.8783.

Missing data

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 14 / 40

On the other hand, some correlations may not be reliable or even missing:

G =

⎡⎢⎢⎢⎢⎢⎢⎣

1.0000 0.9872 0.9485 0.9216 −0.0485 −−−0.9872 1.0000 0.9551 0.9272 −0.0754 −0.06120.9485 0.9551 1.0000 0.9583 −0.0688 −0.05360.9216 0.9272 0.9583 1.0000 −0.1354 −0.1229

−0.0485 −0.0754 −0.0688 −0.1354 1.0000 0.9869−−− −0.0612 −0.0536 −0.1229 0.9869 1.0000

⎤⎥⎥⎥⎥⎥⎥⎦

Page 191: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Drop the rank constraint

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 15 / 40

Let us first consider the problem without the rank constraint:

min1

2‖H ◦ (X −G)‖2F

s.t. Xii = 1 , i = 1, . . . , n

X 0 .

(4)

When H = E, the matrix of ones, we get

min1

2‖X −G‖2F

s.t. Xii = 1 , i = 1, . . . , n

X 0 .

(5)

which is known as the nearest correlation matrix (NCM) problem, aterminology coined by Nick Higham (2002).

The story starts

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 16 / 40

The NCM problem is a special case of the best approximation problem

min1

2‖x− c‖2

s.t. Ax ∈ b+Q ,

x ∈ K ,

where X is a real Hilbert space equipped with a scalar product 〈·, ·〉 andits induced norm ‖ · ‖, A : X → m is a bounded linear operator,Q = {0}p × q

+ is a polyhedral convex cone, 1 ≤ p ≤ m, q = m− p,and K is a closed convex cone in X .

Page 192: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The KKT conditions

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 17 / 40

The Karush-Kuhn-Tucker conditions are⎧⎪⎪⎪⎪⎨⎪⎪⎪⎪⎩

(x+ z)− c−A∗y = 0

Q∗ � y ⊥ Ax− b ∈ Q

K∗ � z ⊥ x ∈ K ,

,

where “⊥” means the orthogonality. Q∗ is the dual cone of Q and K∗ isthe dual cone of K.

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 18 / 40

Equivalently, ⎧⎪⎪⎪⎪⎨⎪⎪⎪⎪⎩

(x+ z)− c−A∗y = 0

Q∗ � y ⊥ Ax− b ∈ Q

x− ΠK(x+ z) = 0

,

where ΠK(x) is the unique optimal solution to

min1

2‖u− x‖2

s.t. u ∈ K .

Page 193: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 19 / 40

Consequently, by first eliminating (x+ z) and then x, we get

Q∗ � y ⊥ AΠK(c+A∗y)− b ∈ Q ,

which is equivalent to

F (y) := y − ΠQ∗ [y − (AΠK(c+A∗y)− b)] = 0, y ∈ m .

The dual formulation

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 20 / 40

The above is nothing but the first order optimality condition to theconvex dual problem

max −θ(y) := −[1

2‖ΠK(c+A∗y)‖2 − 〈b, y〉 − 1

2‖c‖2

]

s.t. y ∈ Q∗ .

Then F can be written as

F (y) = y − ΠQ∗(y −∇θ(y)) .

Page 194: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 21 / 40

Now, we only need to solve

F (y) = 0, y ∈ m .

However, the difficulties are:

■ F is not differentiable at y;

■ F involves two metric projection operators;

■ Even if F is differentiable at y, it is too costly to compute F ′(y).

The NCM problem

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 22 / 40

For the nearest correlation matrix problem,

• A(X) = diag(X), a vector consisting of all diagonal entries of X..

• A∗(y) = diag(y), the diagonal matrix.

• b = e, the vector of all ones in n and K = Sn+.

Consequently, F can be written as

F (y) = AΠSn+(G+A∗y)− b.

Page 195: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The projector

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 23 / 40

For n = 1, we have

x+ := ΠS1+(x) = max(0, x).

Note that• x+ is only piecewise linear, but not smooth.• (x+)

2 is continuously differentiable with

∇{1

2(x+)

2}= x+,

but is not twice continuously differentiable.

The one dimensional case

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 24 / 40

Page 196: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The multi-dimensional case

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 25 / 40

The projector for K = Sn+:

x

x

Convex Cone

x2 3

1

ΠK

η

(η)K

0

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 26 / 40

Let X ∈ Sn have the following spectral decomposition

X = PΛP T ,

where Λ is the diagonal matrix of eigenvalues of X and P is acorresponding orthogonal matrix of orthonormal eigenvectors.

Then

X+ := PSn+(X) = PΛ+P

T .

Page 197: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 27 / 40

We have

• ‖X+‖2 is continuously differentiable with

∇(12‖X+‖2

)= X+,

but is not twice continuously differentiable.

• X+ is not piecewise smooth, but strongly semismooth2.

2 D.F. Sun and J. Sun. Semismooth matrix valued functions. Mathematics ofOperations Research 27 (2002) 150–169.

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 28 / 40

A quadratically convergent Newton’s method is then designed by Qi andSun3 The written code is called CorNewton.m.

"This piece of research work is simply great and

practical. I enjoyed reading your paper." –March 20, 2007, a home loan financial institution based inMcLean, VA.

"It’s very impressive work and I’ve also run theMatlab code found in Defeng’s home page. Itworks very well."– August 31, 2007, a major investmentbank based in New York city.

3H.D. Qi and D.F. Sun. A quadratically convergent Newton method for comput-ing the nearest correlation matrix. SIAM Journal on Matrix Analysis and Applications28 (2006) 360–385.

Page 198: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Inequality constraints

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 29 / 40

If we have lower and upper bounds on X, F takes the form

F (y) = y − ΠQ∗ [y − (AΠSn+(G+A∗y)− b)] ,

which involves double layered projections over convex cones.

A quadratically convergent smoothing Newton method is designed byGao and Sun4.

Again, highly efficient.

4Y. Gao and D.F. Sun. Calibrating least squares covariance matrix problemswith equality and inequality constraints, SIAM Journal on Matrix Analysis and Appli-cations 31 (2009), 1432–1457.

Back to the rank constraint

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 30 / 40

min1

2‖H ◦ (X −G)‖2F

s.t. A(X) ∈ b+Q ,

X ∈ Sn+ ,

rank(X) ≤ k,

equivalently,

min1

2‖H ◦ (X −G)‖2F

s.t. A(X) ∈ b+Q ,

X ∈ Sn+ ,

λi(X) = 0, i = k + 1, . . . , n.

Page 199: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The penalty approach

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 31 / 40

Given c > 0, we consider a penalized version

min1

2‖H ◦ (X −G)‖2F + c

n∑

i=k+1

λi(X)

s.t. A(X) ∈ b+Q ,

X ∈ Sn+ ,

or equivalently

min fc(X) :=1

2‖H ◦ (X −G)‖2F + c〈I,X〉 − c

k∑

i=1

λi(X)

s.t. A(X) ∈ b+Q ,

X ∈ Sn+ .

Majorization functions

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 32 / 40

Let

h(X) :=k∑

i=1

λi(X)− 〈I,X〉.

Since h is a convex function, for given Xk, we have

h(X) ≥ hk(X) := h(Xk) + 〈V k, X −Xk〉,

where V k ∈ ∂h(Xk).Let d ∈ n be a positive vector such that

H ◦H ≤ ddT .

For example, d = max(Hij)e. Let D1/2 = diag(d0.51 , . . . , d0.5n ).

Page 200: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 33 / 40

Let

g(X) :=1

2‖H ◦ (X −G)‖2F .

Then g is majorized by

gk(X) := g(Xk)+〈H ◦H(Xk−G), X−Xk〉+ 1

2‖D1/2(X−Xk)D1/2‖2F .

Thus, at Xk, fc is majorized by

fc(X) ≤ fk(X) := gk(X)− hk(X)

and fc(Xk) = fk(Xk).

The idea of majorization

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 34 / 40

Instead of solving the penalized problem, the idea of the majorization isto solve, for given Xk, the following problem

min fk(X) = gk(X)− hk(X)

s.t. A(X) ∈ b+Q ,

X ∈ Sn+ ,

which is a diagonal weighted least squares correlation matrix problem

min1

2‖D1/2(X −X

k)D1/2‖2F

s.t. A(X) ∈ b+Q ,

X ∈ Sn+ .

Page 201: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 35 / 40

Now, we can use the two Newton methods introduced earlier for themajorized subproblems!

fc(Xk+1) < fc(X

k) < · · · < fc(X1).

Where is the rank condition?

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 36 / 40

Looks good? But how can one guarantee that we can get a final X∗

such that its rank is less or equal to k?

The answer is: increase c. That is, to have a sequence of {ck} withck+1 ≥ ck.

Will it work? Numerical stability? Does not need a large ck in numericalcomputations.

There are no known methods that can solve the general rank constrainedproblem. For the H-normed correlation matrix problems (withoutconstraints on the off diagonal entries), the major.m of R. Pietersz andJ.F. Groenen (2004) is the most efficient one so far [write X = Y Y T forY ∈ n×k and apply component-by-component majorization.].

Page 202: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

One typical example

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 37 / 40

20 40 60 80 100 1200

200

400

600

800

1000

1200

rank

time

(sec

s)

Example 5.1: n=500, H=E

PenCorr Major SemiNewton Dual−BFGS

20 40 60 80 100 1200

0.01

0.02

0.03

0.04

0.05

0.06

0.07

rank

rela

tive

gap

Eample 5.1: n=500, H=E

PenCorr Major SemiNewton Dual−BFGS

A general example: n=1,000

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 38 / 40

Example 5.6 PenCorr

rank time residue20 11640.0 1.872e250 1570.0 1.011e2100 899.0 8.068e1250 318.3 7.574e1500 326.3 7.574e1

Table 1: Numerical results for Example 5.6

Page 203: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Final remarks

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 39 / 40

• A code named PenCorr.m can efficiently solve all sorts of rankconstrained correlation matrix problems. Faster when rank is larger.

• The techniques may be used to solve other problems, e.g., lowrank matrix problems with sparsity.

• The limitation is that it cannot solve problems for matricesexceeding the dimension 4, 000 by 4, 000 on a PC due to memoryconstraints.

End of talk

R/Rmetrics ”Computational Topics in Finance” Conference NUS/SUN – 40 / 40

Thank you! :)

Page 204: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 12

YOHAN CHALABI

190

Page 205: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Outlier Resistant GARCH ModelingYohan Chalabi1,

�, Diethelm Wurtz1

1. Institute for Theoretical Physics - Econophysics Group, ETH Zurich

Generalized autoregressive heteroskedastic (GARCH) models are nowadayswidely used to reproduce stylized facts of financial time series and play anessential role in risk management and volatility forecasting. Although thesemodels are well studied, numerical problems may arise in the estimationof the parameters when outliers are present in the data set. Indeed, max-imum likelihood estimation can be sensitive to outliers. To overcome thislimitation, the weighted trimmed likelihood estimation (WTLE) has been re-cently introduced. In this talk, we extend the GARCH family models to theweighted trimmed likelihood procedure to obtain robust estimates. Otherrobust GARCH estimators will be presented and an extensive Monte-Carlostudy will be applied to compare the different approaches.

Keywords: GARCH models; Robust estimation; Trimmed Weighted Like-lihood; M-estimates; Outliers

�Contact author: [email protected]

Page 206: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 13

JOEL YU

192

Page 207: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

A Markov-switching Model of the Won-Dollar Rate

Joel C. Yu

Associate Professor College of Business Administration

University of the Philippines UP Campus, Diliman

Quezon City Philippines

[email protected]

Foreign exchange rate modeling has gone through a host of developments in accounting for its nonlinear characteristics. Since the seminal work of Hamilton (1989), markov-switching models (MSM) have been increasingly used to quantifythe nonlinear aspects of exchange rates. Initial research papers show that the MSM can very well describe the movements of exchange rates over time (e.g., Engel and Hamilton, 1990). Today, this approach is widely used to characterize exchange rate movements and to explore the possibility of improving exchange rate forecasting.

This paper employs MSM in characterizing the short-term movements in the won-dollar rate. Its ability to account for non-linear aspects provides insights in identifying the relevance of explanatory variables in affecting the movements in the won-dollar pair under different states. Results provide a strong support for non-linearity in the weekly changes in the won-dollar rate for the period March 2000 to May 2009. The model shows that during periods of high volatility, changes in interest rates are not relevant in affecting the movements in exchange rates while equity return takes on an increased importance. These results may serve as a guide in monetary policy in Korea in terms of intervention during periods of highly volatile markets.

Page 208: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

��������� ��� ������������������������������

����������������������� �� ���! � ���� ��"� �� �#��������$� � %% ��

����� � �����������&�� �����"� �� �#����� ���%���'(')�*�+����#�,-'-

.�������� ��

-15

-10

-5

0

5

10

15

20

00 01 02 03 040404 0505 0606 0707 0808 09090909

0.00

1.00

2.00

3.00

4.00

5.00

6.00

Page 209: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

.�������� ��

� /+0��� �� 1�������%��� �������!�!���������� �� +������

������ ����������������������

� ����������#� ����� � ��� ���!�����2���3

� ����!���������4� ����� !%� � ��� �!%� ��� ��� �����!���� ����������%���!���� ����������������������� � ���4����������� ��������������!����� �������� ��������� !���.�����5���� ��%���!���� �������������������������%��� ��������%��� � ��� ������� ��� ���������� �#������! �����

6!% � ����*���4�����������

� 1 !����� � �������

� ����������������

� $����� ���$�����$�� �#

� �����������$�#!��� ��%%�����

� �������#��%%�����

� � �� ���������%%�����

Page 210: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

������$����

� ��������� �7������ � � ��

� ��!����� ���4�!%��

� ��!!����#%� ����!����%����

������� ��� ��������

where

�yt: log rate of change in real GDP times 100

�(st): conditional mean that changes between two states, st

The non-observable state, st, is assumed to follow an ergodic first-order Markov chain process described by transition probabilities, Pr(st=j|st=i)=pij, where Σjpij=1

These transition probabilities are generally summarized in a matrix P given by:

t4t4t41t1t1tt u)]s(y[...)]s(y[)s(y +μ−Δα++μ−Δα=μ−Δ −−−−

��

��

=

2221

1211

pp

ppP

Page 211: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

���"�������������

��

=+γ+Δβ+α

=+γ+Δβ+α=

2s if vri

1s if uridkrw

ttt2t22

ttt1t11t

where:dkrwt : log rate of change at time t in weekly won-dollar (krw) rate times 100Δit : weekly change in overnight call rate at time trt : log rate of change at time t in weekly KOSPI times 100ut ∼ NID(0, Σs1

23vt ∼ NID(0, Σs2

2)

��������� � ��� ��

Smoothed Probability: Regime 1

0.0

0.2

0.4

0.6

0.8

1.0

2001

2002

2003

2004

2005

2006

2007

2008

2009

Page 212: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

��������� � ��� ��

State 1 vs State 2 Periods(yyyy:mm:dd)

State 1 State 2

From To From To

2000:03:15 2000:11:15 2000:11:22 2000:12:27

2001:01:03 2001:03:14 2001:03:21 2001:04:11

2001:04:18 2003:03:05 2003:03:12 2003:03:12

2003:03:19 2004:11:10 2004:11:17 2004:12:01

2004:12:08 2008:03:05 2008:03:12 2008:05:14

2008:05:21 2008:08:06 2008:08:13 2009:05:13

��������� � ��� ��Sample Mean Variance Std Dev

DEXR

Total 479 0.02 3.10 1.76

State 1 415 -0.08 0.65 0.80

State 2 64 0.65 18.81 4.34

DCRATE

Total 479 -0.01 0.01 0.12

State 1 415 0.00 0.01 0.09

State 2 415 -0.05 0.05 0.22

RETURN

Total 64 0.09 15.99 4.00

State 1 64 0.16 13.37 3.66

State 2 64 -0.35 33.23 5.76

Page 213: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

1� �����8 ���� �#

Non Linear Linear

Log Likelihood -677.4416 -892.985

AIC Criterion 2.8703 3.7452

HQ Criterion 2.9046 3.7589

SC Criterion 2.9574 3.7801

LR Linearity Test 431.0869

Chi (4) 0.0000

Chi (6) 0.0000

Davies 0.0000

������$��%��� �

Transitions Matrix

State 1 State 2

State 1 0.9819 0.0181

State 2 0.0955 0.9045

Obs Prob. Duration

State 1 409.8 0.8409 55.38

State 2 69.2 0.1591 10.47

Page 214: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

$���!�����6 � !���

Linear Model State 1 State 2

Coef t-val Coef t-val Coef t-val

α 0.0344 0.4805 -0.0654 -1.6176 0.4043 1.0658

β -0.8767 -1.4481 -0.9497 -2.1174 0.2361 0.1424

γ -0.2033 -11.3217 -0.0654 -5.9432 -0.5423 -8.3157

������ ��

� * � �5�����%���!������ � !��� ��������� �����!����� ��!�+ � �� � ������ �������������������������� � ���� ���� ��

� ������5������ ��������� ������%���!������ � !��� ����� ����� ������ ������������ ���� �������� ���� � ������ ������� ��������4�������������������������� � ��������������� � ����#������� ����� ���“���!��” � !� ����� ���%�� �� ����������� ��#���������� 9���� ���#����� ����4����������� 5������� � ����������� �������� �������������!��!��� � ����������������������

� 8� ��#5����������� � ���:� �#�������������������� �� ������� �����������������%� ������� �� ���������� ����������� ���%�� �� ����������� ��#5������� �!��!��� � �������:� �#�!�������������� �����������������������4������������

Page 215: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 216: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 14

LEONG CHEE KIA

202

Page 217: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

LEARNING BAYESIAN NETWORK FOR

CREDIT AND RISK SCORING

Chee Kian Leong ∗

[email protected]

School of Business

Abstract

Financial credit and risk scoring is a very important aspect of risk man-agement. In this paper, we demonstrate the applications of learning Bayesiannetwork for credit and risk scoring. A learning Bayesian network is a graph-ical model which encodes the joint probability distribution for a set of ran-dom variables. The advantages of Bayesian network classifiers in credit andrisk scoring is its capacity to provide a clear insight into the structural rela-tionships between variables affecting risk and creditworthiness. The learn-ing Bayesian network algorithm involves the construction of priors for net-work parameters and learning of parameters via conjugate updating. Thenetwork structure is developed using the network score via a heuristic searchstrategy. Illustrations using a credit scoring data set are demonstrated usingR.

∗Corresponding author. Email:[email protected].

1

Page 218: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 15

DIETHELM WÜRTZ

204

Page 219: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Postmodern Approaches to Portfolio Design

Diethelm Würtz*, Yohan Chalabi*, Andrew Ellis**,

William Chen* and Stefan Theussl***

*Swiss Federal Institute of Technology, Zurich **Finance Online GmbH, Zurich

***University of Economics and Business Administration, Vienna

[email protected]

The underlying assumption of Markowitz’ modern portfolio theory states that the measure of investment risk is described by the sample variance of asset returns and that all securities can be adequately represented by a multivariate elliptically-contoured distribution. These facts do not always represent the realities of the investment markets, where we are confronted with non-stationary behavior and unusual market behavior due to structural breaks, bubbles, and even market crashes. Risk is becoming more and more related to bad outcomes and losses, which are considered to weigh more heavily than gains. This view has been put forward by researchers in finance, economics and psychology, which has in turn lead to the introduction of more sophisticated risk measures and methods to analyze portfolios.

We give a summary of postmodern investment strategies and sophisticated methods which can make fund managers and their clients, show how to use them in practice, and how they are made available in the R/Rmetrics portfolio software package.

Page 220: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Postmodern Approaches to Portfolio Design:Portfolio Optimization with R/RmetricsPortfolio Optimization with R/Rmetrics

An Open Source Platform for TeachingComputational Finance and Financial Engineering

Diethelm Würtz*Yohan Chalabi*, Andrew Ellis**, Stefan Theussl***

Swiss Federal Institute of Technology, ETH ZurichFinance Online GmbH, Zurich

*University of Economics and Business Administration ViennaUniversity of Economics and Business Administration, Vienna

Singapore WorkshopSingapore, February 2010g p , y

1 What is the Performance of Swiss Pension Funds?

E lPerformance of Swiss Pension Funds

1 What is the Performance of Swiss Pension Funds?

ExampleSwiss Pension Fund Portfolio

… based on Global Custody Data of CS, as at December 31, 2009This Index is not an artificially constructed performance index but an index that is based on actual pension fund data.

DJIA @14000

2Y R lli Ri k R t

Lehman failed9-11

Nasdaq all time high2000-03-10

2Y Rolling Risk-Return

Lehman failed2008-09-15

5Y Rolling Risk-Return

Page 221: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

2 What is the most

0.6

0.8

1.0

SBISPISIILMIMPIALT

0.6

0.8

1.0

0.318 0.249 0.302 0.432 0.6 0.781 0.969 1.17 1.39Target Risk

Wei

ght

og |

min

Ris

k =

0.24

8532

Weights2 What is the mostWidely used Approach in PortfolioOptimization ?

0.0

0.2

0.4

0.0

0.2

0.4

0.000102 0.0266 0.053 0.0795 0.106 0.132 0.159 0.185 0.212Target Return

MV

| sol

veR

quad

proOptimization ?

20

Efficient FrontierMV Portfolio | mean-Stdev View

SPIALT

0.15

0.20 SBI

SPISIILMIMPIALT

0.15

0.20

0.318 0.249 0.302 0.432 0.6 0.781 0.969 1.17 1.39Target Risk

Wei

ghte

d R

etur

n

| min

Ris

k =

0.24

8532

Weighted Returns

MinimumVarianceLocus

Efficient Frontier

0.15

0.2

[mea

n] MPI 0.00

0.05

0.10

0.00

0.05

0.10

0.000102 0.0266 0.053 0.0795 0.106 0.132 0.159 0.185 0.212Target Return

W

MV

| sol

veR

quad

prog

EWP Equal Weights PortfolioTGP Tangency PortfolioGMV Global Minim Risk

Locus

50.

10

Targ

et R

etur

n

6

0.0

714

SII

Target Return

0.8

1.0

SBISPISIILMIMPIALT

0.8

1.0

0.318 0.249 0.302 0.432 0.6 0.781 0.969 1.17 1.39Target Risk

Ris

k Bu

dget

s

min

Ris

k =

0.24

9

Cov Risk BudgetsEWP

TGP

0.00

0.05

MV

| sol

veR

quad

prog 0.

053

SBILMI

0.0

0.2

0.4

0.6

0.0

0.2

0.4

0.6

0.000102 0.0266 0.053 0.0795 0.106 0.132 0.159 0.185 0.212

Cov

MV

| sol

veR

quad

prog

| m

Sharpe Ratio

GMV�

0.0 0.5 1.0 1.5 2.0

Target Risk[Cov]

Target Return

3 Are Other Approaches Used by Fund Managers ?3 Are Other Approaches Used by Fund Managers ?

Source: Felix Goltz, Edhec, 2009

Page 222: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

4 How Can We Handle Estimation Errors ?4 How Can We Handle Estimation Errors ?

Estimation of Means and Covariances

Sample Estimator

Robust EstimatorsMCD MVE OGKMCD, MVE, OGK, …

Shrinkage MethodsBayes Stein EstimatoryLedoit-Wolf Estimator

Random Matrix TheoryDenoisingDenoising

5 How Can we Better Diversify Risk Budgets ?5 How Can we Better Diversify Risk Budgets ?

Risk Budgeting takes a finite Compute from the derivativeg grisk resource, and decideshow best to allocate it.

This defaults to Markowitz’

p

portfolio optimization, where results are not only in terms of weights and performance attributions but also in terms

Normalized risk budgets

attributions but also in termsof risk attributions.

To quantify risk attributionswe address the questions

Constrain the portfolio optimization

we address the questionshow would the portfolio risk change if we increase or decrease holdings in a set gof assets.

Page 223: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

6 How Can we Take Care of6 How Can we Take Care ofExtreme Tail Risk Dependencence ?

Use Copulae Lower Tail Risk Dependence Budgets

SBI CH BondsSPI CH StocksSII CH ImmoLMI World BondsMPI World StocksALT World AltInvest

Tail Dependence Coeff:Lower

ALT World AltInvest

SBI SPI 0 SBI SII 0.055 SBI LMI 0.064 SBI MPI 0 SBI ALT 0 SPI SII 0 SPI LMI 0SPI LMI 0 SPI MPI 0.352 SPI ALT 0.273 SII LMI 0.075 SII MPI 0 LMI MPI 0 LMI ALT 0LMI ALT 0MPI ALT 0.124

6 What can We Learn from Portfolio Backtesting Strategies ?

SeriesBAHD - KUWD - OMAD - QATS - UAED - CASH

Weights RecommendationHorizon = 12m | Smoothing: 3m | Startup: 1m | Shift 1mMSCI GCC Portfolio

6. What can We Learn from Portfolio Backtesting Strategies ?

Serie

s

00.

00.

5

BAHD KUWD OMAD QATS UAED CASH

GCCSBAHDKUWDOMADQATSUAEDCASH

2040

6080

Wei

ghts

%

Horizon 12m | Smoothing: 3m | Startup: 1m | Shift 1mMSCI GCC PortfolioGulf Cooperation CouncilCountries Indices

2005-06-01 2006-12-20 2008-07-09

-1.

2005-06-01 2006-12-20 2008-07-09

02

Weights RebalanceHorizon = 12 | Smoothing: 3m | Startup: 1m | Shift 1m

Portfolio vs BenchmarkHorizon = 12m | Smoothing: 3m | Startup: 1m | Shift 1m

Rolling Windows:Horizon 12m Shift 1m

010

2030

40

Wei

ghts

Cha

nges

%

t: 20

06-0

5-31

6-0.2

0.2

Cum

ulat

ed

| shr

inkE

stim

atorPortfolio Strategy:

MV Tangency PortfolioDynamic Horizon < 12M

2005-06-01 2006-12-20 2008-07-09

-10W

Star

t

2005-06-01 2006-12-20 2008-07-09

-0.6

MV

|

Drawdowns | Portfolio vs Benchmark(Max) Portfolio DD = -0.01 | Benchmark DD = -0.01 Strategy: myPortfolioStrategy

Portfolio Benchmark

yOptimal Shrinkage Estimator

best of ��= 0 … 1Partial Cash PositionMax 30% Box Constraints

010

-0.0

06-0

.002

Dra

wdo

wns

Total Return -0.17 -0.38Mean Return 0.00 -0.01

StandardDev Return 0.06 0.09

Maximum Loss -0.22 -0.25

Portfolio Specification:

Type: MV Optimize: minRisk

Max 30% Box Constraints

Weights Smoothing:3m Double EMA

-0.0

2006 2007 2008 2009

Estimator: shrinkEstimator

Constraints:

"maxW[1:(nAssets-1)] = 0.30"

Page 224: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

7 How Can we Include Expert Views into Portfolio Design ?7 How Can we Include Expert Views into Portfolio Design ?

Black-Litterman (1982)Fisher Black and Robert Litterman’s 1992 goal was to create a systematic method of specifying and then incorporating analyst/portfolio manager views into the estimation of marketanalyst/portfolio manager views into the estimation of marketparameters for portfolio optimization.

8 How Can We handle Downside Risk ?

Stone 1973

8 How Can We handle Downside Risk ?[ k = 2, A = Infinity, Y0= mean (R) ]

2Markowitz 1952

Solution: QP 1982, SOCP Programming 1994

Pederson and Satchell 1998

Rockafeller & Uryasev CVaR 1992 k = 1, A = VaR, Y0 = 0

f b d d f i W ( )for some bounded function W ( )

A t D lb Eb H th 1999Solution:Linear Programming

Artzner, Delbaen, Eber, Heath 1999 Other Examples: CDaR, MAD, Minimum Regret

Note if the assets are elliptically distributed we will get

… this makes a coherent risk measure

Note if the assets are elliptically distributed, we will getthe same set of weights as for the Mean-Variance Markowitz Portfolio!

Page 225: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

7 How Can we Include Expert Views into Non Normal Portfolio Design ?7 How Can we Include Expert Views into Non-Normal Portfolio Design ?

Copula Opinion Pooling

an alternative approach to Black-Litterman when asset returnsan alternative approach to Black-Litterman when asset returnsare not normally distributed

The Copula Opinion Pooling (COP) approach of Meucci (2006a, 2006b) makes the modelling of dependencies by using copulas possible.

By simulating market scenarios, the approach is free from distributionalassumptions concerning the variables usedassumptions concerning the variables used.

9 How Can we Analyse the Non Stationary Behaviour of a Return Series ?9 How Can we Analyse the Non-Stationary Behaviour of a Return Series ?

Financial Time Series are Non-StationaryExample Series

e.g. the running variance contains no information on the frequency of a periodic signal, only on its p g , yamplitude

Wavelet Analysis

decomposes a time series into time/frequency space simultaneouslysimultaneously.

One gets information on both the amplitude of any "periodic" signals

i hi h i d h hiwithin the series, and how thisamplitude varies with time.

Page 226: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

10 How Can We Generate Stress Scenarios ?

Example Series

10 How Can We Generate Stress Scenarios ?

Phase Space Embedding and Process Separation

Log Index Series

Process Separation

Log Return SeriesBlack Regime: Returns generated by a

predictive heteroskedastic process Grey Regime: Returns generated by anGrey Regime: Returns generated by an

unpredictable jump process

Grey Bars: Probability to which regime the record belongs

Colored Line Bundle: Crossing indicator to quantify size and strength of the regimes

Robust Covariance Estimation: Filzmoser, Maronna, Werner 2007

10 When Should we Rebalance a Portfolio ?10 When Should we Rebalance a Portfolio ?

Log Stock Market Index

Every Month, every Quarter? No, Rebalance when it becomes necessary !

Signal ?

Sep 7: Federal takeover of Fannie Mae and Freddie Mac Sep 14: Merrill Lynch sold to Bank of America and Lehmann Brothers collapseSep 15: Lehmann Brothers files for bankruptcy protectionS 16 M d ’ d S&P d d ti AIGSep 16: Moody’s and S&P downgrade ratings on AIGSep 17: The US FED lends $85 billion to AIG to avoid bankruptcy. Sep 18: Paulson and Bernanke propose a $700 billion emergency bailout

Page 227: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Constraints and Solvers …11 What Can Rmetrics also do for you ?

Fi i l R t M d li

11 What Can Rmetrics also do for you ?

Financial Return ModelingMany Fat and Semi Fat Tailed DistributionsExtreme Value Theory, Quantile and OBRE-CVaR Estimation

Assets ModelingCorrelation and Dependence Structure Analysis, Copulae Asset Selection by Partitioning, Clustering, and Self Organization

Volatility Modeling and ForecastingUnivariate and Multivariate GARCH ModelsRobust Volatility Modelingy g

Portfolio OptimizationPerformance and Risk Measurement and AttributionC l C t i tComplex Constraints,LP, QP, SOCP, NLP, Mixed Integer ProgrammingBARRAS Multifactor ModelsStability Analysis and Stress Testing (under current implementation)y y g ( p )

Use Rmetrics …

… Thank you

Seite 16

Page 228: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

CHAPTER 16

PRATAP SONDHI

214

Page 229: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The Evaluation of Bank and Sector Resilience to Systemic Shocks

Pratap Sondhi

GF Management, Hongkong

The economic fallout of the present crisis underscores the need for banks

to maintain sufficient capacity to absorb systemic shocks. This capacity

must be actively managed because the economic and business environment

changes from time to time as well as the financial conditions of banks,

individually and collectively. Thus, because of interbank linkages, each

bank must be able to evaluate and monitor not only its own resilience to

systemic shocks but also that of other banks and of the sector as a whole.

Some measures of bank and sector resilience are discussed and numerically

illustrated that can be implemented and monitored to assist active management.

Page 230: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The Evaluation of Bank and Sector Resilience to Systemic Shocks

Pratap Sondhi

Concepts

Page 231: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Can we define proper and easy to interpret measures of bank and sector resilience to systemic shocks?

Macro shockscenario

PropositionChanges in bank default risksector expected losscan measure resilienceto shocks

Initialstate

Scenariostate

Sector expected loss (SAR bn)

-

0.50

1.00

1.50

2.00

Benchmark Scenario

Key Concepts

� Systemic shock> Correlated defaults: Adverse economic shock that might cause joint defaults of banks

with similar credit or market exposure;> Domino/Contagion defaults: Complicated network of interbank liabilities linking

individual banks that might directly cause failure of one bank through default of another one.

� Default risk – A measure of bank risk, expressed in basis points, based on ranking bank financials on an ordinal, relative, risk scale (e.g. bank ratings). Default risk may or may not measure absolute probabilities of default.

� Potential loss – A measure of bank sector risk, expressed in monetary units, derived from Default risk and obtained by regarding the sector as a portfolio of banks;

� Resilience – A measure of the capacity to absorb shocks, obtained by evaluating the change in default risk/potential loss for a specified shock

Page 232: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Context: The IMF has proposed a macro-prudential surveillance program to assess systemic risk

� Identify potential macroeconomic shocks using micro and financial data policy and analysis

� Analyze financial soundness indicators (FSIs) to measure the financial systems vulnerabilities and capacity to absorb losses

� Apply stress tests by combining identified macro risks with the system’s vulnerabilities

FSIs are macro-prudential indicators aggregating micro-prudential, bank level supervisory data

Core FSIs—bank sectorRegulatory capital ratiosAsset quality������������ ��������-provisions)/capital���������������� �� ��� �Earnings and profitability������������� ���������� ������ ������Liquidity���������������������������������!����"������Market risk��#$� ���� ����� ���������%���� �������&�������'*

Encouraged FSIsOther banking sector FSIs��+����������������0��������1��1������� ���!���� ��� ����� ���liquidity in securities market��2��-ask spread���1����������&��� 1��Non-bank financialinstitutions (leverage ratio)Non-financial sectors��+��������1�����������+�����������+������#$��������������������������

Page 233: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

We can develop a bank resilience measure, Default Risk, from bank specific financial factors

Country Riskmodel

Default riskmodel

� Country risk ratingMacro Risk factors

Bank specificfinancial factors

� Bank risk rating

Map ratings to PDsRatings – PD

table� Default Risk (bp)

Risk factors Analytical Models Risk measures

The default risk model rates bank financials according to relative risk

Default risk is a complex, non-linear function of a bank’s financial characteristics

� Model is calibrated to agency bank ratings for banks across the rating spectrum and across many countries

� Model ratings are mapped to a default probability scale to provide a cardinal risk measure

� Examples of key factors determining default risk include, amongst others:� CCountry risk rating� Interest margin� Return on average assets� ���� � ��1����������&� � �� ��������� ����1������������ Cost/Income

Note that the default risk may or may not measure the actual default probability

Page 234: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Ratings versus Default Risk

Default Risk(bp) Model rating1 AAA

2.3 AA4 A+/A

6.9 A/A-11.4 BBB+18.6 BBB29.8 BBB/BBB-46.6 BBB-71.4 BB+

107.1 BB157.6 BB227.3 BB321.3 B+445.3 B+605.3 B807 B

1055.5 B-1525.9 CCC+2341.1 CCC3707 D

Country Riskmodel

Default riskmodel

� Country risk ratingMacro Risk factors

Bank specificfinancial factors

� Default risk (bp) forall banks

Portfolio & Network models

Recovery rates,Default risk relative

volatility,� Sector expected loss,

unexpected loss, 99.9 % potential loss

Risk factors Analytical Models Risk measures

The sector can be modeled as a portfolio of banks to gauge sector loss - a measure of sector resilience

Inter-bank borrowing& lending

Page 235: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Illustrative example – Central bank perspective

A simplified stress test is applied to the Saudi banking sector to illustrate the analysis

� A benchmark risk rating profile is estimated based on 2008 year-end financial statements for each of the 11 banks in the sector from the default risk model;

� Country risk is initially assumed to be AA- rated;

� + ������&�������'�6������'� ��������������� ����&7�

� iincrease country risk - to simulate a macroeconomic shock…

�� � � ����� �� 9 <'��'=>

� Specify g lobal percentage reductions/increases in income/expense line items - ������������ ����� �9� � �����sector shock

Page 236: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Approximations/assumptions are made which would be refined or modified in a proper implementation

� Bank recovery rates are provisionally assumed to be deterministic;

� !'������� ���9��'�6���� �����������������1�� �&��� �� ��� ������&�linked;

� � �&���� �9���� �����'�6������������– bank balance sheets are held � �� ���� �����������������&��'�6�?

� The ratings model calibration is approximate;

� � �&���@�����������9����G��'�6����� ��������9��<'��'�� �����������portfolio model is employed.

Initial macro-factor shock: Country risk rating is lowered from AA- to A

Macro factors initial scenario

Country risk AA- A

Financial factors y/e 2008

Country risk is a background macro risk factor affecting all banks

Page 237: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Sector systemic shock: The country shock is assumedto trigger an income shock uniformly across all banks

Macro factors initial scenario

Country risk AA- A-default rate vol 1 1recovery rate 0.7 0.7

Net interest income -10%

Other Income -10%

Impairment - credit % of assets 1.5%Impairment - investment % of assets 1.0%

��: Financial scenario shocks are illustrative only and not econometrically linked here to the macro shock

The income shock causes large, differential but correlated changes in bank default risk

Changes in default risk can differ even for banks with the same initial state

Default Risk (bp)

0.00

50.00

100.00

150.00

200.00

250.00

300.00

Bank 10 Bank 11

�� scale change

Page 238: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The change in sector loss in response to a shock measures the sector resilience to the shock

% Risk Contributions

0.00

5.00

10.00

15.00

20.00

25.00

Bank1

Bank2

Bank3

Bank4

Bank5

Bank6

Bank7

Bank8

Bank9

Bank10

Bank11

Sector expected loss (SAR bn)

-

0.50

1.00

1.50

2.00

Benchmark Scenario

A portfolio analysis reveals a high level of diversifiable, or concentration, risk in the sector

(SAR bn) Benchmark ScenarioExpected loss 0.56 1.61

Risk analysis > Systematic risk 0.07 0.34> Diversifiable risk 4.66 7.33

Total risk 4.73 7.67

Page 239: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Saudi sector strengths & weaknesses

Commentary based on the stress test*

� Saudi banking sector risk is intensified by bank concentration – small number of banks in the sector, with similar and concentrated sources of revenue/ expense…

� ……which can amplify the exposure to systemic shocks…

� … but the sector is robust to relatively modest shock scenarios due to…

� …the stability of the largest banks;

� Risks to the banking system are concentrated in three banks for the stress scenarios considered;

� Two other banks individually have high default risk but do not contribute proportionally to sector risk due to their small size

* Approximate model calibration and with no accounting adjustments for Islamic banks

Illustrative example- Individual bank perspective

Page 240: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

In practice, the impact of a macro shock should be simulated by its effect on bank specific exposures

� Credit portfolio impairment� Mark to market losses� Decline in interest income� Decline in other income

� Deposit withdrawals

Macro Shock scenario

#� �� ���������&shock

� Sell investments� Reduce loan portfolio� Modify long term borrowing� Dynamic provisioning� Reduce dividends

� Change in defaultrisk (bp)

� Balance sheet shock� Income shock

Management actionss.t. constraints

Defined by appropriateStress test scenarios

- already performed by banks

We select one bank from the sector – bank 6

initial stateASSETS % initial assetsCash & balances with SAMA 5%Due from banks 3%Investments, net 25%Loans & advances 63%Other assets 3%Total assets 100%Total assets ($bn) 34LIABILITIES & EQUITYLiabilitiesDue to banks 7%Customer deposits 73%Other liabilities 4%Term loans 4%Total liabilities 88%

Total equity 12%

Total liabilities and equity 100%

initial stateEquity/Total assets 11.82%Net Interest margin 3.24%Return on avg assets 3.11%Return on avg equity 24.25%Cost/income 19.81%Net loans/Total assets 63.46%Country risk AA-

Default risk (bp) 15

Indicative default risk factors

Page 241: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

A credit shock is simulated that induces a liquidity shock, requiring management action

withdrawals 54% - demand deposits 100% - time deposits 50%

writeoffs 3.00%provisions 3.00%Credit shock

#� �� ���������&shock

Management actionsto fund withdrawals

� Liquidate cash and short term depositss.t. SAMA constraints

� Sell and repurchase govt. bonds- market impact is 3% loss

� Reduce loan book s.t. SAMA constraints

The credit shock raises the default risk to 24 bp

initial stateEquity/Total assets 11.82%Net Interest margin 3.24%Return on avg assets 3.11%Return on avg equity 24.25%Cost/income 19.81%Net loans/Total assets 63.46%Country risk AA-

Default risk (bp) 15

Credit &

Liquidity shocks

AA-

scenario state10.18%3.15%1.40%

11.61%20.35%63.00%

24.2

Page 242: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The combined credit and liquidity shocks reduce the balance sheet from $34 bn to $20 bn…

initial stateASSETS % initial assetsCash & balances with SAMA 5%Due from banks 3%Investments, net 25%Loans & advances 63%Other assets 3%Total assets 100%Total assets ($bn) 34LIABILITIES & EQUITYLiabilitiesDue to banks 7%Customer deposits 73%Other liabilities 4%Term loans 4%Total liabilities 88%

Total equity 12%

Total liabilities and equity 100%

scenario state%final assets

3%1%41%50%6%

100%20

12%59%8%7%85%

15%

100%

Credit &

Liquidity shocks

…and raise the default risk to 71 bp

initial stateEquity/Total assets 11.82%Net Interest margin 3.24%Return on avg assets 3.11%Return on avg equity 24.25%Cost/income 19.81%Net loans/Total assets 63.46%Country risk AA-

Default risk (bp) 15

Credit &

Liquidity shocks

scenario state15.11%2.83%0.02%0.17%

30.14%49.86%

AA-

71.4

Page 243: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The bank’s resilience can be improved by modifying the initial state…

� J ��������������&�"&��� �9���� ��KLN�9�� 1���� ���� �&����6���������with SAMA (Saudi Central Bank);

� !�� �9���L>ON��9�'��QN�� ���������'�6*�9�'����1��� �9���� �������from the scenario (forecast) state to the current period (initial state). However, '������"���&�9����'�@�& �������1��� � �G���@� ������'� �G����� ���on the regulatory/accounting regime.

� Such risk mitigation decisions depend on management’s forecast of the ��"�"���&�9�'���'�6���� ����� ����������������-off between risk and expected return

…reducing the scenario default risk to 30 bp

initial stateEquity/Total assets 11.82%Net Interest margin 3.24%Return on avg assets 3.11%Return on avg equity 24.25%Cost/income 19.81%Net loans/Total assets 63.46%Country risk AA-

Default risk (bp) 15

AA-

scenario state16.01%2.92%0.56%3.86%

29.06%51.12%

29.8

initial state11.47%3.21%2.77%

21.87%19.96%63.39%

modified

AA-

15

Credit &Liquidityshocks

The decision to increase liquidity and loan loss provisions in thecurrent period (initial state) requires a risk/expected return trade-off

Page 244: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Observations

� The change in default risk provides a simple, scalar measure of a bank’s resilience to shocks;

� J��� �"������&������� �1����&� �'���������������� ���������&�������testing that banks perform, from time to time, to summarize their joint effects.

� For a prescribed shock it can assist decisions on how to modify resilience and what level to maintain by allowing an evaluation of risk versus return.

Page 245: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 246: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 247: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

PART IV

APPENDIX

233

Page 248: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 249: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

List of Sponsors

www.ethz.ch

www.rmi.nus.edu.sg

www.finance.ch

www.revolution-computing.com

www.crcpress.com

www.neuraltechsoft.com

Organization

Diethelm Würtz ETH Zurich SwitzerlandJuri Hinz National University of SingaporeDavid Scott University of AucklandMahendra Mehta NeuralTechSoft Mumbai

Conference OfficeYohan Chalabi ETH Zurich SwitzerlandAndrew Ellis Rmetrics Association Zurich

Page 250: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

Page 251: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253

The Rmetrics Association

The Rmetrics Association was founded as an interest group in finance, and is organized as a non-profit foundation under Swiss law. The Rmetrics Association develops and provides software, offers a teaching environment with textbooks and user documentation, organizes and funds student projects and workshops, and is a partner for the banking and insurance industry.

Rmetrics Software Development

Rmetrics offers a collection of Open Source software packages for the R Environment created for teaching computational finance and financial engineering by the Econophysics Group at ETH Zurich. The software packages cover a wide range of topics, such as time series analysis, hypothesis testing, volatility forecasting, extreme value theory, pricing of derivatives, portfolio analysis, risk management, trading analysis and many more. Rmetrics offers an open source teaching solution with state-of-the-art algorithms to help the integration of academic research and industry. All packages are released under the GNU Public license (GPL). Many of the functions contained in this collection are not only used by students in education at the ETH in Zurich, but also in many other academic institutes and business schools worldwide. The Rmetrics packages are increasingly being used as a code archive for rapid model prototyping in business environments such as banks, fund management firms, and insurance companies.

Rmetrics Teaching Environment

Rmetrics offers the most complete teaching environment in financial analysis, covering a wide variety of state-of-the-art techniques, some of which are not even available in commercial software projects. Students not only become acquainted with open source software, but also learn the inner workings and algorithms of financial engineering concepts by studying the source code, which is not possible with commercial software. Rmetrics has been used for teaching in numerous universities and recognized business schools all over the world, and also to train practitioners in the industry.

Rmetrics Knowledge Transfer

The assimilation of new techniques and innovations in the banking and insurance industry is very challenging. Often, practitioners in the industry still rely on methods that have been shown to be unreliable or inadequate. Academic research has demonstrated how to overcome some critical limitations, but industrial practitioners often lag behind the pace of new academic research. The Rmetrics Association is trying to fill this gap by providing open source implementations of the latest research, thus making the resulting methods and techniques available to everybody. We are convinced that it is a fundamental role of academic institutions to share their scientific work with as large a community as possible.

Rmetrics Association, Zurichwww.rmetrics.org

Page 252: Rmetrics Workshop Singapore 2010

Owner: Jean-Luc Duval ([email protected]) @ 195.220.86.253