Last Study Topics Measuring Portfolio Risk Measuring Risk Variability Unique Risk vs Market Risk.
Risk Analysis & Modelling Lecture 2: Measuring Risk.
-
Upload
teresa-casey -
Category
Documents
-
view
218 -
download
1
Transcript of Risk Analysis & Modelling Lecture 2: Measuring Risk.
Risk Analysis & Modelling
Lecture 2: Measuring Risk
http://www.angelfire.com/linux/lecturenotes
What we will look in this lecture
• Review of statistics
• The central limit theorem
• Implied statistical properties
• Covariance Matrices
• Correlation Matrices
• Calculation of mean and variance of a portfolio using matrices
Our Thought Experiment
• Imagine you have £100 an account• Infront of you is a machine with a red button on it• Every time you press the button the amount you
have in your account changes• The change seems to vary every time you press• We cannot see inside the machine, just observe the
outcome• We want to know if pressing the button is a good
idea
Machine
You have £100
Note: we will be making this machine in the programming section!
Quantifying The Range of Outcomes
• To asses the risk of a game we need to understand the outcomes that can occur and their respective likely-hood
• From this outcome range we can evaluate the range of payoffs that are likely to occur if we play the game and determine if it is to our liking.
We decide to tabulate the results we observe and their frequency
• After 100 presses we find:
Lose £4 10 10%
Lose £2 25 25%
Gain £1 35 35%
Gain £2 25 25%
Gain £4 5 5%
A probability histogram of outcomes
0%
5%
10%
15%
20%
25%
30%
35%
Lose £4 Lose £2 Gain £1 Gain £2 Gain £4
A cumulative probability histogram
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%100%
Lose £4 Lose £2 Gain £1 Gain £2 Gain £4
Cum
ulat
ive
Pro
babi
lity
Estimation Error
• Our histograms are estimations• They are subject to estimation error• Intuitively we can imagine that the larger our
sample the smaller the error.• The 100% accurate underlying probability
distribution is called the population distribution• Our estimation is called the sample distribution
Quantitative Measure
• Our graph and table help us asses the risk and return of playing the game but what if we want to compare risks of various machines?
• We would like to have a parametric measure based on our personal preferences
• We decide we are interested in 2 things:• The centre of the outcomes (what is most likely to happen)• The spread of outcomes about this centre (the uncertainty
of the expected outcome)• The centre is can be defined as the mean, the spread can be
defined as the variance.
Sample Mean & Variance
• The sample mean is defined as
n
1iiX
n
1 X
• The sample variance is defined as
2n
1ii
2 )X(X1-n
1 s
Mean And Variance
0%
5%
10%
15%
20%
25%
30%
35%
Lose £4 Lose £2 Gain £1 Gain £2 Gain £4
We Expect to Gain £1
There are a range of outcomes other than the expectedWe are there uncertain about the exact outcome
Random Variable Operations
• A variable with a ~ on top denotes a random variable
• You cannot treat them like a normal variable, for example:
X~
2. X~
X~
• There is however a special operation you can perform on a random variable called the expectation
• Expectation (E) is a purely abstract concept that states “what would be the expected value if we had knowledge of the population distribution”:
XP . )X~
f( ) )X~
f( E(
• Where PX is the true probability of observation X
Proof of Unbiased Estimation of Sample Mean
• We have said that:
n
1iiX
~
n
1 X
n
1iiX
~
n
1E )XE(
)X~
E(n
1 )XE(
n
1ii
n
1in
1 )XE(
Where is the population mean
n
n. )XE(
So the expected value of our sample mean is the population mean.
Proof of Unbiased Estimation of Sample Variance
2n
1ii
2 )XX~
(1-n
1 s
2n
1ii
2 ))-X()X~
((1-n
1 s
))-X()X~
((1-n
1 )E(s 2
n
1ii
2
E
))-X()-X).(X~
.(2)X~
((1-n
1 )E(s 2
i2
n
1ii
2
E
))-X()X~
(E(1-n
1 )E(s 22
n
1ii
2 E
n
1i
222
1-n
1 )E(s
n
2i )-X( ))-X).(X
~(E( E
222
1-n
1-n )E(s
where
Where is the population variance:
nE
22 ))-X( (
hence
hence
Discrete Vs Continuous Probability
• The game we played in the last section was an example of a discrete random variable
• The number of outcomes from the game was ‘finite’ or of limited number
• If the game had payoffs like: “You Win £2.13312” or “You Lose £4.5633” we could not use our table and histogram
• The outcomes would represent a continuous random variable.
• For a continuous random variable it does not make sense to talk about a specific outcome only a range of outcomes
Cumulative Distribution And Probability Density
• The Cumulative Distribution Function (cdf) gives the probability that an outcome will be less than or equal to a given value
• The Probability Density Function (pdf) describes a function which has the property that the area under it describes the cdf.
Continuous CDF and PDF graphs
+£10
Probability
Outcome-£10 +£10
Outcome-£10
ProbabilityDensity
1.0
0.0
0.4
0.0
-£3-£3
CDF PDF
Area Under Curve
0.3
£1
0.6
£1
Difference is Probability of outcomes between –£3 and £1
Special Distributions• Up until now probability distributions have been of arbitrary
shapes describing the likelihood of a range of outcomes• There are a number of special distributions that frequently
occur in the real world and that are described by well defined functions
• The most important of these is the Normal Distribution or Bell Curve
• The Normal Distribution is observed throughout nature and finance and described by mean and variance
• We can explain why normal distribution occurs using the Central Limit Theorem
The Central Limit Theorem
• The Central Limit Theorem is a precise formulation of the “Law of Large Numbers”
• Imagine we have a variable Y which equal to the average of the observed values for three independent random variable A,B and C:
3
C~
B~
A~
Y~
• The expected value of Y is:
33
)C~
E()B~
E()A~
E()Y
~E( CBA
Y
• The Variance of Y:
9
)- C~
(E)-B~
(E) -A~
E(
3
-- - C~
B~
A~
)- Y~
E(222
2
2 CBACBAY E
0)-C~
).(-B~
(E,0)-C~
).( -A~
E(,0)-B~
).( -A~
E( BBBABA
Since A,B,C are independent the covariances are zero
• The Skew of Y
27
)- C~
(E)-B~
(E) -A~
E(
3
-- - C~
B~
A~
)- Y~
E(333
3
3 CBACBAY E
Covariance
• While looking at the central limit we introduced the concept of covariance which measures the way 2 random variable vary together
• The unbiased sample covariance is
n
ixy n 1
ii )Y).(YXX(1
1s
))μY~
).(μX~
((E YX xy
• Covariance is a product moment
Correlation• Correlation is a normalized measure of covariance• Correlation must be between –1 and +1 due to the
Cauchy-Schwarz inequality.• A strong positive correlation suggests that 2
random variables move about their mean value in unison
• A strong negative correlation suggests that 2 random variable move in opposite directions about their mean value
• Correlation is defined as:
yx
xyxy s.s
sp
Part 2: Portfolio Mean-Variance
Portfolio Risk/Return
• Imagine you have a portfolio of assets.• You have estimates for the means, variances and
covariances of the returns for the various assets• You wish to calculate the mean and variance of
the return for your portfolio• We wish to derive the mean and variance of a
portfolio’s return from the mean, variance and covariance of returns of the assets it contains.
2 Asset Portfolio
• The return on the portfolio (P) is a weighted average of the return on asset A and asset B
B~
.wA~
.wP~
BA
• Where wA is the proportion invested in asset A and wB is the proportion invested in asset B. Investment proportions are often called ‘weights’.
• The weights normally add up to 100%.• For any value for the return in A and B we can
evaluate the return on the portfolio.
• We can use our expectation operator to show that the expected return on the portfolio is a simple weighted average of the return on the assets
)B~
(E.w)A~
(.Ew)B~
.wA~
.w(E)P~
E( BABA
• The variance of the portfolio has a more complex relationship with the assets A and B:
2BBBAAA
2P )μ.w B
~.w.μw-A
~.w(E)μ-P
~E(
BBAAP μ.w.μwμ
)μ.w B~
.(w)..μw-A~
.w(E.2)μ.w B~
.E(w).μw-A~
.w(E BBBAAA2
BBB2
AAA2
P
ABBA2
B2
B2
A2
A2
P ..ww.w.w
3 Asset Portfolio
• We will now examine the case of a 3 Asset Portfolio
C~
.wB~
.wA~
.wP~
CBA
• The expected portfolio return:
CCBBAAP μ.wμ.w.μwμ
• The portfolio variance:
BCCBACCAABBA2
C2
C2
B2
B2
A2
A2
P ww2ww2ww2www
Larger Portfolios
• As we see the equation relating the portfolio variance to the covariance and variance of its assets is messy for 3 assets
• For A modest portfolio of 30 assets it would contain 450 terms!
• We need to find a more practical way of calculating the portfolio’s statistical properties
• To do this we need to introduce 3 new concepts: weight vector, expected return vector and covariance matrix.
The Weight Vector
• The weight vector is a n by 1 vector containing the proportions invested in the various assets
• For the 3 asset case the weight vector would look like the following:
WA
WB
WC
A
B
C
The Expected Return Vector• The Expected Return Vector is a n by 1 vector
containing the expected returns of the various assets.
• It is important for the Expected Return Vector to maintain the same order as the weight vector.
• For the 3 asset case the Expected Return Vector would look like the following:
E(RA)
E(RB)
E(RC)
A
B
C
The Covariance Matrix
• The covariance matrix is a square matrix which describes the covariances and variances between a set of random variables
• It is a symmetric matrix• It is a positive definite matrix (ie XTCX >0
for every non-zero column vector)• The covariance matrix should maintain the
same order as the weight matrix.
Var(RA) Cov(RA,RB)
Cov(RB,RA) Var(RB)
Var(RA) Cov(RA,RB) Cov(RA,RC)
Cov(RB,RA) Var(RB) Cov(RB,RC)
Cov(RC,RA) Cov(RC,RB) Var(RC)
Covariance Matrix for 2 Assets
Covariance Matrix for 3 Assets
IdenticalTerms
A
A B
B
A
A
B
B
C
C
Expressing Risk & Return with Matrices
• Let C be the covariance matrix, E the expected return vector and W the weight vector for a Portfolio P
• E(RP) = WT.E
• Var(RP) = WT.C.W
2 Asset Portfolio Return With Matrices
E(RP) = WA WB
E(RA)
E(RB)X
E(RP) = WA.E(RA) + WB.E(RB)
E(RP) = WT.E
2 Asset Portfolio Variance With Matrices
Var(RP) = WT.C.W
Var(RP) = WA WB
V(RA) C(RA,RB)
C(RB,RA) V(RB)
WA
WB
X X
Var(RP) = Wa2.Var(Ra) + Wb
2.Var(Rb) +
2.Wa.Wb.Cov(Ra,Rb)
The Correlation Matrix
• The correlation matrix is closely related to the covariance matrix
• It measures the correlation between assets rather than covariances
• Correlation matrices can be converted to covariance matrices using the standard deviation vector
Transformation Between Correlation and Covariance Matrix
• Let D be a square matrix with the standard deviations along the diagonal and zeros everywhere else (a diagonal matrix), let P be the correlation matrix and C be the respective covariance matrix. Then the following relationship is true:
D.P.D = C
2 Asset Correlation to Covariance Matrix Example
1 P(RA,RB)
P(RB,RA) 1
Sd(RA) 0
0 Sd(RB)
Sd(RA) 0
0 Sd(RB)* *
=Sd(RA)*Sd(RA) P(RA,RB)* Sd(RA)*Sd(RB)
P(RB,RA) *Sd(RA)*Sd(RB) Sd(RB)*Sd(RB)
V(RA) C(RA,RB)
C(RB,RA) V(RB)=
Transformation between Covariance and Correlation Matrix
• From our initial relationship we can state:
P= D-1.C .D-1
• Where D-1 is the inverse of the square standard deviation matrix
• Because D is a diagonal matrix its inverse is simply the reciprocal of the elements along the diagonal.
2 Asset Covariance to Correlation Matrix Example
1/ Sd(RA) 0
0 1/ Sd(RB)
1/Sd(RA) 0
0 1/ Sd(RB)* *
=V(RA) / (Sd(RA)*Sd(RA)) C(RA,RB)/(Sd(RA)*Sd(RB))
C(RB,RA)/(Sd(RB)*Sd(RA)) V(RB)/(Sd(RB)*Sd(RB))
=
V(RA) C(RA,RB)
C(RB,RA) V(RB)
1 P(RA,RB)
P(RB,RA) 1