basic mathematics for portfolio management. statistics variables x, y, z constants a, b observations...

20
Basic Mathematics for Portfolio Management

Post on 22-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Basic Mathematicsfor

Portfolio Management

Page 2: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Statistics

• Variables x, y, z

• Constants a, b

• Observations {xn, yn |n=1,…N}

• Mean

mean or expected value of x E x x

E a x b y a x b y

1

1 N

nn

x xN

Page 3: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Variance

22x Var x E x x

2 2xVar a x a

22

1

1 N

x nn

x xN

Page 4: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Covariance

,xy Cov x y E x x y y

xy yx

2, xCov x x

, xz yzCov a x b y z a b

2 2 2 2

,

2x y xy

Var a x b y Cov a x b y a x b y

a b ab

1

1 N

xy n nn

x x y yN

Page 5: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Regression

• This is an example of a linear model.• The model is unbiased if:

• How do we choose the best {a,b}?

ˆn n n n ny a b x y

1

0N

nn

Page 6: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Regression

• The best estimates for {a,b} should minimize the sum of squared errors:

• This corresponds to minimizing:

• Which leads to two equations:

2

1

ˆ ˆ2N

n n nn

y y y

22

1 1

ˆN N

n n nn n

ESS y y

1

1

ˆˆ 0

ˆˆ 0

Nn

n nn

Nn

n nn

yy y

a

yy y

b

Page 7: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Regression

• The first equation leads to an unbiased model.

• We can use this to solve for a:

1

ˆˆ1 0

Nn

n nn

yy y

a

n n ny a b x

y a b x

a y b x

Page 8: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Regression

• The second equation relates the coefficient b to the sample covariance of x and y:

• Putting this together:

• The model is the best linear unbiased estimate (BLUE), given only the sample data.

1

ˆˆ 0

,

Nn

n n n nn

yx y y x

b

Cov x yb

Var x

,

n n n

Cov x yy y x x

Var x

y

Page 9: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

BLUE of y conditional on x

• More generally, the BLUE has the form:

• You can see how this directly relates to our prior regression result.

• We will apply this result more generally than just in the regression context. For example, our estimates of variances and covariances may improve upon sample estimates.

1| ,E y x E y Cov x y Var x x E x

Page 10: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Linear Algebra• Vectors and Matrices (We will denote in bold)

• Transpose

• Dimensions– (Rows x Columns)– Keep track of these

• Addition and Multiplication– Can only add matrices of identical dimension– For multiplication,

1

2

N

h

h

h

h

1 2, ,TNh h hh

, , ,N M M K N K

Tkn nkX X

11 12 13 1

21 22

1

N

T

K KN

X X X X

X X

X X

X

Page 11: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Matrix Multiplication: AxB

• Move across A and down B

11 12 13 1 1 11

221 22

11

N

N n nn

T

N

Kn nNK KNn

X X X X h X h

hX X

X hhX X

X h

Page 12: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Hint 1

• Keep track of the size of the matrices, to make sure the algebra makes sense:

1

2

1

1 2N

TP P P P P n

n

N

r

rh h h N h n r

r

h r

122

11 1

2 2

21

21

11

Nn P

n BPN

B

B B NPN N Nn P

n B

V h n

h

h N V h n

V h

Page 13: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean
Page 14: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Matrix Inverse

1

1

1 1 1

A x y

x A y

A A I

A B B A

Page 15: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Using Linear Algebra

• Portfolio Variance21 12 1

221 2 2

21

N

N

N N

V

1

2

N

h

h

h

h

21 1 2 2

2 2 2 21 1 1 2 12 1 3 132 2

P N N

N N

T

Var h r h r h r

h h h h h h

h V h

Page 16: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Multivariate Regression

• The multivariate linear model is:

• We can include an intercept as a column of X.• To generalize, we minimize the weighted sum of squared

errors:

• Our resulting estimates are:

Cov

y X f ε

Ω ε

1T ε Ω ε

11 1T T f X Ω X X Ω y

Page 17: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Basic Utility Function

• Mean/Variance

• What are the dimensions of U?

2P P

T T

U f

h f h V h

Page 18: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

Portfolio Optimization

• Choose portfolio h to maximize U.• What does that mean? We must take the

derivative of U with respect to each of the N elements of h. That leads to N equations in N unknowns.

0n

U

h

0T

U

h

Page 19: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean

More Hints

• Hint 2: Try out 2x2 or 3x3 examples.

• Hint 3: To start, try working with individual elements. For example, I will use shorthand like:

– This says to take derivatives with respect to each element of h. This should lead to N separate equations.

– Example:

T

h

2TT

h V h V h

h

Page 20: Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean