31
1 G63.2707 - Financial Econometrics and Statistical Arbitrage Farshid Magami Asl Lecture 1. 1 Financial Econometrics and Statistical Arbitrage Master of Science Program in Mathematical Finance New York University Introduction on Time Series Analysis Building Blocks Fall 2011 Copyright Protected (Do Not Copy) G63.2707 - Financial Econometrics and Statistical Arbitrage Farshid Magami Asl Lecture 1. 2 Market Microstructur Theory (Transaction costs and Optimal Control, Algorithmic Trading,…) Risk Management (Practical Risk Measurement and Management Technics) Financial Econometrics (Time Series Review and Volatility modeling) Strategies and Implementation Process (Cointegration based pairs trading, Volatility trading, …) What is Statistical Arbitrage? • Statistical Arbitrage covers any trading strategy which uses statistical tools and time series analysis to identify approximate arbitrage opportunities while evaluating the risks inherent in the trades considering the transaction costs and other practical aspects. • Arbitrage is a riskless profit. “Arbitrage Strategy” is a trading strategy that locks in a riskless profit.

Lecture 1

Embed Size (px)

Citation preview

Page 1: Lecture 1

1

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 1

Financial Econometrics and StatisticalArbitrage

Master of Science Program in Mathematical Finance

New York University

Introduction on Time Series Analysis

Building Blocks

Fall 2011

Copyright Protected (Do Not Copy)

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 2

Market Microstructur Theory(Transaction costs and Optimal Control, Algorithmic Trading,…)

Risk Management(Practical Risk Measurement and Management Technics)

Financial Econometrics(Time Series Review and Volatility modeling)

Strategies and Implementation Process(Cointegration based pairs trading, Volatility trading, …)

What is Statistical Arbitrage?

• Statistical Arbitrage covers any trading strategy which

uses statistical tools and time series analysis to identify

approximate arbitrage opportunities while evaluating the

risks inherent in the trades considering the transaction

costs and other practical aspects.

• Arbitrage is a riskless profit. “Arbitrage Strategy” is a

trading strategy that locks in a riskless profit.

Page 2: Lecture 1

2

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureQuantitative Trading

Quantitative Trading Strategies

Strong Market Forces Weak Market Forces

Law of One Price

No Arbitrage

Portfolio Replication

Market Identities:

e.g. Put-Call Parity,

Cross Market Arbitrage

Converts

Statistical Relationships

between assets:

Co-integrated Pairs Trading,

Volatility Trading

Mean-Revesion

Factor Models, …

Market Anomalies Statistical Arbitrage

Size Effect (Banz, 1981)

Value Effect (Ball, 1978)

January Effect( Roll, 1983)

Momentum and other

Technical Effects

Behavioral Finance

• There are three general types of analysis used in finance and trading

1. Fundamental Analysis

2. Technical Analysis

3. Quantitative Analysis

1. 3

Copyright Protected (Do Not Copy)

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureQuantitative Trading

Trading based on Statistical Arbitrage

Strategies are mostly designed based on:

1. Measuring a signal (observable or unobservable) with some properties (mainly Mean-Reversion )

2. Portfolio effects and Central Limit Theorem.

The Key is to gather many marginally profitable strategies withlow correlations among them

1. 4

Copyright Protected (Do Not Copy)

Reminder: Central Limit Theorem (CLT)Let R1, R2, R3, …, Rn be a sequence of n independent and identically distributed (iid) random variables, representing returns on eachasset i (i=1,2,3,…,n), each having finite values of expectation µ (which we like it to be greater than zero) and variance σ2 > 0.The return of a portfolio of these assets is RP =R1 + R2 + … + Rn .

The central limit theorem states that as the sample size n increases the distribution of the sample average of these randomvariables approaches the normal distribution with a mean µ and variance σ2/n irrespective of the shape of the common distributionof the individual terms Ri. In other words, the distribution of the portfolio return is N( nµ , σ )n

Page 3: Lecture 1

3

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureQuantitative Trading

Trade

$1 Profit

$1 Loss

1 Trade

2 Trades

1000 Trades

-1 0 1 P&L

IR = 0.02

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 P&L

IR = 0.028

-150 -100 -50 0 50 100 150 P&L

IR = 0.632

Trade

$1 Profit

$1 Loss

Trade

$1 Profit

$1 Loss

Trade

$1 Profit

$1 Loss

Trade

$1 Profit

$1 Loss

Trade

$1 Profit

$1 Loss

Trade

$1 Profit

$1 Loss

1. 5

Copyright Protected (Do Not Copy)

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureQuantitative Trading

Effect of Predictive Signals

Number of Trades0 500 1000 1500 2000 2500 3000

0

0.2

0.4

0.6

0.8

1

1.2

1.4

Information Ratio

Trade

$1 Profit

$1 Loss

Trade

$1 Profit

$1 Loss

Stronger Signals (skills)

0 500 1000 1500 2000 2500 30000

1

2

3

4

5

6

Number of Trades

Information Ratio

1. 6

Copyright Protected (Do Not Copy)

Theoretical

Simulation

Page 4: Lecture 1

4

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureQuantitative Trading

Trade

$1 Profit

$1 Loss

Stronger Signals (skills)

Fundamental Elements in Quant Trading:

• Number of Trades

• Predictive power (Strength) of Signals

• Correlation between Signals and hence trades.

Higher Frequency Trading

0 500 1000 1500 2000 2500 30000

1

2

3

4

5

6

Number of Trades

Information Ratio

0 500 1000 1500 2000 2500 30000

1

2

3

4

5

6

Number of Trades

Information Ratio

10% Correlation

1. 7

Copyright Protected (Do Not Copy)

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureQuantitative Trading: Frequency Spectrum

Ultra High

Frequency

Tick Data

Order Book DynamicsMicrostructure Theory

High-Frequency

Seconds - intraday

Statistical Inference

Time Series Analysis

Mid-Frequency

Day - week

Combination ofStatistical andSome Fundamental Factors

T-S & X-sectional AnalysisStatistics

Low-Frequency

Week, Monthand longer

Price Anomalies/Asset Pricing Theory/Maco Forces

Xsection Variations/Equilibrium Methods

Frequency

Cap

acit

y

Market Making Market Taking

Copyright Protected (Do Not Copy)

1. 8

Page 5: Lecture 1

5

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureTypical Behavior of Financial Assets

• The unpredictability inherent in asset prices is the main feature of financial modeling.

• Because there is so much randomness, most mathematical models of a financial asset

acknowledge the randomness and have a probabilistic foundation.

• Financial assets show Dynamic behavior.

Time in minutes (12/03/2007)

10 randomly chosen stocks in Dow Jones IndexDow Jones Index

Time in days from 1/1/1975 to 07/30/2005

31-Dec-1974 11-Mar-1985 21-May-1995 30-Jul-20050

2000

4000

6000

8000

10000

12000

1. 9

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 10Introduction to Financial Modeling

• Return in financial assets

By return we mean the percentage growth in the value of an asset,

together with accumulated dividends, over some period:

Change in value of the asset + accumulated cashflows

Original value of the assetReturn =

• Denoting the asset value on the i-th day by Si, the return from day i

to day i+1 is given by

i

iii

S

SSR

1

Page 6: Lecture 1

6

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 11Introduction to Financial Modeling

• Assume that the empirical returns are close enough to Normal for this to be a

good approximation.

• For start, we write the returns as a random variable drawn from a Normal

distribution with a known, constant, non-zero mean and a known, constant, non-

zero standard deviation:

i

iii

S

SSR

1 = mean + standard deviation x f

2

2

1

2

1)1,0(

eN

Time in days from 2/1/1975 to 07/29/2005

Diffe

rence

of

the

Log

Tra

nsfo

rmof

Dow

Jones

Index

02-Jan-1975 12-Mar-1985 21-May-1995 29-Jul-2005-0.25

-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

0.15

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 12Introduction to Financial Modeling

i

iii

S

SSR

1 = mean + standard deviation x f

2/11 ttS

SSR

i

iii

• Time scale dt

t

Mean return overperiod dt is

2/1t

Standard deviation overperiod dt is

dX (Wiener Process)

And in the limit dt 0

t

t

t dXdtS

dSR

Page 7: Lecture 1

7

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 13

020

4060

80100

1

2

3

4

5

0.9

1

1.1

1.2

1.3

x 104

Basic Review

STOCHASTIC PROCESS:

A stochastic process is a collection of random variables defined on aprobability space . PF ,

tX t ),(

State 2

State 1

State 3

State 4

State 5

For a fixed , a realization of stochastic process is a function of time (t).

),( tX

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 14Simulation of a Stochastic Process

020

4060

80100

0

50

100

150

2000.6

0.8

1

1.2

1.4

1.6

x 104

Page 8: Lecture 1

8

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 15Definition

Time Series:

A time series, , is a stochastic process where t is a set of

discrete points in time . In other words, it is a discrete time,continuous state process.

In this course we consider t = { all integers}

X1 X2 X3 …

Xk

k0 5 10 15 20 25 30 35 40

-4

-3

-2

-1

0

1

2

3

ttX ),(

,3,2,1

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 16

We want to forecast distributions

Goals of Studying Time Series

1- Forecasting

0

2000

4000

6000

8000

10000

12000

Time in days from 1/1/1975 to 07/30/2005

Do

wJo

ne

sIn

de

x

2- Understanding the statistical characteristics and buildingtrading strategies based on them

31-Dec-1974 11-Mar-1985 21-May-1995 30-Jul-2005

Page 9: Lecture 1

9

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureModeling a Dynamic system

State Space Model

Mathematical Model

)()(1)(

tutyRdt

ydyA

)(1

)(1

)( tuA

tyRA

ty

Systemu y

Area (A)

u

Resistance (R)y

Output

Input

Parameters

From Physical Laws, …

)(1

)(1

)()1( tuA

tyRA

tyty

)(

1)()1

1()1(

11

tuA

tyRA

ty

)()()1( 11 tutyty )(twDynamic System

)(tw

Stochastic

Information(Signal)

Noise

1. 17

Copyright Protected (Do Not Copy)

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

LectureModeling a Dynamic system

u yOutputInput

)()()1( 11 tutyty

0 50 100 150 200 250 300-10

-5

0

5

10

0 50 100 150 200 250 300-10

0

10

20

30

In reality, physical modeling could be difficult or impossible, and we have to work with the observeddata

System

w

yOutput

0 50 100 150 200 250 300-10

0

10

20

30

• In financial systems, we can’t measure inputs either

FinancialSystem

w

1. 18

Copyright Protected (Do Not Copy)

Page 10: Lecture 1

10

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 19Basic Review

An Example of a Time Series:

0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0 7 0 0 0- 1 0

- 8

- 6

- 4

- 2

0

2

4

6

8

1 0

Xk

k

-10 -8 -6 -4 -2 0 2 4 6 8 10-10

-8

-6

-4

-2

0

2

4

6

8

10

Xk

Xk-1-10 -8 -6 -4 -2 0 2 4 6 8 10

-10

-8

-6

-4

-2

0

2

4

6

8

10

Xk

Xk-2-10 -8 -6 -4 -2 0 2 4 6 8 10

-10

-8

-6

-4

-2

0

2

4

6

8

10

Xk

Xk-3-10 -8 -6 -4 -2 0 2 4 6 8 10

-10

-8

-6

-4

-2

0

2

4

6

8

10

Xk

Xk-10

Xk= j 1 Xk-1+ j 2 Xk-2+…+ekAuto-Regression as a Dynamic System?We will get back to this

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 20Definition

Autocovariance Function:

Let {Xt} be a time series. The autocovariance function of process {Xt} for all

integers r and s is:

),cov(),( srX XXsr

))]())(([(),( ssrrX XEXXEXEsr

)]()()()([),( srrssrsrX XEXEXEXXEXXXEsr

)()()()()()()(),( srrssrsrX XEXEXEXEXEXEXXEsr

)()()(),( srsrX XEXEXXEsr

0)var()()(),( 22 rrrX XXEXErrNote that

= 0

Page 11: Lecture 1

11

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 21Autocovariance Function

0 2 4 6 8 10 12 14 16 18 20

Lag

Sample Autocovariance Function

)0(X )2(X

)1(X

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 22Definition

Stationary Process:

A time series {Xt} is stationary (weakly) if:

),(),(.3

)(.2

)(.12

tstrsr

XE

XE

XX

t

t

Some constant m for all t

i.e. Cov(Xr,Xs) only depends on r and s and not on t.

)()0,(),(),( srsrsssrsr XXXX

Note: If {Xt} is stationary, then is a function of

),cov()()( httXX XXhsr

Define h=r-sDoes not depend on t

A strict (strong) stationary time series

{Xt , t=1,2,…,n}

is defined by the condition that realizations

(X1, X2, …, Xn) and (X1+h, X2+h, …, Xn+h)

have the same joint distributions for all

integers h and n>0.

Note:

),( srX )( sr

Page 12: Lecture 1

12

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 23Definition

Note:

Strict Stationary(Strong)

Weak Stationary(Covariance Stationary)

Not generally true except for the Gaussian processes

Any strictly stationary process which has a mean and acovariance is also weakly stationary

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 24Stationary Process

Stationary Process and Mean Reversion

• We are interested in stationary time series because many models and

tools are developed for stationary processes.

• A stationary process can never drift too far from its mean because of

the finite variance. The speed of mean-reversion is determined by the

autocovariance function: Mean-reversion is quick when autocovariances

are small and slow when autocovariances are large.

• Trends and periodic components make a time series non-stationary.

Page 13: Lecture 1

13

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 25Stationary Process

0 50 100 150 200 250 300-20

0

20

40

60

80

0 50 100 150 200 250 300-6

-4

-2

0

2

4

Stationary Process

Non-Stationary Process

Mean-Reversion

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 26General Approach to Time Series

Time Series Analysis

1. Plot time series and check for trends or sharp changes in behavior

(most of the time non-stationary)

2. Transform into a stationary time series

3. Fit a model

4. Perform diagnostic tests (residual analysis,…)

5. Generate forecasts (find predictive distributions) and invert the

transformations performed in 2.

Note for option pricing:

6. Find a risk neutral version of the model

7. Obtain predictive distributions under the risk neutral model

If bad

Page 14: Lecture 1

14

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 27Building Blocks of Financial Models

White Noise Process

otherwise

srsrX

0),(

2

0 1000 2000 3000 4000 5000 6000 7000

-5

0

5

WN

If {Xt} is a sequence of random variables with , and0)( tXE

)( 2

2{Xt} is called White Noise and it is written as WN(0, )

22)( tXE

Note that E[Xt Xs]=0 for t=s Uncorrelated r.v.’s

2If Xt and Xs independent for t=s IID(0, )

-5 0 5-5

0

5

Xk

Xk-1

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 28Building Blocks of Financial Models

0)( tXE

)( 2

otherwise

srsrX

0),(

2

White Noise Process (Is it Stationary?)

Page 15: Lecture 1

15

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 29Building Blocks of Financial Models

Random Walk Process

0 1000 2000 3000 4000 5000 6000 7000

-100

0

100

Random

Walk

If {Xt} be a sequence of random variables , a sequence {St}with S0=0 and

Is called a Random Walk.

2IID(0, )

t

j jt XS1

(Integrated Process)

-10 -5 0 5 10-10

-5

0

5

10

Sk

Sk-1

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 30Building Blocks of Financial Models

Random Walk Process (Is it Stationary?)

2IID(0, )

t

j jt XS1

{Xt}

Page 16: Lecture 1

16

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 31Building Blocks of Financial Models

Moving Average Process

Let {Xt} be WN(0, ), and consider the process

Where q could be any constant. This time series model is called a first-order moving average process, denoted MA(1).

The term “Moving Average” comes from the fact that Yt is constructedfrom a weighted sum of the two most recent values of Xt.

1 ttt XXY

2

Yk

-4 -2 0 2 4-4

-2

0

2

4

Yk-10 1000 2000 3000 4000 5000 6000

q =0.5

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 32Building Blocks of Financial Models

Moving Average Process (Is it Stationary?)

{Xt} is WN(0, )1 ttt XXY

2

Page 17: Lecture 1

17

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 33Building Blocks of Financial Models

Autoregressive Process

Let {Zt } be WN(0, ), and consider the process

Where |f |<1 and Zt is uncorrelated with Xs for each s<t. This time series

model is called a first-order Autoregressive process, denoted AR(1).

2

ttt ZXX 1

It is easy to show that E(Xt)=0

0 100 200 300 400 500 600 700

-5

0

5

f=0.7

-10 -5 0 5 10-10

-5

0

5

10

Xk

Xk-1

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 34Building Blocks of Financial Models

Autoregressive Process (Is it Stationary?)

{Zt } is WN(0, ), and

Where |f |<1 and Zt is uncorrelated with Xs for each s<t.

2 ttt ZXX 1

We will see this later

Page 18: Lecture 1

18

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 35Building Blocks of Financial Models

ttt ZXX 1

0 50 100 150 200 250 300-10

0

10

20

30

-10 0 10 20 30-10

0

10

20

30

f = 1

Random Walk

0 50 100 150 200 250 300-10

-5

0

5

10

-10 -5 0 5 10-10

-5

0

5

10

f = 0.9

AR(1)

0 50 100 150 200 250 300-4

-2

0

2

4

-4 -2 0 2 4-4

-2

0

2

4

f = 0.1

AR(1)

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 36Transforming a Non-Stationary Process to a Stationary Process

Classical Decomposition

tttt YSmX

OriginalTime series

(Nonstationary)

TrendSeasonal

component

StationaryTime series(zero-mean)

d

jjS

1

0

Seasonal component St satisfies

St+d=St where d= period of seasonality

Also for mathematical convenience assume

Most observed time series are non-stationary but they can betransformed to stationary processes.

Page 19: Lecture 1

19

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 37Transforming a Non-Stationary Process to a Stationary Process

Classical Decompositiontttt YSmX

tttt SmXX^^

*

Idea of transformation is to estimate mt and St by mt and St, then workwith the stationary process:

Assume there is no seasonal component (St=0)

ttt YmX

2210

^

tataamt

Consider a parametric form for mt e.g.

2

1

^

)(

n

t

tt mX

Using observed data X1, X2, … Xn, choose a0, a1, a2 to minimize

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 38Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 9000

0

2000

4000

6000

8000

10000

12000

Time in days from 1/1/1975 to 07/30/2005

Do

wJo

ne

sIn

de

x

Page 20: Lecture 1

20

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 39Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 90005

5.5

6

6.5

7

7.5

8

8.5

9

9.5

10

Time in days from 1/1/1975 to 07/30/2005

Lo

gT

ran

sfo

rmo

fD

ow

Jo

ne

sIn

de

x

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 40Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 9000

5

5.5

6

6.5

7

7.5

8

8.5

9

9.5

10

Time in days from 1/1/1975 to 07/30/2005

Lo

gT

ran

sfo

rmo

fD

ow

Jo

ne

sIn

de

x

tmt 0004.01513.6

Page 21: Lecture 1

21

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 41Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 9000

-0.3

-0.25

-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

Time in days from 1/1/1975 to 07/30/2005

Diff

ere

nce

of

the

Log

Tra

nsfo

rmof

Dow

Jones

Index

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 42

Forecast

Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000

-0.3

-0.25

-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

0.15

Time in days from 1/1/1975 to 07/30/2005

Fo

reca

sto

fth

em

od

el

Page 22: Lecture 1

22

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 43

Forecast

Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000

6

6.5

7

7.5

8

8.5

9

9.5

10

Time in days from 1/1/1975 to 07/30/2005

Convert

back

the

diff

ere

nce

inth

eF

ore

cast

ofth

em

odel

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 44

Forecast

Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

5000

10000

15000

Time in days from 1/1/1975 to 07/30/2005

conve

rtback

the

Log

of

the

Fore

castof

the

model

Page 23: Lecture 1

23

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 45Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

Time in days from 1/1/1975 to 07/30/2005

Monte

Carlo

Sim

ula

tion

ofth

eF

ore

cast

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 46Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

Time in days from 1/1/1975 to 07/30/2005

Monte

Carlo

Sim

ula

tion

ofth

eF

ore

cast

Page 24: Lecture 1

24

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 47Transforming a Non-Stationary Process to a Stationary Process

0 10 20 30 40 50 60 70 80 90 1000.8

0.9

1

1.1

1.2

1.3x 10

4

0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6

x 104

0

20

40

60

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 48Transforming a Non-Stationary Process to a Stationary Process

Trend Elimination by Differencing

Definition: Differencing Operator

1 ttt XXX

1 tt XBX

Definition: Backshift Operator B

Therefore

tttt XBXXX )1(1

Alsottt XBBXBX )21()1( 222

212 2 tttt XXXX

Page 25: Lecture 1

25

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 49Transforming a Non-Stationary Process to a Stationary Process

Definition: Integrated Process of order n. Time series yt I(n) is

integrated of order n if it is non-stationary, but it becomes stationary after

differencing a minimum of n times.

Example: A stationary process is I(0)

Example: Random Walk is I(1)

tt YtX 10

Note: Difference removes linear trends as well.

Suppose

11010 )1( ttt YtYtX

11 tt YY

Stationary Processwith mean zero

Constant

Note: Difference twice removes quadratic trends.

Warning: Don’t difference too much. Error will be magnified in forecasting

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 50Transforming a Non-Stationary Process to a Stationary Process

Differencing when the seasonal component is present

Definition: Lagged Differencing Operatord

dtttd XXX

td XB )1(

Note:

td

td XX

td XB )1( t

d XB )1(

Page 26: Lecture 1

26

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 51Transforming a Non-Stationary Process to a Stationary Process

Suppose

dtdttttd YSdtYStX )(1010

tttt YSmX

dtt SS

tmt 10

Usually d is known

Stationary Processwith mean zero

Constant

)(1 dtttd YYdX

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 52

Important forfinancial models

Transforming a Non-Stationary Process to a Stationary Process

Other transformations are used to transform a non-stationary process to a

stationary process. Sometimes trends are multiplicative or exponential

instead of additive and random variations are non-Gaussian.

Box and Cox (1964) proposed a general class of transformations:

Box-Cox / Log Transformation

0)log(

0)1(

)(

x

xxf

Page 27: Lecture 1

27

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 1. 53Transforming a Non-Stationary Process to a Stationary Process

0 1000 2000 3000 4000 5000 6000 7000 8000 90000

2000

4000

6000

8000

10000

12000

Time in days from 1/1/1975 to 07/30/2005

Dow Jones Index

0 1000 2000 3000 4000 5000 6000 7000 8000 90005

5.5

6

6.5

7

7.5

8

8.5

9

9.5

10

Time in days from 1/1/1975 to 07/30/2005

Log Transform of Dow Jones Index

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 54Properties of Autocovariance Function

Autocovariance Function:

For a stationary time series {Xt}

),cov()( httX XXh Does not depend on t

Properties:

0)var()0( tX X1

hh XX )0(|)(| 2

)(),cov(),cov()( hXXXXh XththttX 3

Symmetric

|)(|)0(

)]([)0()0(

)]([)()(2

222

h

h

XXEXEXE

XX

XXX

htthtt

222

))()(()()(InequalitysSchwartz' dxxgxfdxxgdxxf

Page 28: Lecture 1

28

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 55Autocovariance Function

0 2 4 6 8 10 12 14 16 18 20

Lag

Sample Autocovariance Function

)0(X )2(X

)1(X

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 56Autocorrelation Function

Autocorrelation Function is the normalized version of the autocovariance

function:

),()0(

)()( htt

X

XX XXcorr

hh

From property : hh XX )0(|)(| 2

1)( hX

)1)0(( X

Correlogram is the graph of autocorrelation function which is the scaled version of

the autocovariance graph.

Page 29: Lecture 1

29

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 57Correlogram

0 2 4 6 8 10 12 14 16 18 20

Lag

Sample Autocorrelation Function

1)0( X )2(X

)1(X

1

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 58Sample Autocovariance Function

• Autocovariance function can be obtained from the time series models.

• In practical problems, we do not start with a model, but with the observed (or

realized) data {X1 , X2 , … , Xn }.

Time Series Model )(hX )(ˆ hXObserved Time Series

Data {X1 , X2 , … , Xn }

Sample AutocovarianceFunction

Autocovariance

Function

Can be obtained from

Page 30: Lecture 1

30

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 59Sample Autocovariance Function

Let {X1 , X2 , … , Xn } be observations of a time series.

Sample Mean of the observations is:

Sample Autocovariance of the observations is:

.)()(1

)(||

1|| nhnxxxx

nh i

hn

ihi

Sample Autocorrelation of the observations is:

.)0(

)()( nhn

hh

Note: If you observe n data points, you can only calculate up to

h=n-1.

)(hX

n

iix

nx

1

1

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 60Sample Autocovariance Function

0 100 200 300 400 500 600 700

-4

-2

0

2

4

0 2 4 6 8 10 12 14 16 18 20

-0.5

0

0.5

1

Lag

Sam

ple

Auto

corr

ela

tion

Sample Autocorrelation Function (ACF)

White Noise

0 2 4 6 8 10 12 14 16 18 20

-0.5

0

0.5

1

Lag

Sam

ple

Auto

corr

ela

tion

Sample Autocorrelation Function (ACF)

0 100 200 300 400 500 600 700

-20

0

20

40

60

Random Walk

Page 31: Lecture 1

31

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 61Sample Autocovariance Function

0 100 200 300 400 500 600 700

-10

-5

0

5

10

0 2 4 6 8 10 12 14 16 18 20

-0.5

0

0.5

1

Lag

Sam

ple

Auto

corr

ela

tion

Sample Autocorrelation Function (ACF)

AR(1) f = 0.9

0 100 200 300 400 500 600 700

-4

-2

0

2

4

6

0 2 4 6 8 10 12 14 16 18 20

-0.5

0

0.5

1

Lag

Sam

ple

Auto

corr

ela

tion

Sample Autocorrelation Function (ACF)

MA(1) q = 0.5

G63.2707 - Financial Econometrics and Statistical ArbitrageFarshid Magami Asl

Lecture 2. 62Sample Autocovariance Function

0 2 4 6 8 10 12 14 16 18 20

-1

-0.5

0

0.5

1

Lag

Sam

ple

Auto

corr

ela

tion

Sample Autocorrelation Function (ACF)

0 100 200 300 400 500 600 700

-10

-5

0

5

10

AR(1) f = -0.9

0 100 200 300 400 500 600 700

-6

-4

-2

0

2

4

0 2 4 6 8 10 12 14 16 18 20

-0.5

0

0.5

1

Sam

ple

Auto

corr

ela

tion

Sample Autocorrelation Function (ACF)

MA(1) q = -0.5