# Week 7.1 Lagranges Method

50 %
50 %
Information about Week 7.1 Lagranges Method

Published on March 6, 2014

Author: anhtuantran509

Source: slideshare.net

AMATH 460: Mathematical Methods for Quantitative Finance 7.1 Lagrange’s Method Kjell Konis Acting Assistant Professor, Applied Mathematics University of Washington Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 1 / 29

Outline 1 Optimal Investment Portfolios 2 Relative Extrema of Functions of Several Variables 3 Lagrange’s Method 4 Example 5 Minimum Variance Portfolio Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 2 / 29

Outline 1 Optimal Investment Portfolios 2 Relative Extrema of Functions of Several Variables 3 Lagrange’s Method 4 Example 5 Minimum Variance Portfolio Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 3 / 29

Investment Portfolios Portfolio of n assets Let wi be the proportion of the portfolio invested in asset i Have constraint n wi = 1 i=1 Can take long and short positions =⇒ no constraints on individual wi Let µi be the expected rate of return on asset i Let σi2 be the risk of asset i Let ρij be the correlation between assets i and j Expected rate of return and risk of the portfolio: n Expected Return = w i µi i=1 n Risk = wi2 σi2 + 2 i=1 Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method wi wj σi σj ρij 1≤i<j≤n 4 / 29

Investment Portfolios: Matrix Notation Let w = (w1 , . . . , wn ) and µ = (µ1 , . . . , µn ) The expected rate of return can be written in matrix notation as n wi µi = w T µ Return = i=1 The risk can be written as Risk = w T Σw Σ is the covariance matrix of the n assets  2 σ1     σ2 σ1 ρ21  Σ= .  . .   σ1 σ2 ρ12 · · · σ1 σn ρ1n  2 σ2 . . . ··· .. . σn σ1 ρn1 σn σ2 ρn2 · · · Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method σ2 σn . . . 2 σn        5 / 29

Optimal Investment Portfolios Given µ, Σ, and investor selected w , can compute portfolio return portfolio risk Two notions of optimality For a target expected return, choose w to minimize portfolio risk For a target level of risk, choose w to maximize expected return Both notions are constrained optimization problems that can be solved using Lagrange multipliers Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 6 / 29

Optimal Investment Portfolios Minimum variance optimization n asset case minimize: subject to: w T Σw eTw = 1 µT w = µ P 2 asset case minimize: subject to: 2 2 σ1 w1 2 2 + 2ρσ1 σ2 w1 w2 + σ2 w2 w1 + w2 = 1 µ1 w1 + µ2 w2 = µP Maximum expected return optimization n asset case maximize: subject to: 2 asset case maximize: µT w subject to: eTw = 1 2 w T Σw = σP Kjell Konis (Copyright © 2013) µ1 w1 + µ2 w2 w1 + w2 = 1 2 2 2 2 2 σ1 w1 + 2ρσ1 σ2 w1 w2 + σ2 w2 = σP 7.1 Lagrange’s Method 7 / 29

Outline 1 Optimal Investment Portfolios 2 Relative Extrema of Functions of Several Variables 3 Lagrange’s Method 4 Example 5 Minimum Variance Portfolio Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 8 / 29

Relative Extrema of Single Variable Functions A local minimum (maximum) of a function f is a point x0 where f (x0 ) ≤ (≥) f (x ) for some ∀x ∈ (x0 − , x0 + ) >0 A local extrema is a point that is a local minimum or maximum If f is twice diﬀerentiable and f is continuous Any local extremum is a critical point of f : f (x0 ) = 0 Can classify critical points using second derivative test f (x0 ) < 0 f (x0 ) > 0 f (x0 ) = 0 Kjell Konis (Copyright © 2013) local maximum local minimum anything possible 7.1 Lagrange’s Method 9 / 29

Relative Extrema of Functions of n Variables A local minimum (maximum) of a function f : Rn → R is a point x0 ∈ Rn where f (x0 ) ≤ (≥) f (x ) ∀x : x − x0 < Every local extremum is a critical point: Df (x0 ) = 0 If f is twice diﬀerentiable and has continuous second order partial derivatives D 2 f (x0 ) is a symmetric matrix with real eigenvalues Second order conditions All eigenvalues of D 2 f (x0 ) > 0 All eigenvalues of D 2 f (x0 ) < 0 D 2 f (x0 ) has ± eigenvalues D 2 f (x0 ) singular Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method local minimum local maximum saddle point anything can happen 10 / 29

Finding Extrema: Functions of 2 Variables Find the local extrema of f (x , y ) = x 2 + xy + y 2 Df (x , y ) = 2x + y x + 2y Df (0, 0) = 0 0 ⇒ (0, 0) is a critical point D 2 f (x , y ) = 2 1 1 2 Can use R to compute the eigenvalues > A <- matrix(c(2, 1, 1, 2), 2, 2) > eigen(A)\$values [1] 3 1 Since both eigenvalues are greater than 0 =⇒ (0, 0) a local minimum Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 11 / 29

Finding Extrema: Functions of 2 Variables (Take 2) Find the local extrema of f (x , y ) = −x 2 − xy − y 2 Df (x , y ) = − 2x − y − x − 2y Df (0, 0) = 0 0 ⇒ (0, 0) is a critical point D 2 f (x , y ) = −2 −1 −1 −2 Can use R to compute the eigenvalues > A <- matrix(-c(2, 1, 1, 2), 2, 2) > eigen(A)\$values [1] -1 -3 Since both eigenvalues are less than 0 =⇒ (0, 0) a local maximum Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 12 / 29

Finding Extrema: Functions of 2 Variables Find the local extrema of f (x , y ) = x 2 + 3xy + y 2 Df (x , y ) = 2x + 3y 3x + 2y Df (0, 0) = 0 0 ⇒ (0, 0) is a critical point D 2 f (x , y ) = 2 3 3 2 Can use R to compute the eigenvalues > A <- matrix(c(2, 3, 3, 2), 2, 2) > eigen(A)\$values [1] 5 -1 One positive and one negative eigenvalue =⇒ (0, 0) a saddle point Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 13 / 29

Finding Extrema: Functions of 2 Variables 3 Find the local extrema of f (x , y ) = 2xy − (1 − y 2 ) 2 First order condition Df (x , y ) = 2y Df (0, 0) = 0 0 2x + 3y 1 − y2 =⇒ (0, 0) is a critical point Second order condition   0 D 2 f (x , y ) =  2  2 3−6y √ 2   1−y 2  D 2 f (0, 0) =  0 2 2 3   Compute the eigenvalues of the Hessian at the critical point > eigen(matrix(c(0, 3, 3, 2), 2, 2))\$values [1] 4.162278 -2.162278 One positive and one negative eigenvalue =⇒ (0, 0) a saddle point Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 14 / 29

Outline 1 Optimal Investment Portfolios 2 Relative Extrema of Functions of Several Variables 3 Lagrange’s Method 4 Example 5 Minimum Variance Portfolio Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 15 / 29

Lagrange’s Method Problem: maximize: subject to: f (x1 , x2 , . . . , xn ) g1 (x1 , x2 , . . . , xn ) = 0 g2 (x1 , x2 , . . . , xn ) = 0 . . . (1) gm (x1 , x2 , . . . , xn ) = 0 18th -century mathematician Joseph Louis Lagrange proposed the following method for the solution Form the function m F (x1 , . . . , xn , λ1 , . . . , λm ) = f (x1 , . . . , xn ) + λi gi (x1 , x2 , . . . , xn ) i=1 Optimal value for problem (1) occurs at one of the critical points of F Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 16 / 29

Lagrange’s Method Terminology: The function F (x1 , . . . , xn , λ1 , . . . , λm ) is called the Lagrangian The column vector λ = (λ1 , . . . , λm ) is called the Lagrange multipliers vector Necessary Condition: Let x = (x1 , x2 , . . . , xn ) Let g(x ) = g1 (x ), g2 (x ), . . . , gm (x ) be a vector-valued function of the constraints The gradient D g(x ) must have full rank at any point where the constraint g(x ) = 0 is satisﬁed, that is rank Dg(x ) = m Kjell Konis (Copyright © 2013) ∀ x where g(x ) = 0 7.1 Lagrange’s Method 17 / 29

Partial Derivatives of the Lagrangian D F (x , λ) has n + m variables, compute gradient in 2 parts D F (x , λ) = Dx F (x , λ) Dλ F (x , λ) Recall Lagrangian: m F (x , λ) = f (x1 , . . . , xn ) + λi gi (x1 , x2 , . . . , xn ) i=1 The partial derivatives are m ∂F ∂f ∂gi = + λi ∂xj ∂xj i=1 ∂xj Gradient of f : Df (x ) = Kjell Konis (Copyright © 2013) ∂F = gi (x ) ∂λi ∂f ∂f ... ∂x1 ∂xn 7.1 Lagrange’s Method 18 / 29

Partial Derivatives of the Lagrangian Gradient of g(x ):  ∂g1 ∂x1 ∂g2 ∂x1 ∂g1 ∂x2 ∂g2 ∂x2 ··· ∂gm ∂x1 ∂gm ∂x2 ···     Dg(x ) =  .  .  .  . . . ∂g1 ∂xn ∂g2 ∂xn      .  .  .   ··· .. . ∂gm ∂xn Can express sum in second term in matrix notation m λi i=1 ∂gi = λT Dg(x ) ∂xj j It follows that D F (x , λ) = Df (x ) + λT Dg(x ) Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method g(x ) T 19 / 29

Outline 1 Optimal Investment Portfolios 2 Relative Extrema of Functions of Several Variables 3 Lagrange’s Method 4 Example 5 Minimum Variance Portfolio Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 20 / 29

Example Want to max/min: subject to: 4x2 − 2x3 2x1 − x2 − x3 = 0 2 2 x1 + x2 − 13 = 0 Start by writing down the Lagrangian F (x , λ) = f (x ) + λ1 g1 (x ) + λ2 g2 (x ) 2 2 = 4x2 − 2x3 + λ1 (2x1 − x2 − x3 ) + λ2 (x1 + x2 − 13) Check necessary condition: Dg(x ) = Kjell Konis (Copyright © 2013) 2 −1 −1 2x1 2x2 0 7.1 Lagrange’s Method 21 / 29

Derivatives of the Lagrangian The Lagrangian 2 2 F (x , λ) = 4x2 − 2x3 + λ1 (2x1 − x2 − x3 ) + λ2 (x1 + x2 − 13) Gradient of the Lagrangian T  2λ1 + 2λ2 x1  4 − λ + 2λ x  1 2 2    −2 − λ1  D F (x , λ) =     2x1 − x2 − x3  2 2 x1 + x2 − 13 get λ1 = −2 for free Set D F (x , λ) = 0 and solve for x and λ set 2λ1 + 2λ2 x1 = 0 set 4 − λ1 + 2λ2 x2 = 0 set 2x1 − x2 − x3 = 0 set 2 2 x1 + x2 − 13 = 0 Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 22 / 29

Example (continued) A little algebra gives x1 = 2 λ2 x2 = −3 λ2 x3 = 7 λ2 Also know that 2 2 x1 +x2 = 13 =⇒ 2 λ2 2 + −3 λ2 2 = 13 = 13 λ2 2 =⇒ λ2 = ±1 The critical points are λ = (−2, −1), x = (−2, 3, −7), f (x ) = 26 λ = (−2, 1), x = (2, −3, 7), f (x ) = −26 Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 23 / 29

Outline 1 Optimal Investment Portfolios 2 Relative Extrema of Functions of Several Variables 3 Lagrange’s Method 4 Example 5 Minimum Variance Portfolio Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 24 / 29

Minimum Variance Portfolio Recall: minimum variance portfolio optimization minimize: subject to: w T Σw eTw = 1 µT w = µ P Lagrange’s method setup f (w ) = w T Σw g(w ) = g1 (w ) µT w − µP = 0 = g2 (w ) eTw − 1 = 0 First, check necessary condition Dg(x ) = Kjell Konis (Copyright © 2013) µT eT 7.1 Lagrange’s Method 25 / 29

Derivative of a Quadratic Form Let A = a b b c 2 2 Let f (x ) = x T Ax = ax1 + 2bx1 x2 + cx2 Then Df (x ) = 2ax1 + 2bx2 2bx1 + 2cx2 = 2x T A In general, let A be an n × n symmetric matrix The derivative (gradient) of the quadratic form f (x ) = x T Ax is Df (x ) = 2x T A Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 26 / 29

Minimum Variance Portfolio The Lagrangian F (y , λ) = w T Σw + λ1 e T w − 1 + λ2 µT w − µP Gradient of the Lagrangian T Df (w ) + λT Dg(w ) = g(w ) 2w T Σ + λ1 e T + λ2 µT D F (w , λ) = eTw − 1 µT w − µ P Find the critical point by solving the linear system      2Σ e µ w 0  T     0 0   λ1  =  1  e µT 0 0 λ2 µP Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 27 / 29

Minimum Variance Portfolio Further reading: Second order conditions, e.g., Theorem 9.2 and Corollary 9.1 in PFME Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 28 / 29

http://computational-finance.uw.edu Kjell Konis (Copyright © 2013) 7.1 Lagrange’s Method 29 / 29

## Add a comment

 User name: Comment:

## Related pages

### Week 7.1 Lagranges Method - slidesearch.net

AMATH 460: Mathematical Methods for Quantitative Finance 7.1 Lagrange’s Method Kjell Konis Acting Assistant Professor, Applied Mathematics University of ...

### Week 7.1 Lagranges Method - Documents

AMATH 460: Mathematical Methods for Quantitative Finance 7.1 Lagrange’s Method Kjell Konis Acting Assistant Professor, ... Week 7.1 Lagranges Method ...

### mathematicalmethods-lecture_slides-Week7-1-LagrangesMethod ...

AMATH 460: Mathematical Methods for Quantitative Finance 7.1 Lagrange’s Method Kjell Konis ...

### Structured finance techniques, products and market

Week 7.1 Lagranges Method. Tweet. 06. 03. 2014 0 views Week 7.2 Taylor Series. Tweet. 06. 03. 2014 0 views ...

### sequences and series - Lagrange's Trigonometric Identity ...

Lagrange's Trigonometric Identity. ... {theta}{2}},quad (0 Read more

### Week4.pdf - Taylor Series Lagrange Multipliers Casablanca ...

... Taylor Series Lagrange Multipliers Casablanca ... Week 1 Casablanca Finance ... Mathematical Methods for Quantitative Finance 7.1 Lagranges Method ...

### mathematics education - What is Lagrange Inversion good ...

What is Lagrange Inversion good for? ... For an application to algebraic geometry, see Lemma 1.7.1 of F. Hirzebruch, ... The week's top questions and answers;

### MEEM5701 Intermediate Dynamics - MTU

MEEM5701 Intermediate Dynamics ... 7 7.1-7.6 Rigid Body Kinematics 8 7.1-7.6 Rigid Body Kinematics ... Lagranges’s Equations