Transcript Slide 1

Statistics for
Financial Engineering
Part1: Probability
Instructor: Youngju Lee
MFE, Haas Business School
University of California, Berkeley
Overview of Class
 Part1: Probability – March 23rd, 2006
 Part2: Statistics – March 25th, 2006
 Class will be organized as
 Definitions
 Some comments about from definition
 Problems
 Applications in financial engineering – I will give short
examples how I apply these concepts in my real life
and practice since I assume you do not have any idea
about financial engineering as of now.
Probability
1.
2.
3.
4.
5.
6.
Probability
Random Variables – Discrete and Continuous
Distribution and Probability Density
Moments and Moments Generating Function
Stochastic Independence
Basic Limit Theorem
Probability
Definition1
A probability function (P) is a function which assigns to each event A a number denoted by
P(A), called the probability of A and satisfies the following requirements.
a) P is non-negative; P(A)  0 for every event A
b) P us normed: that is P(S) = 1
c) P is  additive: that is, for every collection of pairwise(or mutually) disjoint events, we
have P(  Aj ) =  P( Aj )
j
j
c-1) P is finite additive
Probability
Some consequences of definition 1
a) P(0) = 0
n
b) P(  Aj ) =
j
c)
d)
e)
f)
n
 P( A )
j
j
P( Ac ) = 1 – P(A)
A1  A2 , P( A1 )  P( A2 )
0  P( A)  1
P( A1  A2 )  P( A1 )  P( A2 )  P( A1  A2 )

g) P is sub additive: P( Aj )   P( Aj )

j 1
j 1
Probability
Try this
Twenty balls numbered from 1 to 20 are mixed in an urn and two balls are drawn successively and
without replacement. If x1 and x2 are the numbers written on the first and second ball drawn,
respectively, what is the probability that
i. x1  x2  8
ii. x1  x2  5
Probability
In finance world?
 This is the very basic concept of everything. – States,
Monte-Carlo simulations and Binomial Trees, etc.
Conditional Probability
Definition 2
Let A be an event such that P( A)  0 . Then the conditional probability, given A, is the
function denoted by P( | A) and defined for every event B as follows:
P( A  B)
P( B | A) 
P( A)
P( B | A) is called the conditional probability of B given A.
Conditional Probability
Some consequences from definition 2
a) (Multiplicative Theorem) Let Aj , j  1,2,3..., n be events such that
P(nj11 Aj )  0 then
P(nj11 Aj )  P( An | A1  A2
An1 )  P( An1 | A1  A2
An2 ) P( A2 | A1)P( A1)
b) (The total probability theorem) Let Aj , j  1,2,3..., n be a partition of S with
P( Aj )  0 , all j. Then for B  A , we have P( B)   P( B | Aj ) P( Aj )
j
c) (Bayes Fomular) If Aj , j  1,2,3..., n is a partition of S and P( Aj )  0 and if
P( B)  0 then P( Aj | B) 
P( B | Aj ) P( Aj )
 P(B | Ai )P( Ai )
i
0
Conditional Probability
Try this.
Suppose that a test for diagnosing a certain heart disease is 95% accurate when applied to
both those who have the disease and those who do not. If it is known that 5 of 1000 in a
certain population have the disease in question, compute the probability that a patient
actually has the disease if the test indicates that he does. (try to explain by intuitive
reasoning.)
Conditional Probability
In finance world?
 Fancy empirical model – Regime Switch Model
Independence
Definition 3
The events A and B are said to be independent if P( A  B)  P( A)P(B) .
Definition4: The events Aj , j  1,2,..., n are said to be mutually or completely independent
if the following relationships hold. P( A1  A2 ...An )  P( A1 )...P( An ) .
Independence
Some consequences from definition 3
a) If the events A1 , A2 ,...An are independent, so are the events A1' , A2' ,...An' , where A'j is
ACj or Aj , j = 1,2,…n.
Independence
Try this. – Easy!
Six fair dice are tossed once. What is the probability
that all six faces appear?
Seven fair dice are tossed once. What is the probability
that every face appears at least once?
Independence
In finance world?
Is there any independent event in the financial world or
at least in practice?
Random Variables
Definition 4
Random variable is a function which assigns to each sample point s  S a real number, the
value of the r.v. at s.
Discrete Random Variable
Definition 5: Binomial distribution is associated with
binomial experiments – success or fail
X ( S )  {0,1, 2..., n}
n
P( X  x)  f ( x)    p x q n  x
 x
0  p  1, q  1  p
Discrete Random Variables
Definition 6: Poisson distribution
P( X  x)  f ( x)  e

x
x!
Discrete Random Variables
Definition 7: Discrete uniform distribution
X ( S )  {0,1, 2..., n  1}
P( X  x)  f ( x) 
x  0,1, 2...n
1
n
Discrete Random Variables
Definition 8: Hyper-geometric distribution
X ( S )  {0,1, 2..., r}
 m n 
 

x
r

x

P( X  x)  f ( x)    
m  n


 r 
Discrete Random Variables
Definition 9: Negative binomial distribution
X ( S )  {0,1, 2...}
 r  x  1 x
P( X  x)  f ( x)  p r 
q
x


0  p  1, q  1  p, x  0,1, 2....
Discrete Random Variables
Definition 10: Multi-nominal distribution
k
X ( S )  {x  ( x1 , x2 ,...., xk ) : x j  0, j  0,1, 2...k ,  x j  n}
'
j 1
n

 x1 x 2 xk
P( X  x)  f ( x)  p r 
 p1 p1 ... p1
 x1 ! x2 !...xk !
k
p
j 1
j
1
Continuous Random Variables
Definition 11: Normal distribution
X ( S )  R, f ( x ) 
  x   2 
1
exp
, x  R
2
2

2


Continuous Random Variables
Some consequences from definition 11
 Normal distribution is symmetric.
 Normal distribution has maximum value at mean.
Continuous Random Variables
Try this.
Let X to be distributed as N(0,1) and for a < b, let p  P  a  X  b . Then use the
symmetry of the p.d.f. f in order to show that:
1. For 0  a  b, p   b   a
2. For a  0  b, p   b   a  1
3. For a  0  b, p    a    b
4. For c  0, P  c  X  c  2 c  1
Continuous Random Variables
In finance world?
Everything is assumed normal distribution in financial
engineering. To check normality,
Use K-S test or Normal Probability Plot. I will cover this
later.
Continuous Random Variables
Definition 12: Gamma distribution
X ( S )  (0, )
 1  1  x 

x
e
,
x

0


f ( x)    



0, x  0
  0,   0

Where    y 1e  y dy . This integral is known as the Gamma function.
0
Continuous Random Variables
Definition 13: Chi-square distribution


1


 r / 2 1  x 2
f ( x)  
x
e
,
x

0

1
2


 1 / 2r 2

r0
Continuous Random Variables
Definition 14: Negative exponential distribution
e  x , x  0
f ( x)  
,   0
 0, x  0 
Continuous Random Variables
Definition 15: Continuous uniform distribution
X (S )  R

 1     ,   x   

f ( x)  



0
,
else


Continuous Random Variables
Definition 16: Beta distribution
X (S )  R
      1

 1
x 1  x  ,0  x  1

f ( x )    



0, else


  0,   0
Continuous Random Variables
Definition 17: Cauchy distribution
X (S )  R

1
  2   x   2
x  R,   R ,   0
f ( x) 
Continuous Random Variables
Definition 18: Lognormal distribution
X (S )  R


 log x  log 2 
1

exp
 , x  0
2
f ( x)   x 2

2





0, x  0


Continuous Random Variables
Definition 19: Bi-variate normal distribution
f x1 , x2  
1
21 2 1  
2
e
q
2
2
2
  x1  1   x2  2    x2  2  
1   x1  1 

q
 2 
        
1   2    1 

2
2
 
 
 1  

D.F. and P.D.F.
Definition 20: The distribution function
The distribution function F of a random variable X satisfies the following properties.
 0  F ( x)  1, x  R
 F is non-decreasing
 F is continuous from the right
F ( x)  0, x  

F ( x)  1, x  
D.F. and P.D.F.
Some consequences from definition 20
 Let X be an N (, 2 ) distributed r.v. and set Y 
x
. Then Y is an r.v. and its

distribution is N (0,1)
 Let X be an N (0,1) distributed r.v. then Y  X 2 is distributed as 12 .
x
2
 Let X be a N (, 2 ) distributed r.v. then the r.v. 
 is distributed as 1 .
  
2
D.F. and P.D.F.
Try this. – It is better to know what logistic distribution is.
Show that the following function F is a d.f. (Logistic distribution) and derive the
corresponding p.d.f., f.
F ( x) 
1
1 e
 ( x   )
, x  R,   0,   R
D.F. and P.D.F.
In finance world?
You probably want to remember some
consequences from last slide. We use this all
the time to make trading signals.
D.F. and P.D.F.
Definition 21: Joint distribution function
The joint distribution function of X   X1, X 2  is F  X1, X 2   P  X1  x1, X 2  x2 
D.F. and P.D.F.
Definition 22: Quantile of a distribution
Let X be an r.v. with d.f. F and consider a number p such that 0 < p < 1. A pth quantile
of the r.v.X or of its d.f. F is a number denoted by xp and having the following property:
PX  xp   p and PX  xp   1  p .
D.F. and P.D.F.
Definition 23: Mode
Let X be an r.v. with p.d.f. f. Then a mode of f, if it exists, is any number which
maximize f(x).
D.F. and P.D.F.
Try this.
Let X be an r.v. with p.d.f. f symmetric about a constant
c then show c is a median of f.
D.F. and P.D.F.
In finance world?
Moments
Definition 24: Moments of random variables
For n=1,2,…, the nth moment of g(x) is denoted by Eg ( x) and is defined by
n


x g ( x)n f ( x)



n
E  g ( x)     

n



g
(
x
,
x
...
x
)
f
(
x
,
x
...
x
)
dx
dx
...
dx
1 2
n
1 2
n
1
2
n
 
   

The first moment is called mean and the difference between the second moment and the
square of the first moment is called variance.
Moments
Some consequences from definition 24
The basic properties of mean
E (c )  c
E[cg ( x)  d ]  cE[ g ( x)  d ]
X  Y , E ( X )  E (Y )
| E[ g ( X )] | E | g ( X ) |
The basic properties of variance
 2 c   0
 2 [cg ( X )  d ]  c 2 2 [ g ( X )]
 2 [ g ( X )]  E[ g ( X ) 2 ]  E[ g ( X )]2
Moments
Try this.
A roulette wheel has 38 slots of which 18 are red, 18
black, and 2 green. Suppose a gambler is placing a
bet of $M on red. What is the gambler’s expected gain
or loss and what is the standard deviation?
Moments
Try this. But do not calculate!
Let X be an r.v. taking on the values -2,-1,1,2 each with
probability 0.25. Set Y=X*X and compute the
following quantities. EX, Var(X), EY and Var(Y).
Moments
In finance world?
I do not think you can be in finance industry without
talking about Sharpe ratio a lot. (mean/sd)
We also need to look at skewness and kurtosis.
Stochastic Independence
Definition 25: Stochastic independence
The r.v.’s X j , j  1,2,... are said to be independent if, for sets B j  R, j  1,2,...k , it holds
PX j  B j , j  1,...,k   kj1 P( X j  B j )
Stochastic Independence
Some consequences from definition 25
 Let X 1 , X 2 have the bivariate normal distribution. Then X 1 , X 2 are independent if
and only if they are uncorrelated.
 Let X j be B(n j , p) , j=1,2,…,k and independent. Then
k
k
j 1
j 1
X   X j is B(n,p), where n   n j .
 Let X j be P( j ) , j=1,2,…,k and independent. Then
k
k
j 1
j 1
X   X j is P( ) , where     j
Stochastic Independence
Some consequences from definition 25
 Let X j be N ( j , 2 j ) , j=1,2,…,k and independent. Then
k
k
k
X   X j is N (, ) , where     j and    2 j
2
2
j 1
j 1
j 1
 Let X j be  2r j , j=1,2,…,k and independent. Then
k
k
X   X j is  where r   r j
2
r
j 1
j 1
 Let X j be N ( j , 2 j ) , j=1,2,…,k and independent. Then
kS /  is 
2
2
2
k 1

1 k
where S   X j  X
k j 1
2

2
The Central Limit Theorem
Definition 26: Central Limit Theorem
Let  X1, X 2 ...X n  be i.i.di r.v. with mean  and variance  2 . Then

n 1 X n  
Sn
  N  0,1