probability and sampling theory and the financial bootstrap tools (part 1) ief 217a: lecture 2.b...

21
Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Post on 15-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Probability and Sampling Theoryand the Financial Bootstrap Tools

(Part 1)IEF 217a: Lecture 2.b

Jorion, Chapter 4

Fall 2002

Page 2: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Sampling Outline (1)

• Sampling– Coin flips and political polls– The birthday problem (a not so obvious

problem)

• Random variables and probabilities– Rainfall– The portfolio (rainfall) problem

Page 3: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Financial Bootstrap Commands

• sample

• count

• proportion

• percentile

• histogram

• multiples

Page 4: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Sampling

• Classical Probability/Statistics– Random variables come from static well

defined probability distributions or populations– Observe only samples from these populations

• Example– Fair coin: (0 1) (1/2 1/2) populations– Sample = 10 draws from this coin

Page 5: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Old Style Probability and Statistics

• Try to figure out properties of these samples using math formulas

• Advantage:– Precise/Mathematical

• Disadvantage– Complicated formulas– For relatively complex problems becomes very

difficult

Page 6: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Bootstrap (resample) Style Probability and Statistics

• Go to the computer (finboot toolbox)

• Example• coin = [ 0 ; 1] % heads tails

• flips = sample(coin,100)

• flips = sample(coin,1000)

• nheads = count(flips == 0)

• ntails = count(flips == 1);

Page 7: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Monte-Carlo versus Bootstrap

• Monte-Carlo– Assume a random variable comes from a given

distribution– Use the computer and its random number

generators to generate draws of this random variable

Page 8: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Monte-Carlo versus Bootstrap

• Bootstrap– Assume that sample = population– Draw random variables from this sample itself– Advantage

• No assumption about the distribution

– Disadvantage• Small amounts of data can mess this up

– Many examples coming

Page 9: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Sampling Outline (1)

• Sampling– Coin flips and political polls– The birthday problem (a not so obvious

problem)

• Random variables and probabilities– Rainfall– A first portfolio problem

Page 10: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

The Coin Flip Example

• What is the chance of getting fewer than 40 heads in a 100 flips of a fair (50/50) coin?

• Could use probability theory, but we’ll use the computer

Page 11: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Coin Flip Program in Words

• Perform 1000 trials

• Each trial– Flip 100 coins– Write down how many heads

• Summarize– Analyze the distribution of heads– Specifically: Fraction < 40

Page 12: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Now to the Computer

• coinflip.m and the matlab editor

Page 13: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Application: Political Polling

• Heads/Tails ->O’Brien/Reich• Poll 100 people, 39 for O’Brien• How likely is it that the distribution is

50/50?• What is the probability of sampling less

than 40 in the sample of 100?• Remember: it is not zero!!!• Try this with smaller samples

Page 14: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Sampling Outline (1)

• Sampling– Coin flips and political polls– The birthday problem (a not so obvious

problem)

• Random variables and probabilities– Rainfall– A portfolio problem

Page 15: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Birthday

• If you draw 30 people at random what is the probability that more two or more have the same birthday?

Page 16: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Birthday in Matlab

• Each trial• days = sample(1:365,30);

• b = multiples(days);

• z(trial) = any(b>1)

• proportion (z == 1)

• on to code

Page 17: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Sampling Outline (1)

• Sampling– Coin flips and political polls– The birthday problem (a not so obvious

problem)

• Random variables and probabilities– Rainfall– A portfolio problem

Page 18: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Adding Probabilities:Rainfall Example

• dailyrain = [80; 10 ; 5 ]

• probs = [0.25; 0.5; 0.25]

Page 19: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Sampling

• annualrain = sum( sample(dailyrain,365,probs))

Page 20: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Portfolio Problem

• Distribution of portfolio of size 50

• Return of each stock

• [ -0.05; 0.0; 0.10]

• Prob(0.25,0.5,0.25)

• Portfolio is equally weighted

• on to matlab code (portfolio1.m)

Page 21: Probability and Sampling Theory and the Financial Bootstrap Tools (Part 1) IEF 217a: Lecture 2.b Jorion, Chapter 4 Fall 2002

Portfolio Problem 2

• 1 Stock• Return

– [-0.05; 0.05] with probability [0.25; 0.75]

• Probabilities of runs of positives– 5 days of positive returns– 4/5 days of positive returns

• on to matlab code– portfolio2.m