• No results found

Using R for Hedge Fund of

N/A
N/A
Protected

Academic year: 2021

Share "Using R for Hedge Fund of"

Copied!
41
0
0

Loading.... (view fulltext now)

Full text

(1)

Using R for Hedge Fund of

Funds Risk Management

Funds Risk Management

R/Finance 2009: Applied Finance with R R/Finance 2009: Applied Finance with R University of Illinois Chicago, April 25, 2009

Eric Zivot

Professor and Gary Waterman Distinguished Scholar, Department of Economics

Adjunct Professor, Departments of Finance and Statistics University of Washington

(2)

Outline

Outline

• Hedge fund of funds environmentHedge fund of funds environment • Factor model risk measurement

i l i i i

• R implementation in corporate environment • Dealing with unequal data histories

• Some thoughts on S-PLUS and S+FinMetrics vs. R in Finance

(3)

Hedge Fund of Funds Environment

• HFoFs are hedge funds that invest in other hedge funds

– 20 to 30 portfolios of hedge funds – Typical portfolio size is 30 funds

• Hedge fund universe is large: 5000 live funds – Segmented into 10-15 distinct strategy types

• Hedge funds voluntarily report monthly performance to commercial databases

– Altvest, CISDM, HedgeFund.net, Lipper TASS, CS/Tremont, HFR

(4)

Hedge Fund Universe

Hedge Fund Universe

Live funds

Convertible Arbitrage Dedicated Short Bias Emerging Markets Equity Market Neutral Event Driven

Fixed Income Arbitrage Global Macro

Long/Short Equity Hedge Managed Futures

Multi-Strategy Fund of Funds

(5)

Characteristics of Monthly Returns

Characteristics of Monthly Returns

• Reporting biasesReporting biases

– Survivorship, backfill

N l b h i

• Non-normal behavior

– Asymmetry (skewness) and fat tails (excess k t i )

kurtosis)

• Serial correlation

– Performance smoothing, illiquid positions

(6)

Characteristics of Hedge Fund Data

Characteristics of Hedge Fund Data

fund1 fund2 fund3 fund4 fund5 Observations 122.0000 107.0000 135.0000 135.0000 135.0000 NAs 13.0000 28.0000 0.0000 0.0000 0.0000 Minimum -0.0842 -0.3649 -0.0519 -0.1556 -0.2900 Quartile 1 -0.0016 -0.0051 0.0020 -0.0017 -0.0021 Median 0.0058 0.0046 0.0060 0.0073 0.0049 Arithmetic Mean 0.0038 -0.0017 0.0063 0.0059 0.0021 Geometric Mean 0.0037 -0.0029 0.0062 0.0055 0.0014 Quartile 3 0.0158 0.0129 0.0127 0.0157 0.0127 Maximum 0.0311 0.0861 0.0502 0.0762 0.0877 Variance 0.0003 0.0020 0.0002 0.0008 0.0013 Stdev 0.0176 0.0443 0.0152 0.0275 0.0357 Skewness -1.7753 -5.6202 -0.8810 -2.4839 -4.9948 Kurtosis 5.2887 40.9681 3.7960 13.8201 35.8623 Rho1 0.6060 0.3820 0.3590 0.4400 0.383

(7)

Factor Model Risk Measurement in

HFoFs Portfolio

• Quantify factor risk exposuresQuantify factor risk exposures

– Equity, rates, credit, volatility, currency, commodity etc

commodity, etc.

• Quantify tail risk

V R ETL – VaR, ETL

• Risk budgeting

– Component, incremental, marginal

(8)

Commercial Products

Commercial Products

www riskdata com www finanalytica com www.riskdata.com www.finanalytica.com

Very expensive! R is not! Very expensive! R is not!

(9)

Factor Model: Methodology

Factor Model: Methodology

1 1

,

it i i t ik kt it

R

=

α β

+

F

+ +

β

F

+

ε

1

i i it

i

t

t

T

α

ε

=

+

β

F

t

+

F

1, , ; , ,

~ ( ,

)

i t F

i

=

n t

=

t

T

F

μ Σ

F 2 ,

(

)

~ (0,

)

t F it ε i

ε

σ

μ

cov(

, ) 0 for all , and

cov(

) 0 for

jt it

f

j i

t

i

j

ε

ε ε

=

=

cov( ,

ε ε

it jt

) 0 for

=

i

j

(10)

Practical Considerations

Practical Considerations

• Many potential risk factors ( > 50)Many potential risk factors ( > 50)

• High collinearity among some factors

i k f di i li /

• Risk factors vary across discipline/strategy • Nonlinear effects

• Dynamic effects

• Time varying coefficientsTime varying coefficients

• Common histories for factors; unequal histories for fund performance

(11)

Expected Return Decomposition

Expected Return Decomposition

]

[

]

[

]

[

R

E

F

E

F

E

[

R

it

]

i

β

i1

E

[

F

1t

]

β

ik

E

[

F

kt

]

E

=

α

+

β

+

+

β

E t d t d t “b t ” ] [ ] [ 1 1 t ik kt i E F

β

E F

β

+ +

Expected return due to “beta” exposure

1

1 t ik kt

i

β

β

Expected return due to manager specific “alpha”

]) [ ] [ ( ] [ it i1 1t ik kt i E R β E F β E F α = − + +

(12)

Variance Decomposition

p

2

var( )R = β′ var( )F β + var( )

ε

= β Σ β′ +

σ

,

var( )Rit = βi var( )Ft βi + var( )

ε

it = β Σ βi F i +

σ

ε i

systematic specific

Variance contribution due to factor exposures

) var( ) var( ) var( 1 22 2 2 2 1 F t β F t βk Fkt β + + + ) cov( 2 ) cov( 2

β

β

F F + +

β

β

F F

Variance contribution due to covariances between factors

) , cov( 2 ) , cov( 2

β

1

β

2 F1t F2t + +

β

k1

β

k Fk1t Fkt

(13)

Covariance

Covariance

t t

=

+

+

t

R

α

B F

ε

( )R Σ B′ + D 1 1 n n k t1 t1 n× × × k× n×

+

+

t

R

α

B F

ε

2 2 ,1 , var( ) ( , , ) t FM n R diag ε ε

σ

ε

σ

ε ′ = Σ = + = F B D Dε ε,1ε,n cov( ,R Rit jt ) = βi var( )Ft β j = β Σ βi F j Note:

(14)

Portfolio Analysis

Portfolio Analysis

1 ( , , ) portfolio weightsw wn ′ = = wR = wR = wα + wBF + wε 1 ( , , )n p g n it i t n i i n i i n it i t t t pt w w w R w R ε α + ′ + = = + + = =

β F ε w BF w α w R w pt t p p i it i t i i i i i i i it i R w w w w ε α ε α + ′ + = + +

= = = = F β F β 1 1 1 1 pt t p p

(15)

Portfolio Variance Decomposition

Portfolio Variance Decomposition

′ + ′ ′ ′ R 2 ( ) (R ) BΣ B D ′ ′ = ′ + ′ ′ = ′ = = F systematic p F t pt p R 2 , 2 var( ) var( ) σ σ w B w Dw w w B w w R w

= ′ = n i i i specific p y p w 1 2 , 2 , , ε σ σ w Dw 2 2 , 2 p systematic p R σ σ = = i 1 σ p 2 2 2 , , covariance terms k p systematic p F p p j jj σ = β ′Σ β =

β σ + 1 2 2 2 covariance terms j k p systematic p j jj σ β σ = = ,

, 1 p systematic p j jj j β =

(16)

Risk Budgeting: Volatility

Risk Budgeting: Volatility

p σ BΣ B w Dw MCR = ∂ = F ′ + Marginal contributions systematic p σ w B MCR w MCR F ′ = = ∂ = g to risk specific p systematic σ σ Dw MCR = p σ ( ) p σ ∂ ′ + = = w BΣFB w Dw CR w Components to risk p σ = = ∂ CR w w

= = ′CR n CR σ 1 p

= = = i p i CR 1 σ CR 1

(17)

Tail Risk Measures

Tail Risk Measures

Value-at-Risk (VaR)

1

( )

VaR

α

= − = −

q

α

F

α

of returns

F

=

CDF

R

Expected Shortfall (ES)

[ | ]

ES E R R VaR[ | ≤ ]

(18)

Tail Risk Measures: Normal Distribution

Tail Risk Measures: Normal Distribution

2 2

~

(

,

),

p p p p FM

R

N

μ σ

σ

= Σ

w

w

1

, ( )

1

N p p

VaR

α

= −

μ

σ

×

z

α

z

α

= Φ

α

1

( )

N p p

ES

α

μ

σ

φ

z

α

α

=

(19)

Tail Risk Measures: Non-Normal Distributions

Tail Risk Measures: Non Normal Distributions

Use Cornish-Fisher expansion to account for asymmetry p y y and fat tails

CF i i VaRα = −μ σ− × zα

(

2

)

(

3

)

(

3

)

2 1 1 1 1 3 2 5 6 24 36 i i

i z skewi z z ekurti z z skewi

α α α α α α α μ σ ⎡ ⎤ + − − − − + − ⎣ ⎦ : CF

ESα Formula given in Boudt, Peterson and Croux (2008)

"Estimation and Decomposition of Downside Risk for Portfolios with Non-Normal Returns," Journal of Risk and implementation in PerformanceAnalytics

(20)

Risk Budgeting: Tail Risk

Value-at-Risk (VaR) cV a Rα ,i , 1 1 , n n i i i i i i VaR VaR w w m VaR w α α α = = ∂ = = × ∂

,i [ i | p ] i VaR m VaR E R R VaR w α α α ∂ = = − = ∂

Expected Shortfall (ES)

n n ES ES

∂ α

ES ,i cE Sα , 1 1 , [ | ] i i i i i i ES w w m ES w ES ES E R R V R α α α α = = = = × ∂ ∂

,i [ i | p ] m ES E R R VaR w α α = = − ≤ α

(21)

Risk Budgeting: Explicit Formulas

Risk Budgeting: Explicit Formulas

• Normal distributionNormal distribution

– See Jorian (2007) or Dowd (2002)

N l di t ib ti i C i h Fi h

• Non-normal distribution using Cornish-Fisher expansion

S B d P d C (2008) "E i i

– See Boudt, Peterson and Croux (2008) "Estimation and Decomposition of Downside Risk for

Portfolios with Non Normal Returns " Journal of

Portfolios with Non-Normal Returns, Journal of Risk and implementation in PerformanceAnalytics

(22)

Risk Budgeting: Simulation

Risk Budgeting: Simulation

1

{ }M simulated returns

it t

R = = M

Method 1: Brute Force

,i , ,i i i VaR ES mVaR mES w w α α α α Δ Δ ≈ = Δ i Δ i

Method 2: Average Rit around values for which Rpt = VaR VaRα , , : : , i it i it t R VaR t R VaR mVaRα R mESα R ε = ± ≤ ≈ −

≈ −

: pt : pt t R =VaRα±ε t RVaRα

(23)

R Functions for Factor Model Risk

Analysis

Function Function factorModelCovariance normalES factorModelRiskDecomposition normalPortfolioES normalVaR normalMarginalES normalVaR normalMarginalES normalPortfolioVaR normalComponentES normalMarginalVaR modifiedES normalComponentVaR modifiedPortfolioES normalVaRreport modifiedESreport modifiedVaR simulatedMarginalVaR modifiedPortfolioVaR simulatedComponentVaR modifiedMarginalVaR simulatedMarginalES modifiedComponentVaR simulatedComponentES modifiedComponentVaR simulatedComponentES

(24)

Unequal Histories

Unequal Histories

Risk factors Fund performance

1,T , , k T,

FF R1,T

Risk factors Fund performance

, n T R 1,T Ti , , k T, Ti F F 1 1,T T R R 1,1, , k ,1 FF , n n T T R

(25)

Example Portfolio: Unequal Histories of Individual Funds X 165939 0 .0 4 0 .0 0 X 104314 -0.0 5 0 .0 0 0 .0 5 -0 .0 8 -0 0 .0 0 .1 -0.1 5 -0. 10 00 X 29554 0 .3 -0 .2 -0 .1 0 X 153684 08 -0 .0 4 0 .00 -0 0 0. 02 0. 04 6 9 -0 .0 0. 02 4 5 -0 .0 4 0 .0 0 X 1131 6 -0 .0 6 -0. 02 X 1561 4 1998 2000 2002 2004 2006 2008 1998 2000 2002 2004 2006 2008

(26)

Implication of Unequal Histories

Implication of Unequal Histories

• Can’t fit factor models to some fundsCan t fit factor models to some funds

– Need to create proxy factor model

St ti ti hi t i (t t d d t )

• Statistics on common histories (truncated data) may be unreliable

• Difficult to compute non-normal tail risk measures

(27)

Extract Data from Database

Analysis and Reporting Flow Process Database E l Flow Process Excel Spreadsheets xlsReadWrite

R: Fit factor models R data files

Excel R: Simulation, portfolio

RODBC

RODBC

Spreadsheets calculations, risk analysis

(28)

S ffi i

Factor Model Construction

Sufficient

history? No

Yes

Fit factor model :

Variable selection: leaps, MASS

Collinearity diagnostics: car

d i i d l

Create proxy factor model from models with sufficient history dynamic regression: dynlm

(29)

Evaluation of Fitted Factor Models

Evaluation of Fitted Factor Models

• Graphical diagnosticsGraphical diagnostics

– Created plot method appropriate for time series regression

regression.

• Stability analysis

CUSUM t t h

– CUSUM etc: strucchange

– Rolling analysis: rollapply (zoo)

Ti i dl

– Time varying parameters: dlm

• Dynamic effects

(30)

Diagnostic Plots: Example Fund

0. 02 p , 0. 00 c e 4 -0 .0 2 n th ly p e rfo rm an c -0. 06 -0 .0 4 M o n -0 .0 8 -2005 2006 2007 2008 2009 Actual Fitted 2005 2006 2007 2008 2009

(31)

0 .6 0. 8 1 .0 60

Time Series Regression Residual diagnostics

AC F -0 .2 0 .0 0 .2 0 .4 0 1. 0 De n s it y 30 40 50 PA CF -0 .2 0 .0 0 .2 0 .4 0 .6 0 .8 01 0 2 0 Lag 5 10 15 Returns -0.04 -0.02 0.00 0.02

OLS-based CUSUM test

1. 5 .02 u at io n pro c es s 0 0. 5 1 .0 a l Q uant il es 0. 0 0 0 . Em pi ri c a l f luc tu -1 .0 -0.5 0. 0 Em p ir ic a -0 .0 4 -0. 02

(32)

24-month rolling estimates (I n te rc ept ) 0. 000 0. 004 X 144887 0 .0 5 0. 15 ( -0 .004 0. 25 -0 .0 5 0 0 .3 X 144874 0. 05 0. 15 0. 1 0 .2 0 X 144911 -0 .0 5 -0 .1 0 .0 7 5 0. 0 2007 2008 2009 Index -0 .4 -0 .3 -0 .2 X 1448 7 2007 2008 2009

(33)

Dealing with Unequal Histories

Dealing with Unequal Histories

• Estimate conditional distribution ofEstimate conditional distribution of RRi givengiven FF

– Fitted factor model or proxy factor model

E ti t i l di t ib ti f F

• Estimate marginal distribution of F

– Empirical distribution, multivariate normal, copula

• Derive marginal distribution of Ri from p(Ri|F)

and p(F)

• Simulate Ri and Calculate functional of interest

(34)

Simulation Algorithm

Simulation Algorithm

• DrawDraw by resampling from the

{

F1 F M

}

by resampling from the

empirical distribution of F.

• For each (u = 1 M) draw a value

{

F1, ,… F M

}

F R

• For each (u = 1, …, M), draw a value

from the estimated conditional distribution of

R given F= (e g from fitted factor model

u

F Ri u,

F

Ri given F= (e.g., from fitted factor model

assuming normal errors)

i h d i d l f R

u

F

{ }

M

R

• is the desired sample for Ri

• M ≈ 5000

{ }

, 1 i u u R =

(35)

What to do with

{ }

,

?

M i u

R

What to do with ?

• Backfill missing fund performance

{ }

,

1

i u

u=

Backfill missing fund performance

• Compute fund and portfolio performance measures

measures

• Estimate non-parametric fund and portfolio tail i k

risk measures

• Compute non-parametric risk budgeting measures

• Standard errors can be computed using a p g

(36)

Example: Backfilled Fund Performance 0. 05 0 .0 0 0 -0 .0 5 1998 2000 2002 2004 2006 1998 2000 2002 2004 2006

(37)

Example: Simulated portfolio distribution

60 % Mo d V a R 99% VaR 40 50 99 % D ens it y 30 40 1 02 0 0 1 -0.08 -0.06 -0.04 -0.02 0.00 0.02 0.04

(38)

S-PLUS and S+FinMetrics vs R

S PLUS and S+FinMetrics vs R

• Dealing with time series objects in R can beDealing with time series objects in R can be difficult and confusing

timeSeries zoo xts – timeSeries, zoo, xts

• Time series regression in R is incompletely

i l t d

implemented

– Diagnostic plots, prediction

• R packages give about 80% functional coverage to S+FinMetrics

(39)

Some Thoughts About Using R in a

C

i

Corporate Environment

• IT doesn’t want to support itIT doesn t want to support it • Firewalls block R downloads

h ld f l d h

• The world runs from an Excel spreadsheet

• Analysts with some programming experience learn R quickly

(40)

References

References

• Boudt, K., B. Peterson and C. Croux (2008) "Estimation and , , ( ) Decomposition of Downside Risk for Portfolios with Non-Normal Returns," Journal of Risk

D d K (2002) M i M k Ri k J h Wil d • Dowd, K. (2002), Measuring Market Risk, John Wiley and

Sons

• Goodworth, T. and C. Jones (2007). “Factor-based, Non-Goodwo t , . a d C. Jo es ( 007). acto based, No parametric Risk Measurement Framework for Hedge Funds and Fund-of-Funds,” The European Journal of Finance.

H ll b k J (2003) “D i P f li V l Ri k • Hallerback, J. (2003). “Decomposing Portfolio Value-at-Risk:

A General Analysis”, The Journal of Risk 5/2.

(41)

References

References

• Jiang, Y. (2009). g, ( ) Overcoming Data Challenges in Fund-of-g g f Funds Portfolio Management, PhD Thesis, Department of Statistics, University of Washington.

L A (2007) H d F d A A l i P i • Lo, A. (2007). Hedge Funds: An Analytic Perspective,

Princeton.

• Yamai, Y. and T. Yoshiba (2002). “Comparative Analyses of a a , . a d . os ba ( 00 ). Co pa at ve a yses o Expected Shortfall and Value-at-Risk: Their Estimation Error, Decomposition, and Optimization, Institute for Monetary and Economic Studies Bank of Japan

References

Related documents

Freedom House 2011 ranks the overall freedom of Panama as a free, while political rights is a 1 and civil liberties are a 2 (treedomhouse.org). These scores indicate that Panama

In the event this procedure results in more than one applicable classification from subsection (a), and if the payment schedules are different, then the revenue department

relationship exists between complex buying behaviour with the factor i.e. “positive reactions/feelings towards advertisements displayed on it” of social media advertising

The major soil erosion indicators identified by the farmers were land slide, bare land, falling of trees, formation of gullies, decreasing of spring water,

That is the point of interior design using augmented reality application in Android was recommend, which is providing a more precise, power-driven and easier platform

Influence of parameters on flame expansion in a high-speed flow: experimental and numerical study.. Proceedings of the Institution of Mechanical Engineers, Part A: Journal of

• Green – Not as Important, or likely high cost/extended implementation time – Fiscal notes. –

these drugs need to include warnings of potential “increased risk of cardiovascular events and the well-described, serious potential life-threatening gastrointestinal (GI)