# 程序代写案例-MATH 11158

General Approach Markowitz Model MATH 11158: Optimization Methods in Finance Portfolio Optimization1 Akshay Gupte School of Mathematics, University of Edinburgh Week 3 : 25 January, 2021 1Chapter 6 in the textbook Email: [email protected] 1 / 40 General Approach Markowitz Model General Approach 2 / 40 General Approach Markowitz Model What is Portfolio Optimization ? In arbitrage detection, we created a “good” portfolio with zero risk But is it realistic to select a portfolio (i.e., make an investment) without accounting for any risk in our decisions ? Financial markets are highly nondeterministic Question: What makes a good investment? • High (expected) return • Low risk • Something else? In fact we would simultaneously like high return and low risk. Improving one often results in worse performance on the other2. Select a portfolio that strikes a balance between these two objectives =⇒ Multicriteria (or Pareto) optimization 2There ain’t no such thing as a free lunch 3 / 40 General Approach Markowitz Model What is Portfolio Optimization ? In arbitrage detection, we created a “good” portfolio with zero risk But is it realistic to select a portfolio (i.e., make an investment) without accounting for any risk in our decisions ? Financial markets are highly nondeterministic Question: What makes a good investment? • High (expected) return • Low risk • Something else? In fact we would simultaneously like high return and low risk. Improving one often results in worse performance on the other2. Select a portfolio that strikes a balance between these two objectives =⇒ Multicriteria (or Pareto) optimization 2There ain’t no such thing as a free lunch 3 / 40 General Approach Markowitz Model What is Portfolio Optimization ? In arbitrage detection, we created a “good” portfolio with zero risk But is it realistic to select a portfolio (i.e., make an investment) without accounting for any risk in our decisions ? Financial markets are highly nondeterministic Question: What makes a good investment? • High (expected) return • Low risk • Something else? In fact we would simultaneously like high return and low risk. Improving one often results in worse performance on the other2. Select a portfolio that strikes a balance between these two objectives =⇒ Multicriteria (or Pareto) optimization 2There ain’t no such thing as a free lunch 3 / 40 General Approach Markowitz Model What is Portfolio Optimization ? In arbitrage detection, we created a “good” portfolio with zero risk But is it realistic to select a portfolio (i.e., make an investment) without accounting for any risk in our decisions ? Financial markets are highly nondeterministic Question: What makes a good investment? • High (expected) return • Low risk • Something else? In fact we would simultaneously like high return and low risk. Improving one often results in worse performance on the other2. Select a portfolio that strikes a balance between these two objectives =⇒ Multicriteria (or Pareto) optimization 2There ain’t no such thing as a free lunch 3 / 40 General Approach Markowitz Model Assumptions on Market Conditions • Rational decision-makers : investors want to maximise return while reducing the risks associated with their investment • No arbitrage : cannot make a costless, riskless profit • Risky securities : S1, . . . , Sn for n ≥ 2, whose future returns are uncertain. There is no risk-free asset S0 in the portfolio • Equilibrium : supply equals demand for securities • Liquidity : any # of units of a security can be bought and sold quickly • Access to information : rapid availability of accurate information • Price is efficient : Price of security adjusts immediately to new information, and current price reflects past information and expected further behaviour • No transaction costs and taxes : transaction costs are assumed to be negligible compared to value of trades and are ignored. No taxes (capital-gains etc.) on transactions 4 / 40 General Approach Markowitz Model Notation We have £1 to invest3 in n risky securities S1, . . . ,Sn Goal is to select a portfolio x = (x1, . . . , xn) ∈ Rn, where xi = amount invested in S i Intuitive to think of xi ≥ 0, however, doing so means we do not allow short-selling on S i , and we generally allow short-selling of assets. Hence, x ≥ 0 is not imposed as a constraint always. • two time periods, now (time 0) and future (time 1) • ri : Ω→ R is random variable for return of asset i (e.g., a 5% return means r = 1.05). Probability distribution of ri usually unknown µi = E[ri ], expected return of S i • r := r(ω) = (r1(ω), . . . , rn(ω)) is vector of random returns µ = (µ1, . . . , µn) ∈ Rn is vector of means 3In our analysis, investment of £1 can be scaled to £b for any b > 0 5 / 40 General Approach Markowitz Model Notation We have £1 to invest3 in n risky securities S1, . . . ,Sn Goal is to select a portfolio x = (x1, . . . , xn) ∈ Rn, where xi = amount invested in S i Intuitive to think of xi ≥ 0, however, doing so means we do not allow short-selling on S i , and we generally allow short-selling of assets. Hence, x ≥ 0 is not imposed as a constraint always. • two time periods, now (time 0) and future (time 1) • ri : Ω→ R is random variable for return of asset i (e.g., a 5% return means r = 1.05). Probability distribution of ri usually unknown µi = E[ri ], expected return of S i • r := r(ω) = (r1(ω), . . . , rn(ω)) is vector of random returns µ = (µ1, . . . , µn) ∈ Rn is vector of means 3In our analysis, investment of £1 can be scaled to £b for any b > 0 5 / 40 General Approach Markowitz Model Notation We have £1 to invest3 in n risky securities S1, . . . ,Sn Goal is to select a portfolio x = (x1, . . . , xn) ∈ Rn, where xi = amount invested in S i Intuitive to think of xi ≥ 0, however, doing so means we do not allow short-selling on S i , and we generally allow short-selling of assets. Hence, x ≥ 0 is not imposed as a constraint always. • two time periods, now (time 0) and future (time 1) • ri : Ω→ R is random variable for return of asset i (e.g., a 5% return means r = 1.05). Probability distribution of ri usually unknown µi = E[ri ], expected return of S i • r := r(ω) = (r1(ω), . . . , rn(ω)) is vector of random returns µ = (µ1, . . . , µn) ∈ Rn is vector of means 3In our analysis, investment of £1 can be scaled to £b for any b > 0 5 / 40 General Approach Markowitz Model • Σ : covariance matrix for random vector r Σij = Cov(ri , rj) for all i 6= j Σij = E[(ri − µi )(rj − µj)] Σii = Var[ri ] for all i = 1, . . . , n Σi = E[(ri − µi )2] = E[r2i ]− (E[ri ])2 = E[r2i ]− µ2i Fact Covariance matrix Σ is symmetric and positive semidefinite. x>Σx = x> E[(r − µ)(r − µ)>]︸ ︷︷ ︸ Σ x = E[x>(r − µ)(r − µ)>x ] = E[(r>x − µ>x)2] = E[(r(x)− E[r(x)])2] = Var[r>x ] ≥ 0 6 / 40 General Approach Markowitz Model • Σ : covariance matrix for random vector r Σij = Cov(ri , rj) for all i 6= j Σij = E[(ri − µi )(rj − µj)] Σii = Var[ri ] for all i = 1, . . . , n Σi = E[(ri − µi )2] = E[r2i ]− (E[ri ])2 = E[r2i ]− µ2i Fact Covariance matrix Σ is symmetric and positive semidefinite. x>Σx = x> E[(r − µ)(r − µ)>]︸ ︷︷ ︸ Σ x = E[x>(r − µ)(r − µ)>x ] = E[(r>x − µ>x)2] = E[(r(x)− E[r(x)])2] = Var[r>x ] ≥ 0 6 / 40 General Approach Markowitz Model Admissible Portfolios The set of feasible portfolios is denoted by the set X ⊂ Rn Budget constraint is always included n∑ i=1 xi = 1, or n∑ i=1 xi = b if initial is \$b • No short selling : xi ≥ 0 • Short selling allowed : xi ≥ −`i • Diversification : xi ∈ {0} ∪ [`i , ui ], such a semi-continuous variable can be modeled using integer programming Unless stated otherwise, we assume X = {x ∈ Rn : ∑ni=1 xi = 1} 7 / 40 General Approach Markowitz Model Return of a Portfolio Return of a portfolio x is a random variable that is a linear function of x Random return on x = sum of returns on each asset R(x) = n∑ i=1 rixi = r >x Expected return on x E[R(x)
nce • In some sense, the standard deviation is the correct risk measure to use. But variance leads to nicer (easier) optimization problems. 27 / 40 General Approach Markowitz Model max x µ>x − δx>Σx (EP3) s.t. x ∈ X max x µ>x − δ′ √ x>Σx (EP3′) s.t. x ∈ X • (EP3) and (EP3’) are equivalent : lead to the same efficient frontier. • Let x∗ = x∗(δ) be the optimal portfolio in (EP3) for a given δ > 0. Then there exists a δ′ > 0 such that x∗ is the solution to (EP3’). • (EP3’) is dual to (EP1’)/(EP2’), as with variance • In some sense, the standard deviation is the correct risk measure to use. But variance leads to nicer (easier) optimization problems. 27 / 40 General Approach Markowitz Model Positive Definiteness Condition Covariance matrix Σ is always psd. What if we require it to be positive definite ? What does it mean for the Markowitz model ? Positive definite means that x>Σx 6= 0 for all x 6= 0. If x is a portfolio then its variance x>Σx = 0 means that that there are some “redundancies” in the model ? returns of some assets depend deterministically on the returns of others. We can keep removing these assets from the model until we get positive definiteness. 28 / 40 General Approach Markowitz Model Positive Definiteness Condition Covariance matrix Σ is always psd. What if we require it to be positive definite ? What does it mean for the Markowitz model ? Positive definite means that x>Σx 6= 0 for all x 6= 0. If x is a portfolio then its variance x>Σx = 0 means that that there are some “redundancies” in the model ? returns of some assets depend deterministically on the returns of others. We can keep removing these assets from the model until we get positive definiteness. 28 / 40 General Approach Markowitz Model Illustrative Example 29 / 40 General Approach Markowitz Model Example Consider investing into an index fund of stocks (S&P 500), bonds (10y US Treasury Bond) and money market CDs (1-day Federal Funds Rate). Step 1. Get Historical Data Ii,t = price of asset i = 1, . . . , n at time t = 0, 1, . . . ,T S (asset 1) B (asset 2) MM (asset 3) 1960 (t = 0) 20.26 262.94 100.00 1961 (t = 1) 25.69 268.73 102.33 1962 (t = 2) 23.43 284.09 105.33 1963 (t = 3) 28.75 289.16 108.89 … … … … 2003 (t = 43) 1622.94 5588.19 1366.73 30 / 40 General Approach Markowitz Model Step 2. Transform into Historical (yearly) Return Rates ri,t = Ii,t Ii,t−1 S (asset 1) B (asset 2) MM (asset 3) 1960 (t = 0) – – – 1961 (t = 1) 1.2681 1.0220 1.0233 1962 (t = 2) 0.9122 1.0572 1.0293 1963 (t = 3) 1.2269 1.0179 1.0338 … … … … 31 / 40 General Approach Markowitz Model Step 3. Estimate Mean Return Rates r¯i = 1 T >∑ t=1 ri,t︸ ︷︷ ︸ arithmetic mean µi =  >∏ t=1 ri,t 1/T ︸ ︷︷ ︸ geometric mean S (asset 1) B (asset 2) MM (asset 3) r¯i 1.1206% 1.0785% 1.0632% µi 1.1073% 1.0737% 1.0627% µ = (1.1073, 1.0737, 1.0627)> Note: Stocks have highest expected return 32 / 40 General Approach Markowitz Model Step 4. Estimate Covariance Matrix Σij = 1 T >∑ i=1 (ri,t − r¯i )(rj,t − r¯j), i , j ∈ {1, 2, . . . , n} Σ =  0.02778 0.00387 0.000210.00387 0.01112 −0.00020 0.00021 −0.00020 0.00115  Note: MM has lowest variance (risk) Step 5. Find Efficient Portfolio without Short-Selling min x x>Σx (EP2) s.t. µ>x ≥ R x ∈ X := {x ∈ R3 : x ≥ 0, x1 + x2 + x3 = 1} for R ∈ [6.5%, 10.5%]. 33 / 40 General Approach Markowitz Model 2 4 6 8 10 12 14 16 0.065 0.07 0.075 0.08 0.085 0.09 0.095 0.1 0.105 0.11 Efficient Frontier Standard deviation (%) 7 8 9 10 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Composition of efficient portfolios Expected return of efficient portfolios (%) Pe rc en t i nv es te d in d iff er en t a ss et c la ss es Stocks Bonds Money Market 34 / 40 General Approach Markowitz Model Analysis of Efficient Portfolios 35 / 40 General Approach Markowitz Model Allowing Short Selling Take the minimum variance portfolio problem min x f (x) = 1 2 x>Σx s.t. e>x = 1, µ>x = R assuming some positive definite covariance matrix Σ Since we have equality constraints5, Method of Lagrange Multipliers can be used to derive analytical form of optimal portfolio x Lagrange function is L(x , λ) = f (x) + λ1(1− e>x) + λ2(R − µ>x) Lagrange Multiplier Theorem and positive definiteness of Σ (which is the Hessian matrix of L(x , λ) w.r.t. x) says that we need to solve first-order gradient conditions ∂L ∂x = 0 =⇒ Σx − λ1e − λ2µ = 0 ∂L ∂λ = 0 =⇒ e>x = 1, µ>x = R 5If we had µ>x ≥ R, we would need to use Karush-Kuhn-Tucker (KKT) optimality conditions 36 / 40 General Approach Markowitz Model Allowing Short Selling Take the minimum variance portfolio problem min x f (x) = 1 2 x>Σx s.t. e>x = 1, µ>x = R assuming some positive definite covariance matrix Σ Since we have equality constraints5, Method of Lagrange Multipliers can be used to derive analytical form of optimal portfolio x Lagrange function is L(x , λ) = f (x) + λ1(1− e>x) + λ2(R − µ>x) Lagrange Multiplier Theorem and positive definiteness of Σ (which is the Hessian matrix of L(x , λ) w.r.t. x) says that we need to solve first-order gradient conditions ∂L ∂x = 0 =⇒ Σx − λ1e − λ2µ = 0 ∂L ∂λ = 0 =⇒ e>x = 1, µ>x = R 5If we had µ>x ≥ R, we would need to use Karush-Kuhn-Tucker (KKT) optimality conditions 36 / 40 General Approach Markowitz Model Multiplying first gradient condition by Σ−1, we get x∗ = λ1Σ−1e + λ2Σ−1µ Substituting this x into the two linear constraints and solving for λ yields λ1 = C − RB AC − B2 , λ2 = RA− B AC − B2 where A = e>Σ−1e, B = µ>Σ−1e and C = µ>Σ−1µ. Hence, x∗ := x∗R = C − RB AC − B2 Σ −1e + RA− B AC − B2 Σ −1µ Markowitz Efficient Frontier is produced by the portfolios{ x∗R : R ≥ B A } 37 / 40 General Approach Markowitz Model Global and Diversified Portfolios • Global Minimum Variance Portfolio is obtained by setting the second Lagrange multiplier to zero λ2 = 0 =⇒ R = B A =⇒ xG = Σ −1e A • Diversified Portfolio is obtained by setting the first Lagrange multiplier to zero λ1 = 0 =⇒ R = C B =⇒ xD = Σ −1µ B 38 / 40 General Approach Markowitz Model Mutual Fund Theorem Theorem Any minimum variance portfolio x∗ can be written as a convex combination of two distinct minimum variance portfolios x ′ and x ′′ where x ′ 6= x ′′, x∗ = αx ′ + (1− α)x ′′, some α ∈ [0, 1]. In particular, we can take x ′ = xG and x ′′ = xD . 39 / 40 General Approach Markowitz Model No Short Selling X = {x ≥ 0 : ∑ni=1 xi = 1} is a simplex in Rn. Do not need Σ to be pd. Exercise Show that the set of optimal portfolios is a compact convex set. Theorem For every minimum variance portfolio x , there exist n + 1 “mutual funds” w1, . . . ,wn+1 such that x is a convex combination of {w1, . . . ,wn+1} x = n+1∑ i=1 αiw i , some α ≥ 0, n+1∑ i=1 αi = 1 Here, compactness of X implies set of optimal solutions X ∗ is bounded, and then the theorem is a consequence of Krein-Milman theorem and Caratheodory theorem for convex sets 40 / 40 General Approach Markowitz Model No Short Selling X = {x ≥ 0 : ∑ni=1 xi = 1} is a simplex in Rn. Do not need Σ to be pd. Exercise Show that the set of optimal portfolios is a compact convex set. Theorem For every minimum variance portfolio x , there exist n + 1 “mutual funds” w1, . . . ,wn+1 such that x is a convex combination of {w1, . . . ,wn+1} x = n+1∑ i=1 αiw i , some α ≥ 0, n+1∑ i=1 αi = 1 Here, compactness of X implies set of optimal solutions X ∗ is bounded, and then the theorem is a consequence of Krein-Milman theorem and Caratheodory theorem for convex sets 40 / 40 General Approach Markowitz Model No Short Selling X = {x ≥ 0 : ∑ni=1 xi = 1} is a simplex in Rn. Do not need Σ to be pd. Exercise Show that the set of optimal portfolios is a compact convex set. Theorem For every minimum variance portfolio x , there exist n + 1 “mutual funds” w1, . . . ,wn+1 such that x is a convex combination of {w1, . . . ,wn+1} x = n+1∑ i=1 αiw i , some α ≥ 0, n
+1∑ i=1 αi = 1 Here, compactness of X implies set of optimal solutions X ∗ is bounded, and then the theorem is a consequence of Krein-Milman theorem and Caratheodory theorem for convex sets 40 / 40 General Approach Markowitz Model No Short Selling X = {x ≥ 0 : ∑ni=1 xi = 1} is a simplex in Rn. Do not need Σ to be pd. Exercise Show that the set of optimal portfolios is a compact convex set. Theorem For every minimum variance portfolio x , there exist n + 1 “mutual funds” w1, . . . ,wn+1 such that x is a convex combination of {w1, . . . ,wn+1} x = n+1∑ i=1 αiw i , some α ≥ 0, n+1∑ i=1 αi = 1 Here, compactness of X implies set of optimal solutions X ∗ is bounded, and then the theorem is a consequence of Krein-Milman theorem and Caratheodory theorem for convex sets 40 / 40 欢迎咨询51作业君