+ All Categories
Home > Documents > Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance...

Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance...

Date post: 26-Feb-2021
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
84
GLOBAL STANDARD IN FINANCIAL ENGINEERING CERTIFICATE IN FINANCE CQF Certificate in Quantitative Finance Subtext t here
Transcript
Page 1: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

GLOBAL STANDARD IN FINANCIAL ENGINEERING

CERTIFICATE IN

FINANCE

CQF

Certificate in Quantitative FinanceSubtext t here

A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53

Page 2: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 3: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

Certificate in QuantitativeFinance

Probability and Statistics

June 2011

1

Page 4: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1 PROBABILITY

1 Probability

1.1 Preliminaries

• An experiment is a repeatable process that givesrise to a number of outcomes.

• An event is a collection (or set) of one or more out-comes.

• An sample space is the set of all possible outcomesof an experiment, often denoted Ω.

Example

In an experiment a dice is rolled and the number ap-pearing on top is recorded.

ThusΩ = 1, 2, 3, 4, 5, 6

If E1, E2, E3 are the events even, odd and prime occur-ring, then

E1 =2, 4, 6E2 =1, 3, 5E3 =2, 3, 5

2

Page 5: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.1 Preliminaries 1 PROBABILITY

1.1.1 Probability Scale

Probability of an Event E occurring i.e. P (E) is lessthan or equal to 1 and greater than or equal to 0.

0 ≤ P (E) ≤ 1

1.1.2 Probability of an Event

The probability of an event occurring is defined as:

P (E) =The number of ways the event can occur

Total number of outcomes

Example

A fair dice is tossed. The event A is defined as thenumber obtained is a multiple of 3. Determine P (A)

Ω =1, 2, 3, 4, 5, 6A =3, 6

∴ P (A) =2

6

1.1.3 The Complimentary Event E ′

An event E occurs or it does not. If E is the event thenE ′ is the complimentary event, i.e. not E where

P (E ′) = 1− P (E)

3

Page 6: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.2 Probability Diagrams 1 PROBABILITY

1.2 Probability Diagrams

It is useful to represent problems diagrammatically. Threeuseful diagrams are:

• Sample space or two way table

• Tree diagram

• Venn diagram

Example

Two dice are thrown and their numbers added to-gether. What is the probability of achieving a total of8?

P (8) =5

36Example

A bag contains 4 red, 5 yellow and 11 blue balls. Aball is pulled out at random, its colour noted and then

4

Page 7: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.2 Probability Diagrams 1 PROBABILITY

replaced. What is the probability of picking a red and ablue ball in any order.

P(Red and Blue) or P(Blue and Red) =(4

20× 11

20

)+

(11

20× 4

20

)=

11

50

Venn Diagram

A Venn diagram is a way of representing data sets orevents. Consider two events A and B. A Venn diagramto represent these events could be:

• A ∪B ”A or B”

5

Page 8: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.2 Probability Diagrams 1 PROBABILITY

• A ∩B ”A and B”

Addition Rule:

P (A ∪B) = P (A) + P (B)− P (A ∩B)

orP (A ∩B) = P (A) + P (B)− P (A ∪B)

Example

In a class of 30 students, 7 are in the choir, 5 are inthe school band and 2 students are in the choir and theschool band. A student is chosen at random from theclass. Find:

a) The probability the student is not in the band

b) The probability the student is not in the choir nor inthe band

6

Page 9: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.2 Probability Diagrams 1 PROBABILITY

P (not in band) =5 + 20

30

=25

30=

5

6

P (not in either) =20

30=

2

3

Example

A vet surveys 100 of her clients, she finds that:

(i) 25 own dogs

(ii) 53 own cats

(iii) 40 own tropical fish

(iv) 15 own dogs and cats

(v) 10 own cats and tropical fish

7

Page 10: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.2 Probability Diagrams 1 PROBABILITY

(vi) 11 own dogs and tropical fish

(vii) 7 own dogs, cats and tropical fish

If she picks a client at random, Find:

a) P(Owns dogs only)

b) P(Does not own tropical fish)

c) P(Does not own dogs, cats or tropical fish)

P (Dogs only) =6

100

P (Does not own tropical fish) =6 + 8 + 35 + 11

100=

60

100

P (Does not own dogs, cats or tropical fish) =11

100

8

Page 11: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.3 Conditional Probability 1 PROBABILITY

1.3 Conditional Probability

The probability of an event B may be different if youknow that a dependent event A has already occurred.

Example

Consider a school which has 100 students in its sixthform. 50 students study mathematics, 29 study biologyand 13 study both subjects. You walk into a biology classand select a student at random. What is the probabilitythat this student also studies mathematics?

P (study maths given they study biology) = P (M |B) =13

29

In general, we have:

9

Page 12: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.3 Conditional Probability 1 PROBABILITY

P (A|B) =P (A ∩B)

P (B)

or, Multiplication Rule:

P (A ∩B) = P (A|B)× P (B)

Example

You are dealt exactly two playing cards from a wellshuffled standard 52 card deck. What is the probabilitythat both your cards are Kings ?

Tree Diagram!

P (K ∩K) =4

52× 3

51=

1

221=≈ 0.5%

or

P (K∩K) = P (2nd is King | first is king)×P (first is king) =3

51× 4

52

We know,

P (A ∩B) = P (B ∩ A)

10

Page 13: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.3 Conditional Probability 1 PROBABILITY

so

P (A ∩B) = P (A|B)× P (B)

P (B ∩ A) = P (B|A)× P (A)

i.e.

P (A|B)× P (B) = P (B|A)× P (A)

or

Bayes’ Theorem:

P (B|A) =P (A|B)× P (B)

P (A)

Example

You have 10 coins in a bag. 9 are fair and 1 is doubleheaded. If you pull out a coin from the bag and do notexamine it. Find:

1. Probability of getting 5 heads in a row

2. Probability that if you get 5 heads the you pickedthe double headed coin

11

Page 14: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.3 Conditional Probability 1 PROBABILITY

P (5heads) = P (5heads|N)× P (N) + P (5heads|H)× P (H)

=

(1

32× 9

10

)+

(1× 1

10

)=

41

320≈ 13%

P (H|5heads) =P (5heads|H)× P (H)

P (5heads)

=1× 1

1041320

=320

410≈ 78%

12

Page 15: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.4 Mutually exclusive and Independent events 1 PROBABILITY

1.4 Mutually exclusive and Independent

events

When events can not happen at the same time, i.e. nooutcomes in common, they are called mutually exclu-sive. If this is the case, then

P (A ∩B) = 0

and the addition rule becomes

P (A ∪B) = P (A) + P (B)

Example

Two dice are rolled, event A is ’the sum of the out-comes on both dice is 5’ and event B is ’the outcome oneach dice is the same’

When one event has no effect on another event, thetwo events are said to be independent, i.e.

P (A|B) = P (A)

and the multiplication rule becomes

P (A ∩B) = P (A)× P (B)

13

Page 16: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.5 Two famous problems 1 PROBABILITY

Example

A red dice and a blue dice are rolled, if event A is ’theoutcome on the red dice is 3’ and event B ’is the outcomeon the blue dice is 3’ then events A and B are said to beindependent.

1.5 Two famous problems

• Birthday Problem - What is the probability thatat least 2 people share the same birthday

• Monty Hall Game Show - Would you swap ?

14

Page 17: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.6 Random Variables 1 PROBABILITY

1.6 Random Variables

1.6.1 Notation

Random Variables X, Y, Z

Observed Variables x, y, z

1.6.2 Definition

Outcomes of experiments are not always numbers, e.g.two heads appearing; picking an ace from a deck of cards.We need some way of assigning real numbers to each ran-dom event. Random variables assign numbers to events.

Thus a random variable (RV) X is a function whichmaps from the sample space Ω to the number line.

Example

let X = the number facing up when a fair dice is rolled,

or let X represent the outcome of a coin toss, where

X =

1 if heads0 if tails

1.6.3 Types of Random variable

1. Discrete - Countable outcomes, e.g. roll of a dice,rain or no rain

2. Continuous - Infinite number of outcomes, e.g. exactamount of rain in mm

15

Page 18: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.7 Probability Distributions 1 PROBABILITY

1.7 Probability Distributions

Depending on whether you are dealing with a discreteor continuous random variable will determine how youdefine your probability distribution.

1.7.1 Discrete distributions

When dealing with a discrete random variable we de-fine the probability distribution using a probaility massfucntion or simply a probability function.

ExampleThe RV X is defined as’ the sum of scores shown by

two fair six sided dice’. Find the probability distributionof X

A sample space diagram for the experiment is:

The distribution can be tabulated as:

x 2 3 4 5 6 7 8 9 10 11 12

P (X = x) 136

236

336

436

536

636

536

436

336

236

136

16

Page 19: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.7 Probability Distributions 1 PROBABILITY

or can be represented on a graph as

1.7.2 Continuous Distributions

As continuous random variables can take any value, i.e aninfinite number of values, we must define our probabilitydistribution differently.

For a continuous RV the probability of getting a spe-cific value is zero, i.e

P (X = x) = 0

and so just as we go from bar charts to histograms whenrepresenting discrete and continuous data, we must use aprobability density function (PDF) when describing theprobability distribution of a continuous RV.

17

Page 20: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.7 Probability Distributions 1 PROBABILITY

P (a < X < b) =

∫ b

a

f(x)dx

Properties of a PDF:

• f(x) ≥ 0 since probabilities are always positive

•∫ +∞∞ f(x)dx = 1

• P (a < X < b) =∫ ba f(x)dx

Example

The random variable X has the probability densityfunction:

f(x) =

k 1 < x < 2k(x− 1) 2 ≤ x ≤ 40 otherwise

18

Page 21: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.7 Probability Distributions 1 PROBABILITY

a) Find k and Sketch the probability distribution

b) Find P (X ≤ 1.5)

a) ∫ +∞

∞f(x)dx = 1

1 =

∫ 2

1

kdx+

∫ 4

2

k(x− 1)dx

1 = [kx]21 +

[kx2

2− kx

]42

1 = 2k − k + [(8k − 4k)− (2k − 2k)]

1 = 5k

∴ k =1

5

19

Page 22: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.8 Cumulative Distribution Function 1 PROBABILITY

b)

P (X ≤ 1.5) =

∫ 1.5

1

1

5dx

=[x

5

]1.51

=1

10

1.8 Cumulative Distribution Function

The CDF is an alternative function for summarising aprobability distribution. It provides a formula for P (X ≤x), i.e.

F (x) = P (X ≤ x)

1.8.1 Discrete Random variables

Example

Consider the probability distribution

x 1 2 3 4 5 6

P (X = x) 12

14

18

116

132

132

F (X) = P (X ≤ x)

Find:

a) F (2) and

b) F (4.5)

20

Page 23: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.8 Cumulative Distribution Function 1 PROBABILITY

a)

F (2) = P (X ≤ 2) = P (X = 1) + P (X = 2)

=1

2+

1

4

=3

4

b)

F (4.5) = P (X ≤ 4.5) = P (X ≤ 4)

=1

16+

1

8+

1

4+

1

2

=15

16

1.8.2 Continuous Random Variable

For continuous random variables

F (X) = P (X ≤ x) =

∫ x

−∞f(x)dx

or

f(x) =d

dxF (x)

Example

A PDF is defined as

f(x) =

311(4− x2) 0 ≤ x ≤ 10 otherwise

Find the CDF

21

Page 24: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.8 Cumulative Distribution Function 1 PROBABILITY

Consider:

From −∞ to 0: F (x) = 0

From 1 to ∞: F (x) = 1

From 0 to 1 :

22

Page 25: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.8 Cumulative Distribution Function 1 PROBABILITY

F (x) =

∫ x

0

3

11(4− x2)dx

=3

11

[4x− x3

3

]x0

=3

11

[4x− x3

3

]i.e.

F (x) =

0 x < 0311

[4x− x3

3

]0 ≤ x ≤ 1

1 x > 1

Example

A CDF is defined as:

F (x) =

0 x < 1112

[x2 + 2x− 3

]1 ≤ x ≤ 3

1 x > 3

a) Find P (1.5 ≤ x ≤ 2.5)b) Find f(x)

a)

P (1.5 ≤ x ≤ 2.5) = F (2.5)− F (1.5)

=1

12(2.52 + 2(2.5)− 3)− 1

12(1.52 + 2(1.5)− 3)

= 0.5

23

Page 26: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.9 Expectation and Variance 1 PROBABILITY

b)

f(x) =d

dxF (x)

f(x) =

16(x+ 1) 1 ≤ x ≤ 30 otherwise

1.9 Expectation and Variance

The expectation or expected value of a random variableX is the mean µ (measure of center), i.e.

E(X) = µ

The variance of a random variables X is a measure ofdispersion and is labeled σ2, i.e.

V ar(X) = σ2

1.9.1 Discrete Random variables

For a discrete random variable

E(X) =∑allx

xP (X = x)

Example

Consider the probability distribution

x 1 2 3 4

P (X = x) 12

14

18

18

then

24

Page 27: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.9 Expectation and Variance 1 PROBABILITY

E(X) = (1× 1

2) + (2× 1

4) + (3× 1

8) + (4× 1

8)

=15

8

25

Page 28: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.9 Expectation and Variance 1 PROBABILITY

AsideWhat is Variance?

Variance =

∑(x− µ)2

n

=

∑x2

n− µ2

Standard deviation =

√∑(x− µ)2

n

=

√∑x2

n− µ2

26

Page 29: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.9 Expectation and Variance 1 PROBABILITY

For a discrete random variable

V ar(X) = E(X2)− [E(X)]2

Now, for previous example

E(X2) = 12 × 1

2+ 22 × 1

4+ 32 × 18 + 42 × 1

8

E(X) =15

18

∴ V ar(X) =71

64= 1.10937...

Standard Deviation = 1.05(3s.f)

1.9.2 Continuous Random Variables

For a continuous random variable

E(X) =

∫allx

xf(x)dx

and

V ar(X) = E(X2)− [E(X)]2

=

∫allx

x2f(x)dx−[∫

allx

xf(x)dx

]2Example

if

f(x) =

332(4x− x2) 0 ≤ x ≤ 40 otherwise

27

Page 30: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.9 Expectation and Variance 1 PROBABILITY

Find E(X) and V ar(X)

E(X) =

∫ 4

0

x.3

32(4x− x2)dx

=3

32

∫ 4

0

4x− x2dx

=3

32

[4x3

3− x4

4

]40

=3

32

[(4(4)3

3− 44

4

)− (0)

]= 2

V ar(X) = E(X2)− [E(X)]2

=

∫ 4

0

x2.3

32(4x− x2)dx− 22

=3

32

[4x4

4− x5

5

]40

− 4

=3

32

[44 − 45

5

]− 4

=4

5

28

Page 31: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.10 Expectation Algebra 1 PROBABILITY

1.10 Expectation Algebra

Suppose X and Y are random variables and a,b and care constants. Then:

• E(X + a) = E(X) + a

• E(aX) = aE(X)

• E(X + Y ) = E(X) + E(Y )

• V ar(X + a) = V ar(X)

• V ar(aX) = a2V ar(X)

• V ar(b) = 0

If X and Y are independent, then

• E(XY ) = E(X)E(Y )

• V ar(X + Y ) = V ar(X) + V ar(Y )

29

Page 32: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.11 Moments 1 PROBABILITY

1.11 Moments

The first moment is E(X) = µ

The nth moment is E(Xn) =∫allx x

nf(x)dx

We are often interested in the moments about themean, i.e. central moments.

The 2nd central moment about the mean is called thevariance E[(X − µ)2] = σ2

The 3rd central moment is E[(X − µ)3]

So we can compare with other distributions, we scalewith σ3 and define Skewness.

Skewness =E[(X − µ)3]

σ3

This is a measure of asymmetry of a distribution. Adistribution which is symmetric has skew of 0. Negativevalues of the skewness indicate data that are skewed tothe left, where positive values of skewness indicate dataskewed to the right.

30

Page 33: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.11 Moments 1 PROBABILITY

The 4th normalised central moment is called Kurtosisand is defined as

Kurtosis =E[(X − µ)4]

σ4

A normal random variable has Kurtosis of 3 irrespec-tive of its mean and standard deviation. Often whencomparing a distribution to the normal distribution, themeasure of excess Kurtosis is used, i.e. Kurtosis ofdistribution −3.

Intiution to help understand Kurtosis

Consider the following data and the effect on the Kur-tosis of a continuous distribution.

xi < µ± σ :

The contribution to the Kurtosis from all data pointswithin 1 standard deviation from the mean is low since

(xi − µ)4

σ4< 1

e.g consider

x1 = µ+1

then(x1 − µ)4

σ4=

(12

)4σ4

σ4=

(1

2

)4

=1

16

xi > µ± σ :

31

Page 34: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.11 Moments 1 PROBABILITY

The contribution to the Kurtosis from data pointsgreater than 1 standard deviation from the mean willbe greater the further they are from the mean.

(xi − µ)4

σ4> 1

e.g considerx1 = µ+ 3σ

then(x1 − µ)4

σ4=

(3σ)4

σ4= 81

This shows that a data point 3 standard deviationsfrom the mean would have a much greater effect on theKurtosis than data close to the mean value. Therefore,if the distribution has more data in the tails, i.e. fat tailsthen it will have a larger Kurtosis.

Thus Kurtosis is often seen as a measure of how ’fat’the tails of a distribution are.

If a random variable has Kurtosis greater than 3 isis called Leptokurtic, if is has Kurtosis less than 3 it iscalled platykurtic

Leptokurtic is associated with PDF’s that are simul-taneously peaked and have fat tails.

32

Page 35: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.11 Moments 1 PROBABILITY

33

Page 36: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.12 Covariance 1 PROBABILITY

1.12 Covariance

The covariance is useful in studying the statistical de-pendence between two random variables. If X and Y

are random variables, then theor covariance is definedas:

Cov(X, Y ) = E [(X − E(X))(Y − E(Y ))]

= E(XY )− E(X)E(Y )

Intuition

Imagine we have a single sample of X and Y, so that:

X = 1, E(X) = 0

Y = 3, E(Y ) = 4

NowX − E(X) = 1

andY − E(Y ) = −1

i.e.Cov(X, Y ) = −1

So in this sample when X was above its expected valueand Y was below its expected value we get a negativenumber.

Now if we do this for every X and Y and averagethis product, we should find the Covariance is negative.What about if:

34

Page 37: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.12 Covariance 1 PROBABILITY

X = 4, E(X) = 0

Y = 7, E(Y ) = 4

NowX − E(X) = 4

andY − E(Y ) = 3

i.e.Cov(X, Y ) = 12

i.e positive

We can now define an important dimensionless quan-tity (used in finance) called the correlation coefficientand denoted ρXY (X, Y ) where

ρXY =Cov(X, Y )

σXσY; −1 ≤ ρXY ≤ 1

If ρXY = −1 =⇒ perfect negative correlation

If ρXY = 1 =⇒ perfect positive correlation

If ρXY = 0 =⇒ uncorrelated

35

Page 38: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

1.13 Important Distributions

1.13.1 Binomial Distribution

The Binomial distribution is a discrete distribution andcan be used if the following are true.

• A fixed number of trials, n

• Trials are independent

• Probability of success is a constant p

We say X ∼ B(n, p) and

P (X = x) =

(n

x

)px(1− p)n−x

where (n

x

)=

n!

x!(n− x)!

Example

If X ∼ B(10, 0.23), find

a) P (X = 3)

b) P (X < 4)

a)

P (X = 3) =

(10

3

)(0.23)3(1− 0.23)7

= 0.2343

36

Page 39: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

b)

P (X < 4) = P (X ≤ 3)

= P (X = 0) + P (X = 1) + P (X = 2) + P (X = 3)

=

(10

0

)(0.23)0(0.77)10 +

(10

1

)(0.23)1(0.77)9

+

(10

2

)(0.23)2(0.77)8 +

(10

3

)(0.23)3(0.77)7

= 0.821(3 d.p)

Example

Paul rolls a standard fair cubical die 8 times. What isthe probability that he gets 2 sixes.

Let X be the random variable equal to the number of6’s obtained, i.e X ∼ B(8, 16)

P (X = 2) =

(8

2

)(1

6

)2(1

6

)6

= 0.2604(4 d.p)

It can be shown that for a binomial distribution whereX ∼ B(n, p)

E(X) = np

andV ar(X) = np(1− p)

37

Page 40: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

1.13.2 Poisson Distribution

The Poisson distribution is a discrete distribution wherethe random variable X represents the number of eventsthat occur ’at random’ in any interval. If X is to have aPoisson distribution then events must occur

• Singly, i.e. no chance of two events occurring at thesame time

• Independently of each other

• Probability of an event occurring at all points in timeis the same

We say X ∼ Po(λ).

The Poisson distribution has probability function:

P (X = r) =e−λλr

r!r = 0, 1, 2...

It can be shown that:

E(X) = λ

V ar(X) = λ

Example

Between 6pm and 7pm, directory enquiries receivescalls at the rate of 2 per minute. Find the probabilitythat:

(i) 4 calls arrive in a randomly chosen minute

(ii) 6 calls arrive in a randomly chosen two minute pe-riod

38

Page 41: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

(i) Let X be the number of call in 1 minute, so

λ = 2, i.e. E(X) = 2

and

X ∼ Po(2) =e−22r

r!

P (X = 4) =e−224

4!= 0.090(3 d.p)

(ii) Let Y be the number of calls in 2 minutes, so

λ = 4, i.e. E(Y ) = 4

and

P (Y = 6) =e−446

6!= 0.104(3 d.p)

39

Page 42: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

1.13.3 Normal Distribution

The Normal distribution is a continuous distribution.This is the most important distribution. If X is a ran-dom variable that follows the normal distribution we say:

X ∼ N(µ, σ2)

whereE(X) = µ

V ar(X) = σ2

and the PDF is described as

PDF = f(x) =1

σ√

2πe

(x−µ)2

2σ2

i.e.

P (X ≤ x) =

∫ x

−∞

1

σ√

2πe

(s−µ)2

2σ2 ds

The Normal distribution is symmetric and area underthe graph equals 1, i.e.∫ +∞

−∞

1

σ√

2πe

(x−µ)2

2σ2 dx = 1

40

Page 43: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

To find the probabilities we must integrate under f(x),this is not easy to do and requires numerical methods.In order to avoid this numerical calculation we definea standard normal distribution, for which values havealready been documented.

The Standard Normal distribution is just a transfor-mation of the Normal distribution.

1.13.4 Standard Normal distribution

We define a standard normal random variable by Z,where Z ∼ N(0, 1), i.e.

E(Z) = 0

V ar(Z) = 1

thus the PDF is

φ(z) =1√2πe

−z22

and

Φ(z) =

∫ z

−∞

1√2πe

−s22 ds

41

Page 44: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

To transform a Normal distribution into a StandardNormal distribution, we use:

Z =X − µσ

Example

Given X ∼ N(12, 16) find:

a) P (X < 14)

b) P (X > 11)

c) P (13 < X < 15)

a)

Z =X − µσ

=14− 12

4= 0.5

Therefore we want

P (Z ≤ 0.5) = Φ(0.5)

= 0.6915

(from tables)

b)

42

Page 45: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

Z =11− 12

4= −0.25

Therefore we want

P (Z > −0.25)

but this is not in the tables. From symmetry this is thesame as

P (Z < 0.25)

i.e.Φ(0.25)

thus

P (Z > −0.25) = Φ(0.25)

= 0.5987

c)

43

Page 46: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

Z1 =13− 12

4= 0.25

Z2 =15− 12

4= 0.75

Therefore

P (0.25 < Z < 0.75) = Φ(0.75)− Φ(0.25)

= 0.7734− 0.5987

= 0.1747

1.13.5 Common regions

The percentages of the Normal Distribution lying withinthe given number of standard deviations either side ofthe mean are approximately:

One Standard Deviation:

Two Standard Deviations:

44

Page 47: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.13 Important Distributions 1 PROBABILITY

Three Standard Deviations:

45

Page 48: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.14 Central Limit Theorem 1 PROBABILITY

1.14 Central Limit Theorem

The Central Limit Theorem states:

Suppose X1, X2, ......, Xn are n independent randomvariables, each having the same distribution. Then as nincreases, the distributions of

X1 +X2 + ......+Xn

and ofX1 +X2 + ......+Xn

ncome increasingly to resemble normal distributions.

Why is this important ?

The importance lies in the fact:

(i) The common distribution of X is not stated - it canbe any distribution

(ii) The resemblance to a normal distribution holds forremarkably small n

(iii) Total and means are quantities of interest

If X is a random variable with mean µ and standarddevaition σ fom an unknown distribution, the centrallimit theorem states that the distribution of the samplemeans is Normal.

But what are it’s mean and variance ?

Let us consider the sample mean as another randomvariable, which we will denote X. We know that

X =X1 +X2 + ......Xn

n=

1

nX1 +

1

nX2 + ......+

1

nXn

46

Page 49: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.14 Central Limit Theorem 1 PROBABILITY

We want E(X) and V ar(X)

E(X) = E

(1

nX1 +

1

nX2 + ......+

1

nXn

)=

1

nE(X1) +

1

nE(X2) + ......+

1

nE(Xn)

=1

nµ+

1

nµ+ ......+

1

= n

(1

)= µ

i.e. the expectation of the sample mean is the popu-lation mean !

V ar(X) = V ar

(1

nX1 +

1

nX2 + ......+

1

nXn

)= V ar

(1

nX1

)+ V ar

(1

nX2

)+ ......+ V ar

(1

nXn

)=

(1

n

)2

V ar(X1) +

(1

n

)2

V ar(X2) + .....+

(1

n

)2

V ar(Xn)

=

(1

n

)2

σ2 +

(1

n

)2

σ2 + .....+

(1

n

)2

σ2

= n

(1

n

)2

σ2

=σ2

n

Thus CLT tells us that where n is a sufficiently large

47

Page 50: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.14 Central Limit Theorem 1 PROBABILITY

number of samples.

X ∼ N(µ,σ2

n)

Standardising, we get the equivalent result that

X − µσ√n

∼ N(0, 1)

This analysis could be repeated for the sum Sn = X1+X2 + .......+Xn and we would find that

Sn − nµσ√n∼ N(0, 1)

Example

Consider a 6 sided fair dice. We know that E(X) = 3.5and V ar(X) = 35

12 .

Let us now consider an experiment. The experimentconsists of rolling the dice n times and calculating theaverage for the experiment. We will run 500 such exper-iments and record the results in a Histogram.

n=1

In each experiment the dice is rolled once only, thisexperiment is then repeated 500 times. The graph belowshows the resulting frequency chart.

48

Page 51: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.14 Central Limit Theorem 1 PROBABILITY

This clearly resembles a uniform distribution (as ex-pected).

Let us now increase the number of rolls, but continueto carry out 500 experiments each time and see whathappens to the distribution of X

n=5

49

Page 52: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

1.14 Central Limit Theorem 1 PROBABILITY

n=10

n=30

We can see that even for small sample sizes (numberof dice rolls), our resulting distribution begins to lookmore like a Normal distribution. we can also note thatas n increases our distribution begins to narrow, i.e. thevariance becomes smaller σ2

n , but the mean remains thesame µ.

50

Page 53: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2 STATISTICS

2 Statistics

2.1 Sampling

So far we have been dealing with populations, howeversometimes the population is too large to be able to anal-yse and we need to use a sample in order to estimate thepopulation parameters, i.e. mean and variance.

Consider a population of N data points and a sampletaken from this population of n data points.

We know that the mean and variance of a populationare given by:

population mean, µ =

∑Ni=1 xiN

and

population variance, σ2 =

∑Ni=1 (xi − x)2

N

51

Page 54: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.1 Sampling 2 STATISTICS

But how can we use the sample to estimate our pop-ulation parameters?

First we define an unbiased estimator. An unbiasedestimator is when the expected value of the estimator isexactly equal to the corresponding population parame-ter, i.e.

if x is the sample mean then the unbiased estimator is

E(x) = µ

where the sample mean is given by:

x =

∑Ni=1 xin

If S2 is the sample variance, then the unbiased esti-mator is

E(S2) = σ2

where the sample variance is given by:

S2 =

∑ni=1 (xi − x)2

n− 1

2.1.1 Proof

From the CLT, we know:

E(X) = µ

and

V ar(X) =σ2

nAlso

V ar(X) = E(X2)− [E(X)]2

52

Page 55: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.1 Sampling 2 STATISTICS

i.e.σ2

n= E(X2)− µ2

or

E(X2) =σ2

n+ µ2

For a single piece of data n = 1, so

E(X2i ) = σ2 + µ2

Now

E[∑

(Xi − X)2]

= E[∑

X2i − nX2

]=∑

E(X2i )− nE(X)2

= nσ2 + nµ2 − n(σ2

n+ µ2

)= nσ2 + nµ2 − σ2 − nµ2

= (n− 1)σ2

∴ σ2 =E[∑

(Xi − X)2]

n− 1

53

Page 56: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.2 Maximum Likelihood Estimation 2 STATISTICS

2.2 Maximum Likelihood Estimation

The Maximum Likelihood Estimation (MLE) is a sta-tistical method used for fitting data to a model (Dataanalysis).

We are asking the question:

”Given the set of data, what model parameters is mostlikely to give this data?”

MLE is well defined for the standard distributions,however in complex problems, the MLE may be unsuit-able or even fail to exist.

Note:When using the MLE model we must first as-sume a distribution, i.e. a parametric model, after whichwe can try to determine the model parameters.

2.2.1 Motivating example

Consider data from a Binomial distribution with randomvariable X and parameters n = 10 and p = p0. Theparameter p0 is fixed and unknown to us. That is:

f(x; p0) = P (X = x) =

(10

x

)P x0 (1− p0)10−x

Now suppose we observe some data X = 3.

Our goal is to estimate the actual parameter value p0based on the data.

54

Page 57: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.2 Maximum Likelihood Estimation 2 STATISTICS

Thought Experiments:

let us assume p0 = 0.5, so probability of generatingthe data we saw is

f(3; 0.5) = P (X = 3)

=

(10

3

)(0.5)3(0.5)7

≈ 0.117

Not very high !

How about p0 = 0.4, again

f(3; 0.4) = P (X = 3)

=

(10

3

)(0.4)3(0.6)7

≈ 0.215

better......

So in general let p0 = p and we want to maximisef(3; p), i.e.

f(3; p) = P (X = 3) =

(10

3

)P 3(1− p)7

Let us define a new function called the likelihood func-tion `(p; 3) such that `(p; 3) = f(3; p). Now we want tomaximise this function.

Maximising this function is the same as maximisingthe log of this function (we will explain why we do this

55

Page 58: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.2 Maximum Likelihood Estimation 2 STATISTICS

later!), so letL(p; 3) = log `(p; 3)

therefore,

L(p; 3) = 3 log p+ 7 log(1− p) + log

(10

3

)To maximise we need to find dL

dp = 0

dL

dp= 0

3

p− 7

1− p= 0

3(1− p)− 7p = 0

p =3

10

Thus the value of p0 that maximises L(p; 3) is p = 310 .

This is called the Maximum Likelihood estimate ofp0.

2.2.2 In General

If we have n pieces of iid data x1, x2, x3, ....xn with prob-ability density (or mass) function f(x1, x2, x3, ....xn; θ),where θ are the unknown parameter(s). Then the Max-imum likelihood function is defined as

`(θ;x1, x2, x3, ....xn) = f(x1, x2, x3, ....xn; θ)

and the log-likelihood function can be defined as

56

Page 59: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.2 Maximum Likelihood Estimation 2 STATISTICS

L(θ;x1, x2, x3, ....xn) = log `(θ;x1, x2, x3, ....xn)

Where the maximum likelihood estimate of the param-eter(s) θ0 can be obtained by maximising L(θ;x1, x2, x3, ....xn)

2.2.3 Normal Distribution

Consider a random variable X such that X ∼ N(µ, σ2).Let x1, x2, x3, ....xn be a random sample of iid observa-tions. To find the maximum likelihood estimators of µand σ2 we need to maximise the log-likelihood function.

f(x1, x2, x3, ....xn;µ, σ) = f(x1;µ, σ).f(x2;µ, σ).......f(xn;µ, σ)

`(µ, σ;x1, x2, x3, ....xn) = f(x1;µ, σ).f(x2;µ, σ).......f(xn;µ, σ)

∴ L(µ, σ;x1, x2, x3, ....xn) = log `(µ, σ;x1, x2, x3, ....xn)

= log f(x1;µ, σ) + log f(x2;µ, σ) + .....+ log f(xn;µ, σ)

=n∑i=1

logf(xi;µ, σ)

For the Normal distribution

f(x;µ, σ) =1

σ√

2πe−

(x−µ)2

2σ2

57

Page 60: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.2 Maximum Likelihood Estimation 2 STATISTICS

so

L(µ, σ;x1, x2, x3, ....xn) = log

[n∑i=1

1

σ√

2πe−

(xi−µ)2

2σ2

]

= −n2

log(2π)− n log(σ)− 1

2σ2

n∑i=1

(xi − µ)2

To maximise we differentiate partially with respect to µand σ set the derivatives to zero and solve. If we wereto do this, we would get:

µ =1

n

n∑i=1

xi

and

σ2 =1

n

n∑i=1

(xi − µ)2

58

Page 61: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.3 Regression and Correlation 2 STATISTICS

2.3 Regression and Correlation

2.3.1 Linear regression

We are often interested in looking at the relationship be-tween two variables (bivariate data). If we can modelthis relationship then we can use our model to make pre-dictions.

A sensible first step would be to plot the data on ascatter diagram, i.e. pairs of values (xi, yi)

Now we can try to fit a straight line through the data.We would like to fit the straight line so as to minimisethe sum of the squared distances of the points from theline. The different between the data value and the fittedline is called the residual or error and the technique ofoften referred to as the method of least squares.

59

Page 62: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.3 Regression and Correlation 2 STATISTICS

If the equation of the line is given by

y = bx+ a

then the error in y, i..e the residual of the ith data point(xi, yi) would be

ri = yi − y= yi − (bxi + a)

We want to minimise∑n=∞

n=1 r2i , i.e.

S.R =n=∞∑n=1

r2i =n=∞∑n=1

[yi − (bxi + a)]2

We want to find the b and a that minimise∑n=∞

n=1 r2i .

S.R =∑[

y2i − 2yi(bxi + a) + (bxi + a)2]

=∑[

y2i − 2byixi − 2ayi + b2x2i + 2baxi + a2]

or

= ny2 − 2bnxy − 2any + b2nx2 + 2banx+ na2

60

Page 63: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.3 Regression and Correlation 2 STATISTICS

To minimise, we want

(i) ∂(S.R)∂b = 0

(ii) ∂(S.R)∂a = 0

(i)

∂(S.R)

∂b= −2nxy + 2bnx2 + 2anx = 0

(ii)∂(S.R)

∂a= −2ny + 2bnx+ 2an = 0

These are linear simultaneous equations in b and aand can be solved to get

b =SxySxx

where

Sxx =∑

(xi − x)2 =∑

(x2i )−∑

(xi)2

n

and

Sxy =∑

(xi − x)(yi − y) =∑

xiyi −(∑xi)(

∑yi)

n

a = y − bxExample

x 5 10 15 20 25 30 35 40

y 98 90 81 66 61 47 39 34∑xi = 180

∑yi = 516

∑x2i = 5100

∑y2i = 37228

∑xiyi = 9585

61

Page 64: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.3 Regression and Correlation 2 STATISTICS

Sxy = 9585− 180× 516

8= −2025

Sxx = 5100− 1802

8= 1050

∴ b =−2025

1050= −1.929

x =180

8= 22.5 y =

516

8= 64.5

∴ a = 64.5− (−1.929× 22.5) = 107.9

i.e.y = −1.929x+ 107.9

62

Page 65: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.3 Regression and Correlation 2 STATISTICS

2.3.2 Correlation

A measure of how two variables are dependent is theircorrelation. When viewing scatter graphs we can oftendetermine if their is any correlation by sight, e.g.

63

Page 66: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.3 Regression and Correlation 2 STATISTICS

It is often advantageous to try to quantify the corre-lation between between two variables, this can be donein a number of ways, two such methods are described.

2.3.3 Pearson Product-Moment Corre-

lation Coefficient

A measure often used within statistics to quantify thisis the Pearson product-moment correlation coeffi-cient. This correlation coefficient is a measure of lineardependence between two variables, giving a value be-tween +1 and −1.

PMCC r =Sxy√SxxSyy

ExampleConsider the previous example, i.e.

x 5 10 15 20 25 30 35 40

y 98 90 81 66 61 47 39 34

We calculated,

64

Page 67: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.3 Regression and Correlation 2 STATISTICS

Sxy = −2025 and Sxx = 1050

also,

Syy =∑

(yi − y)2 =∑

(y2i )−∑

(yi)2

ni.e

Syy = 37228− 5162

8= 3946

therefore,

r =−2025√

1050× 3946= −0.995

This shows a strong negative correlation and if we wereto plot this using a scatter diagram, we can see this vi-sually.

2.3.4 Spearman’s Rank Correlation Co-

efficient

Another method of measuring the relationship betweentwo variables is to use the Spearman’s rank corre-

65

Page 68: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.3 Regression and Correlation 2 STATISTICS

lation coeffieint. Instead of dealing with the valuesof the variables as in the product moment correlationcoefficient, we assign a number (rank) to each variable.We then calculate a correlation coefficient based on theranks. The calculated value is called the SpearmansRank Correlation Coefficient, rs, and is an approxima-tion to the PMCC.

rs = 1− 6∑d2i

n(n2 − 1)

where d is the difference in ranks and n is the number ofpairs.

ExampleConsider two judges who score a dancing championship

and are tasked with ranking the competitors in order.The following table shows the ranking that the judgesgave the competitors.

Competitor A B C D E F G H

JudgeX 3 1 6 7 5 4 8 2

JudgeY 2 1 5 8 4 3 7 6

calculating d2, we get

difference d 1 0 1 1 1 1 1 4

difference2 d2 1 0 1 1 1 1 1 16

∴∑

d2i = 22 and n = 8

rs = 1− 6× 22

8(82 − 1)= 0.738

66

Page 69: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.4 Time Series 2 STATISTICS

i.e. strong positive correlation

2.4 Time Series

A time series is a sequence of data points, measured typi-cally at successive times spaced at uniform time intervals.Examples of time series are the daily closing value of theDow Jones index or the annual flow volume of the NileRiver at Aswan.

Time series analysis comprises methods for analyzingtime series data in order to extract meaningful statisticsand other characteristics of the data.

Two methods for modeling time series data are (i)Moving average models (MA) and (ii) Autoregressivemodels.

2.4.1 Moving Average

The moving average model is a common approach tomodeling univariate data. Moving averages smooth the

67

Page 70: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.4 Time Series 2 STATISTICS

price data to form a trend following indicator. They donot predict price direction, but rather define the currentdirection with a lag.

Moving averages lag because they are based on pastprices. Despite this lag, moving averages help smoothprice action and filter out the noise. The two most pop-ular types of moving averages are the Simple MovingAverage (SMA) and the Exponential Moving Average(EMA).

Simple moving average

A simple moving average is formed by computing theaverage over a specific number of periods.

Consider a 5-day simple moving average for closingprices of a stock. This is the five day sum of closingprices divided by five. As its name implies, a movingaverage is an average that moves. Old data is droppedas new data comes available. This causes the averageto move along the time scale. Below is an example of a5-day moving average evolving over three days.

The first day of the moving average simply covers the

68

Page 71: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.4 Time Series 2 STATISTICS

last five days. The second day of the moving averagedrops the first data point (11) and adds the new datapoint (16). The third day of the moving average contin-ues by dropping the first data point (12) and adding thenew data point (17). In the example above, prices grad-ually increase from 11 to 17 over a total of seven days.Notice that the moving average also rises from 13 to 15over a three day calculation period. Also notice thateach moving average value is just below the last price.For example, the moving average for day one equals 13and the last price is 15. Prices the prior four days werelower and this causes the moving average to lag.

Exponential moving average

Exponential moving averages reduce the lag by apply-ing more weight to recent prices. The weighting appliedto the most recent price depends on the number of pe-riods in the moving average. There are three steps tocalculating an exponential moving average. First, calcu-late the simple moving average. An exponential movingaverage (EMA) has to start somewhere so a simple mov-ing average is used as the previous period’s EMA in thefirst calculation. Second, calculate the weighting multi-plier. Third, calculate the exponential moving average.The formula below is for a 10-day E.

Ei+1 = 2−(n+1)(Pi+1 − Ei) + Ei

69

Page 72: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.4 Time Series 2 STATISTICS

A 10-period exponential moving average applies an18.18% weighting to the most recent price. A 10-periodEMA can also be called an 18.18% EMA.

A 20-period EMA applies a 9.52% weighing to themost recent price 2

20+1 = .0952. Notice that the weight-ing for the shorter time period is more than the weightingfor the longer time period. In fact, the weighting dropsby half every time the moving average period doubles.

70

Page 73: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.4 Time Series 2 STATISTICS

2.4.2 Autoregressive models

Autoregressive models are models that describe randomprocesses (denote here as et) that can be described bya weighted sum of its previous values and a white noiseerror.

An AR(1) process is a first-order one process, meaningthat only the immediately previous value has a directeffect on the current value

et = ret−1 + ut

where r is a constant that has absolute value less thanone, and ut is a white noise process drawn from a distri-

71

Page 74: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

2.4 Time Series 2 STATISTICS

bution with mean zero and finite variance, often a normaldistribution.

An AR(2) would have the form

et = r1et−1 + r2et−2 + ut

and so on. In theory a process might be representedby an AR(∞).

72

Page 75: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 76: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 77: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 78: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 79: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 80: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 81: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 82: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 83: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative
Page 84: Certificate in Quantitative Finance - Fitch Learning...CQF Certificate in Quantitative Finance Subtext t here A4 PowerPoint cover Portrait2.indd 1 21/10/2011 10:53 Certi cate in Quantitative

Recommended