Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

83
Risk Analysis & Modelling Lecture 2: The Mean-Variance Model

Transcript of Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Page 1: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Risk Analysis & Modelling

Lecture 2: The Mean-Variance Model

Page 2: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Course Website:

ram.edu-sys.net

Course Email:[email protected]

Page 3: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

The Mean-Variance Model

In this lecture we will introduce one of the most widespread models used to measure and analyse the nature of Market Risk

This model is the Nobel Prize winning Mean-Variance Model developed by Harry Markowitz in 1952

Although over 60 years old this model is still in widespread use and it is an ideal way to introduce the power of quantitative risk modelling

It is the basis of the SCR calculation in Solvency II

Page 4: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Measuring Risk

Last week we made the statement that risk involves uncertainty over some future outcome

Even when we are not certain about the final outcome we often have an idea of the range of outcomes that might occur

We can place reasonable limits on our uncertainty….

Page 5: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Limits on uncertainty

Current Position

Although we are unsure precisely which outcome will occur we can describe a range of outcomes over which our uncertainty arises

We

are

unce

rtai

n ab

out

the

prec

ise

outc

ome

Page 6: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Our thought experiment

Imagine you have £10,000 invested in a portfolio of 2 stocks£6000 is invested in stock A and £4000 in stock BYou are uncertain about how much your portfolio will be worth in one month, however, as an expert investor you feel you can estimate a range of outcomes that might occurYou will do this by writing down a range of possible values for your portfolio and the probability or likelihood of these outcomes

Page 7: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Limits on Uncertainty

£10,000

10%, £11,000 (+10%)

5%, £9,000 (-10%)

45%, £10,500 (+5%)

20%, £9,500 (-5%)

20%, £10,000 (0%)

1 Month Time Horizon

Probability, Portfolio Value

Page 8: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Histogram of Outcomes

0%

5%

10%

15%

20%

25%

30%

35%

40%

45%

50%

-10% -5% 0% 5% 10%

Change In Portfolio Value

Pro

ba

bili

ty

Page 9: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Your Friends PortfolioYour friend has a portfolio of £5000

After seeing your risk chart he decides to create one for his own portfolio

Using his knowledge of the assets in his portfolio he produces a histogram showing the possible changes in portfolio value and their respective probabilities

You note that because you are both using the proportional change in your portfolio values you can compare charts (even though your portfolios are of different sizes)

Page 10: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Friends “Riskier” Portfolio

0%

5%

10%

15%

20%

25%

30%

35%

40%

-20% -15% -10% -5% 0% 5% 10% 15% 20%

Change In Portfolio Value

Pro

ba

bili

ty

Greater spread of outcomes means greater risk

Page 11: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Which Portfolio Earns More?

You want to know which portfolio earns more on average or has the greater Expected Return

)1.0*1.0()45.0*05.0()2.0*0()2.0*05.0()05.0*1.0()(1

PrE

%75.10175.0)(1

PrE

)16.0*05.0()04.0*1.0()03.0*15.0()02.0*2.0()(2

PrE

)07.0*2.0()06.0*15.0()09.0*1.0()37.0*05.0()16.0*0( %303.0)(

2PrE

On average we expect our portfolio to earn 1.75% over the 1 month, while we expect our friends portfolio to earn 3%

Page 12: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Which Portfolio Is Riskier?

While your friends portfolio has a greater expected return, we could argue that because the spread of outcomes on your friend’s portfolio is greater that the risk is greater

Although this can be ascertained visually it is useful to have a way of measuring this spread numerically

Statistics provides us with a simple means by which to do this: the Variance

Page 13: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Definition of VarianceThe expected return is defined as follows

2n

1iir

22r ))~(.(rp)))~(-r~E(( )r~Var(

irErE

n

1iir .rp )r~E(

irwhere E is the expectation operator (see appendix) and pr is the probability of that outcome

The Variance is defined as the expected squared difference

The Standard Deviation is simply the square root of the Variance

Var(r) )r~sd( r

Page 14: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Calculating VarianceThe variance on our portfolio is:

)2.0*)0175.00.0(()2.0*)0175.005.0(()05.0*)0175.01.0(()( 2221 PVar

002819.0)1.0*)0175.01.0(()45.0*)0175.005.0(( 22

The Variance of the return on our portfolio is 0.002819

By similar calculation we can see that the Variance on our friends portfolio is 0.00735

The Variance of the return does not have any obvious intuitive meaning (unlike the expected return), but it can be used to compare risk of the portfolios (larger Variance means higher Risk)

Page 15: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Calculating the Mean and Variance From Historical Observations

Normally we estimate the Mean and Variance from historical observations rather than hypothetical outcomes and their estimated probabilitiesTo estimate the average from a set of historical observations of size N we use the following formula (which is calculated using the AVERAGE formula in Excel):

To estimate the variance we can use the following formula** (which is calculated using the VARP formula in Excel):

N

iiXN

X1

.1

2

1

.1

)(

N

iiXN

XVAR

Page 16: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Mean Variance AbstractionThe key insight of the Mean-Variance Model is that an asset or portfolio can be described using two numbers: the Mean and Variance of Return

Although this does not capture the entire behaviour of a portfolio these 2 simple statistics directly relate to and quantify important aspects of a portfolio’s behaviour

They tell us how much profit we expect to make and how risky that profit is

Page 17: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Mean-Variance Abstraction

0%

5%

10%

15%

20%

25%

30%

35%

40%

-20% -15% -10% -5% 0% 5% 10% 15% 20%

Change In Portfolio Value

Pro

ba

bili

ty

Range or Distribution of Outcomes

Abstraction

Mean(Measure of Expected Profit)

Variance(Measure of Risk)

Page 18: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Deriving the Portfolio’s Risk

Returning to our investment portfolio, its Risk (or Variance) and Expected Return is derived from the risk of the two assets it contains

It is often useful to express the Risk and Return of the portfolio in terms of the assets it contains

It is easier to quantify the risks of individual assets rather than the risks of the portfolio

We will now derive some very important results by expressing the statistical behaviour of the portfolio interms of the assets it contains

Page 19: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Relationship between the Assets and the Portfolio

A B

P

The behaviour of the portfolio is derived from the behaviour of the assets it contains – a portfolio containing high return/risk assets will also have a high return/risk

Is it possible to derive the Mean and Variance of the Returns on the Portfolio (P) in terms of the

Mean and Variance of the Returns on the Assets it contains

(A and B)?

Page 20: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Mapping Assets to Portfolio

The known market value today of a portfolio (p) of 2 assets (a and b) is equal to the sum of their values:

ttt bap The unknown or random market value of the portfolio at some future time is equal to:

111

~~~ ttt bap

The ~ above the variables simply denotes that they are random or uncertain variables which can take on a range of values

Page 21: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

The relationship between the assets value today and the future date can be expressed as:

tAt ara ).~1(~1

tbt brb ).~1(~

1

Where and denotes the random returns on asset A and asset B respectively

If we want to express the portfolio’s return in terms of the return on assets we have:

tBtAt brarp ).~1().~1(~1

Bt

tA

t

t

t

ttp r

p

br

p

a

p

ppr ~.~.

~~ 1

Ar~

Br~

Page 22: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

We can rewrite this as:

BbAap rwrwr ~.~.~ Where wa and wb are the proportion of the portfolios total value invested in asset A and asset B respectively

These proportions are also called the investment weights

The usual restrictions on these investment weights is that they sum to 100% and cannot be negative

For example, a £100 portfolio with £30 invested in A and £70 invested in B has w A is equal to 30% and wb is 70%

Page 23: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Example Calculation

The meaning of this mapping equation is fairly simple.It simply states the obvious fact that the random behaviour of the return on the portfolio is directly related to the random behaviour of the assets in the portfolioFor example, if a portfolio contains 40% in stock A with a return of 5% and 60% in stock B with a return of 10% then the portfolio’s random return will be 8%:

%808.01.0*6.005.0*4.0

Page 24: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Review Question

A portfolio contains two assets A and B

30% of the portfolio is held in asset A and 70% in asset B

The return on Asset A is 10% and the return on Asset B is 20%

What is the return on the portfolio?

Page 25: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Implying the Portfolio’s Statistical Properties

We will now show it is possible to imply the mean and variance of return for the portfolio from the statistical properties of the assets contained in the portfolio

This will turn out to be extremely useful since it allows us to use simple mathematics to model and explore the nature of Risk in a Portfolio

Page 26: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Portfolio Expected Return

The expected return on the portfolio is equal to:

)~.~.()( BbAap rwrwErE

)~.()~.( BbAa rwErwE

)~(.)~(. BbAa rEwrEw

So the expected return on the portfolio is equal to a weighted average of the returns on the assets

Page 27: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Review Question

A portfolio contains two assets A and B50% of the portfolio is held in asset A and 50% in asset BOver the next year the Expected (Average) Return on Asset A is 20% and the average return on Asset B is expected to be 30%What is the average or expected return on the portfolio over the next year?

Page 28: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Review Question Answer

The formula we just derived states:

Applying the formula:

So on average this portfolio will earn 25% over the next year

)~(.)~(.)~( BbAaP rEwrEwrE

%25%20*%50%30*%50)~( PrE

Page 29: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Portfolio VarianceThe portfolios variance can be defined as:

2PPP ))r~E(-r~()r~Var( E

)~,~cov(..2)~var(.)~var(.)r~Var( 22P BABABBAA rrwwrwrw

Where cov is the covariance

The intuition is that the Variance of the Portfolio depends not just on how the assets it contains move in isolation (Variance) but also on how they move together or co-vary (measured by Covariance).

We note the relationship is quadratic with respect to the investment weights!

Page 30: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

CovarianceCovariance measures the co-movement of 2 random variables and is defined as:

)))Y~

(Y~

)).(X~

(X~

(()~

,~

( , EEEYXCov yx A large positive covariance suggest that the random variables have a tendency to move together

A large negative covariance suggests that the random variables have a tendency to move in the opposite direction to each other

A covariance close to zero suggests that the random variables are independent in their movement about the mean

Page 31: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Covariance Diagram

Cov(X,Y)

Covariance measures the simultaneous behaviour of two random variables about their centre. Do they have a tendency to move together,

against each other or independently?

E(X) E(Y)X Y

Page 32: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

CorrelationCorrelation is a normalized measure of CovarianceCorrelation must be between –1 and +1 due to the Cauchy-Schwarz inequality (see appendix)A strong positive correlation suggests that the two random variables move about their mean value in unisonA strong negative correlation suggests that the two random variable move in opposite directions about their mean valueCorrelation is defined as:

)(*)(

y)Cov(x,),(C , ysdxsdyxor yx

Page 33: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Calculating Covariance from Historical Observations

To estimate the covariance from a set of historical observations for two random variables X and Y of size N we use the following formula**:

In Excel this can be calculated using the COVAR formula

The related correlation statistic can be calculated in Excel using the CORREL formula

i

N

ii YX

NYXCOV ..

1),(

1

Page 34: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Quadratic Relationship

Let us look at the relationship between the risk on a portfolio of 2 uncorrelated assets (zero covariance) both with a variance of 0.1 the risk of a portfolio containing those 2 assetsOur equation tells us that the variance of the return on the portfolio is:

If we graph this relationship out for different combinations of asset A and asset B we see something interesting…

1.0*1.0*)r~Var( 22p BA ww

Page 35: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Risk for Various Portfolios

0

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0 0.2 0.4 0.6 0.8 1

W(B)

Var

ian

ce P

ort

folio

Minimum Risk Containing 50% of A and 50% of B

100% in A and 0% in B 0% in A and 100% in B

Page 36: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Interpreting the CurveWhat this curve is telling us is that the risk (measured in terms of variance) of a combination of asset A and asset B is lower than the individual risks of the two assetsIn this case it is possible for a portfolio of 50% of A and 50% of B to have half the risk of the individual assetsThis result is not entirely intuitive, and at first sight might seem nonsensicalHowever this is an extremely important resultThe interpretation of this curvature in the risk of the portfolio is that it represents diversification

Page 37: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

What if we have perfect correlation?

We can show that the quadratic relation reduces to a linear relationship when the correlation between assets become perfect (ie no diversification effect)

From the definition of correlation we see:

1)(*)(

y)Cov(x,),(C

ysdxsdyxor

)(*)(y)Cov(x, ysdxsd

Page 38: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Using our equation for 2 assets:

)~().~(..2)~(.)~(.)r~var( 2222P BABABBAA rsdrsdwwrsdwrsdw

)~,~cov(..2)~var(.)~var(.)r~var( 22P BABABBAA rrwwrwrw

2P ))~(.)~(.()r~var( BBAA rsdwrsdw

)~(.)~(.)r~sd( P BBAA rsdwrsdw

We can see in the absence of diversification (perfect correlation between assets) the relation between the risk of the portfolio and the investment weights becomes linearThis result explains the effect we saw when we artificially set the correlation between assets to 1 - making them perfectly correlated

Page 39: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

DiversificationDiversification is extremely important to financial institutionsThe insurance industry is based on the concept of diversification or pooling of riskRisk is diversified between insurance policies – the risk of a portfolio of policies is less than the sum of the risks on the individual policiesOne of the powerful abilities of the Mean-Variance Framework is that it allows us to measure and analyse diversification in a simple quantitative frameworkDiversification arises when the assets (or liabilities) making up the portfolio move independentlyBy moving independently their movements can offset each other

Page 40: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Diversification and Solvency IIThe regulatory authorities place Solvency Capital requirements on Insurance Companies to protect policyholders from the risk of InsolvencyThe level of capital that an insurance company has to hold depends on the potential losses that might occur on its underwriting and investment portfoliosOne of the weaknesses of the traditional Actuarial Methods used in the Insurance Industry is they measure Risks in isolation rather than across the business as a whole (Enterprise Risk)Using the what is essentially the Mean-Variance Model Solvency II allows insurance companies to model the effect of diversification across different lines of business and across different asset classes using large Matrices…

Page 41: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Larger PortfoliosThe equations we developed can be used to derive the statistical properties of a portfolio of just 2 assets

For a modest portfolio of 30 assets the equation describing the relationship the portfolio variance and the assets contained would contain 465 variance and covariance terms!

Financial institutions hold portfolios containing thousands of assets

In order to perform these calculations on portfolios of this scale we need to use matrices

Page 42: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Matrix Multiplication Review Question

Multiply these 2 matrices together:

9 6

(1,2)

(2,2)

* =

•What is the size/dimension of the resulting matrix?•What are its element(s)

2 1

1 2

Page 43: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Matrix Multiplication Review Question

Multiply these 3 matrices together:

9 6

(1,2)

2 1

1 2

(2,2)

* =

•What is the size/dimension of the resulting matrix?•What are its element(s)

9

6*

(2,1)

Page 44: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Hint!

9 6

(1,2)

2 1

1 2

(2,2)

* = 24 21

(1,2)

9 6

(1,2)

2 1

1 2

(2,2)

* =9

6*

(2,1)

24 219

6*

(1,2)

(2,2)

Page 45: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Expected Return Vector The relationship between the expected return on a portfolio and the statistical properties of the assets it contains can be expressed as follows:

E(rA)

E(rB)

E(rP) = WT.E

Where W is the weight vector (matrix with one column) and E is the expected return vector

wA

wB

W = E =

Page 46: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

We can see that this is equivalent to the earlier equation by multiplying out the matrices

E(rA)

E(rB)

wA wB * = wA* E(rA) + wB* E(rB)

Page 47: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Covariance Matrix

The relationship between the variance of a portfolio and the statistical properties of the assets it contains can be expressed as

Var(rP) = WT.C.W

Where W is the weight vector and C is the covariance matrix

wA

wB

W = C =Var(rA) Cov(rA,rB)

Cov(rA,rB) Var(rB)

Page 48: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Again, we can see that this is equivalent to the earlier equation by multiplying out the matrices

Var(rA) Cov(rA,rB)

Cov(rA,rB) Var(rB)wA wB *

wA

wB

*

wA*Var(rA) + wB*Cov(rA, rB) wA*Cov(rA, rB)+ wB*Var(rB) =

wA

wB

*

= wA*wA*Var(rA) + wB*wA*Cov(rA, rB) + wA*wB*Cov(rA, rB) + wB*wB*Var(rB)

Page 49: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

The Covariance MatrixWe will be using the Covariance Matrix extensively – it is the main tool we will use to describe the nature of uncertainty or RiskYou can think of it as a specially ordered table containing the covariances and variances of random variablesIt contains information not only on how individual assets behave but also how they behave together (via their covariance)It is a semi-positive definite matrix (ie WT.C.W >=0 for every non-zero column vector W - no negative variances! This is equivalent to saying the Eigen Values of the covariance matrix should be greater than or equal to zero)

Page 50: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

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

Covariance of a random variable with itself is its variance

Page 51: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Correlation MatrixA matrix closely related to the Covariance Matrix is the Correlation Matrix

As you can probably deduce from the name it contains correlations rather than covariances!

Correlations are normalised covariances whose value ranges between -1 and 1

The definition of correlation is:

yx

yxyx ysdxsd

yxCov

.)().(

),( ,,

Where px,y is the correlation between x and y and x and y are the standard deviations of x and y.

Page 52: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

1 pA,B

pB,A 1

1 pA,B pA,C

pB,A 1 pB,C

pC,A pC,B 1

Correlation Matrix for 2 Assets

Correlation Matrix for 3 Assets

A

A B

B

A

A

B

B

C

C

Identical Terms

Correlation of a random variable with

itself is 1

Page 53: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Real World DataWe will now look at how we might use the Mean Variance Framework to model the risks on a portfolio of 2 stocks: BSkyB and BootsThe statistics for the covariance matrix and expected return vector will be derived directly from a historical dataset – rather than guessed subjectively!In order to calculate the average, variance, covariance and correlation of return on the stocks we will have to use four Excel functions AVERAGE, VARP, COVAR and CORREL respectively.

Page 54: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

What We Discover

We notice that the relationship between return and the investment in BSkyB is linearWe notice that the relationship between risk or standard deviation is non linearThe minimum risk portfolio contains a mixture of both BSkyB and Boots even though Boots is a riskier stockThis is due to diversificationThe diversification effect would disappear when we have perfect correlation between the 2 assets

Page 55: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Diversification Graphic

BSkyB

Boots

+ =

Because BSkyB and Boots are independent and do not have perfect correlation their movements can offset each other and reduce the portfolio variance

Portfolio

Page 56: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Implications of DiversificationThe effect of diversification is captured in the quadratic curvature we observe when we graphed the expected return of our portfolio against its variance or risk

0

0.0002

0.0004

0.0006

0.0008

0.001

0.0012

0.0014

0.0016

0.0018

0.0001 0.00012 0.00014 0.00016 0.00018 0.0002 0.00022

Portfolio Variance

Po

rtfo

lio

Exp

ecte

d R

etu

rn

Portfolios with the same Risk but different Expected Returns

Page 57: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

The implication for investment decisions is that some portfolios are “inefficient” in the mean variance senseLooking at the previous graph we see there are two portfolios which have the same risk, but one has a greater returnAll points below the minimum risk portfolio are said to be inefficientAll points above the minimum risk portfolio are said to be efficient and make up the efficient frontier.The calculation of the efficient frontier is artificially simple when we only have 2 assets in the portfolioFor the case of 3 or more assets we need to use a constrained optimisation tool like Solver

Page 58: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

What is SolverSolver is a mathematical programming tool built into Excel which can be used to solve constrained optimisation problemsThere are a large set of problems which involve inequality constraints such as: 0 < X < 1Optimisation problems involving such constraints cannot be solved using the traditional methods of differential calculusInternally Solver uses an algorithm based on Linear Programming called the Feasible Direction Search – but we do not need to know about that to use it!

Page 59: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Where do I Find Solver

It is found under Tools->Solver

If it is not available then you might need to tell Excel to load it by going to Tools->Addins and making sure the “Solver Add-in” is checked

Solver is programmed in VBA!

Page 60: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Using SolverTarget Cell SpecifiesThe output we wish tominimize/maximize

By changing cells specifies the inputs solver will alter to find the minimum or maximum

Constraints specify the conditions that mustBe met in a feasible solution Press to Solve!

Do wewish to Min or Max?

Page 61: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

What we will ask solverWe will ask solver to find the lowest risk portfolio for our target level of return given the mean variance model This portfolio will by subject to the constraints that the sum of the weights or investment percentages will equal 1 and that all the investment weights will be positive (greater than or equal to zero)Solver will travel through the set of all possible portfolios that give a return equal to our target level using the feasible direction search to find the portfolio with the lowest riskIt will travel towards the lowest risk portfolio by changing the investment weights and examining the effect they have on risk

Page 62: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

The Solver Model

WT.VA.W

WT.E[RA]

Variance Matrix: V Return Vector: R

Fixed Inputs

Weight Vector: W

Variable InputsPortfolioVarianceVar[RP]

PortfolioExp Return

E[RP]

OutputsModel

Solver AlgorithmAlter the weightsgiven the constraints

Check to see if risk can be reducedfurther

Page 63: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Calculating the Efficient Frontier using Solver

When calculating the efficient frontier using Excel’s Solver we must first calculate the range of expected returns over which it spans

The lowest point on the efficient frontier is the expected return related to the minimum standard deviation portfolio

The highest point on the efficient frontier is the expected return related to the maximum return portfolio

The efficient frontier lies between these 2 values

All these are, of course, restricted by any constraints we impose on the frontier

Page 64: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Bounding the Efficient FrontierE

xpec

ted

Ret

urn

Risk (Standard Deviation)

Return on minimum risk portfolio

Maximum Return

Efficient Frontier

Page 65: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Solver Step 1: Calculate Minimum Variance Portfolio

Target Cell is portfolio variance We want to minimize theTarget Cell

We tell Solver it can change the portfolioweights

This is subject to the constraints that each of the weights must be greater than or equal to 0 ($B$12:$B$13 >= 0) and the sum of the weights must equal 1 ($B$15 = 1)

Page 66: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Step 2: Calculate Maximum Return Portfolio

Target Cell is PortfolioReturn

We want to maximize theTarget Cell

We tell Solver it Can change Portfolioweights

This is subject to the constraints that each of the weights must be greater than or equal to 0 ($B$14:$B$15 >= 0) and the sum of the weights must equal 1 ($B$17 = 1)

Page 67: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Calculating Points on the Frontier

To graph out the efficient frontier we need to calculate point between these minimum and maximum returnsIn general, it is best to take evenly spaced returns between these two extremities and calculate the minimum risk portfolio that achieves the target return on the frontier:

Min Var[RP] subject to E[RP] = X where X isour return for which we wish to generate

the corresponding efficient frontier point.

Page 68: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Diagram of Calculation Method

Exp

ecte

d R

etur

n

Risk (Standard Deviation)

Evenly spaced returns used to calculate thepoints on the frontier

Points on theFrontierCalculated

Minimum Variances

Page 69: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Step 3: Calculate Points on the frontier for a set level of return

We want to minimize theTarget Cell

Target Cell is Portfolio variance

We tell Solver it can change Portfolioweights

This is subject to the constraints that each of the weights must be greater than or equal to 0 ($B$14:$B$15 >= 0) and the sum of the weights must equal 1 ($B$17 = 1)and that the return must be equal to some level ($F$14 = $G$42)

Page 70: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.
Page 71: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Appendix 1: Transformation Between Correlation and Covariance Matrix

The covariance matrix and correlation matrix are obviously linked – they both measure how things move togetherLet 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

Page 72: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

2 by 2 Correlation to Covariance Matrix Example

1 pA,B

pA,B 1

A 0

0 B

A 0

0 B

* *

=A* A pA,B*A*B

pA,B*B*A B* B

Var(A) Cov(A,B)

Cov(A,B) Var(B)=

A2 A,B

A,B B2

=

Page 73: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

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 standard deviation matrixD is a matrix with the standard deviations along the diagonal and zeros everywhere else (diagonal matrix)Because D is a diagonal matrix its inverse is simply the reciprocal of the elements along the diagonal.

Page 74: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

2 by 2 Covariance to Correlation Matrix Example

1/ A 0

0 1/ B

1/ A 0

0 1/ B

* *

=A

2/(A* A) A,B/(A* B)

A,B/(A* B) B2/(B* B)

=

A2

B2

1 pA,B

pA,B 1

Page 75: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Appendix 2: Expectation Operators

The expectation operator measures the average value of some function of a random variableWe will prove the 2 properties of the expectation operator:

)~()~()~~( yExEyxE

)~(.)~.( xEaxaE

Firstly we note:

)..()~.(

Xx

ix

i

ixapxaE

Where X is the set of all possible values of xi and px is the probability of a specific outcome

Page 76: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Since a is a constant

)(...)~.( xEaxpaxaEXx

ix

i

i

For the second proof

).()~~(

Xx Yy

iiyx

i i

iiyxpyxE

Where pxny measures the probability of observing xi and yi together

Since the probabilities are disjoint or mutually exclusive

i

i

ii xYy

yx pp

i

i

ii yXx

yx pp

Xx Yy

iyxXx Yy

iyx

i i

ii

i i

iiypxpyxE ..)~~(

Page 77: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Yy

iyXx

ix

i

i

i

iypxpyxE ..)~~(

)~()~()~~( yExEyxE

This expectation can be re-expressed as

Which is equivalent to

This proof is for discrete random variables, we could produce a similar proof for continuous random variables using integration rather than summation

Page 78: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Appendix 3: Portfolio Variance

The portfolios variance can be defined as:

2vvv ))r~E(-r~()r~Var( E

2BBBBAAAA )))r~(.w r~.w())r~.E(w-r~.E((w E

2BBBB

2AAAA ))r~.E(w-r~.(w))r~.E(w-r~.(w EE

))r~.E(w-r~.(w)).r~.E(w-r~.(w.2 BBBBAAAAE

Page 79: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

2BBB

2B

2AA

2 ))r~.E(w-r~(.w))r~E(-r~(. EwA

))r~E(-r~()).r~E(-r~((.w.w.2 BBAABA E

)~,~cov(..2)~var(.)~var(.)r~Var( 22v BABABBAA rrwwrwrw

Where cov is the covariance

The intuition is that the variance of the portfolio depends not just on how the assets it contains move together but also on how they move together or co-vary (measured by covariance).

We note the relationship is quadratic

Page 80: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Appendix 4: Correlation & the Cauchy-Schwarz Inequality

Cauchy-Schwarz inequality is an important result from linear algebra which states:

1*

1

2

1

2

2

1

N

ii

N

ii

N

iii

yx

yx

Page 81: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

N

ii

N

ii

N

iii

yEyxEx

yEyxEx

1

22

1

1

))((*))((

))()).(((

12

We can write the correlation coefficient as

From Cauchy-Schwarz we can see

Implying that

11 We can also prove that in the case where p is -1 or 1 (perfect correlation) the random variables x and y are linearly dependent

Page 82: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Appendix 5: Eigen Values of Semi-Positive Definite Matrices

For a semi positive definite matrix C (N by N):

If C is semi positive definite it is possible to decompose it into

Where V is a vector whose columns are the Eigen Vectors of C and D is a diagonal matrix of its Eigen Values

0.. WCW T

TVDVC ..

Page 83: Risk Analysis & Modelling Lecture 2: The Mean-Variance Model.

Making this substitution we see:

X is an arbitrary matrix resulting from this calculation:

We can say:

Since D is a diagonal matrix of Eigen Values (Dii is the ith Eigen Value and Xi is the ith element of the vector X):

Since Xi2 must be greater than or equal to zero for real values of X

then we can see that this sum cannot be negative if the Eigen Values (Dii) are also greater than or equal to zero.This formula can also be used as an extremely efficient way of calculating a Quadratic Form

0)..(.).(...... WVDWVWVDVWWCW TTTTTT

WVX T .

XDXWCW TT ....

N

iiii

T DXWCW1

2...