14 Covariance and correlation

14 Covariance and correlation - University of California,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: University of California, Los Angeles Department of Statistics Statistics 100A Instructor: Nicolas Christou Covariance and correlation Let random variables X , Y with means µX , µY respectively. The covariance, denoted with cov (X, Y ), is a measure of the association between X and Y . Definition: σXY = cov (X, Y ) = E (X − µX )(Y − µY ) Note: If X , Y are independent then E (XY ) = (EX )E (Y ) Therefore cov (X, Y ) = 0. Let W, X, Y, Z be random variables, and a, b, c, d be constants, • Find cov (a + X, Y ) 1 • Find cov (aX, bY ) • Find cov (X, Y + Z ) • Find cov (aW + bX, cY + dZ ) • Important: var(X + Y ) = var(X ) + var(Y ) + 2cov (X, Y ) Proof: 2 • Find var(aX + bY ) • In general: Let X1 , X2 , · · · , Xn be random variables, and a1 , a2 , · · · , an be constants. Find the variance of the linear combination Y = a1 X1 + a2 X2 + · · · + an Xn . • Example: Let X1 , X2 , X3 be random variables with EX1 = 1, EX2 = 2, EX3 = −1, var(X1 ) = 1, var(X2 ) = 3, var(X3 ) = 5, cov (X1 , X2 ) = −0.4, cov (X1 , X3 ) = 0.5, cov (X2 , X3 ) = 2. Let U = X1 − 2X2 + X3 . Find (a) E (U ), and (b) var(U ). 3 However, the covariance depends on the scale of measurement and so it is not easy to say whether a particular covariance is small or large. The problem is solved by standardize the value of covariance (divide it by σX σY ), to get the so called coefficient of correlation ρXY . ρ= cov (X, Y ) , σX σY Always, −1 ≤ ρ ≤ 1, (see proof below). cov (X, Y ) = ρσX σY If X, Y are independent then · · · Show that −1 ≤ ρ ≤ 1: 2 2 Let X , Y be random variables with variances σX , σY respectively. Examine the following random expressions: X σX + Y σY X σX − Y σY 4 Example: X and Y are random variables with joint probability density function 2 2 fXY (x, y ) = x + y, 0 ≤ x ≤ 1, 0 ≤ y ≤ 1. Find µX , µY , σX , σY , cov (X, Y ), ρXY . 5 Example: Let X1 , X2 , · · · , Xn be independent and identically distributed random variables having vari¯¯ ance σ 2 . Show that cov (Xi − X, X ) = 0. 6 Portfolio risk and return An investor has a certain amount of dollars to invest into two stocks (IBM and T EXACO ). A portion of the available funds will be invested into IBM (denote this portion of the funds with a) and the remaining funds into TEXACO (denote it with b) - so a + b = 1. The resulting portfolio will be aX + bY where X is the monthly return of IBM and Y is the monthly return of T EXACO . The goal here is to find the most efficient portfolios given a certain amount of risk. Using market data from January 1980 to February 2001 we compute that E (X ) = 0.010, E (Y ) = 0.013, V ar (X ) = 0.0061, V ar (Y ) = 0.0046, and Cov (X, Y ) = 0.00062. We first want to minimize the variance of the portfolio. This will be: Minimize Var(aX + bY ) subject to a + b = 1 Or Minimize a V ar (X ) + b V ar (Y ) + 2abCov (X, Y ) subject to a + b = 1 Therefore our goal is to find a and b, the percentage of the available funds that will be invested in each stock. Substituting b = 1 − a into the equation of the variance we get a V ar (X ) + (1 − a) V ar (Y ) + 2a(1 − a)Cov (X, Y ) To minimize the above exression we take the derivative with respect to a, set it equal to zero and solve for a. The result is: V ar (Y ) − Cov (X, Y ) V ar (X ) + V ar (Y ) − 2Cov (X, Y ) 2 2 2 2 a= and therefore V ar (X ) − Cov (X, Y ) V ar (X ) + V ar (Y ) − 2Cov (X, Y ) b= The values of a and b are: a= 0.0046 − 0.0062 0.0061 + 0.0046 − 2(0.00062) ⇒ a = 0.42. and b = 1 − a = 1 − 0.42 ⇒ b = 0.58. Therefore if the investor invests 42% of the available funds into IBM and the remaining 58% into T EXACO the variance of the portfolio will be minimum and equal to: V ar (0.42X + 0.58Y ) = 0.42 (0.0061) + 0.58 (0.0046) + 2(0.42)(0.58)(0.00062) = 0.002926. The corresponding expected return of this porfolio will be: E (0.42X + 0.58Y ) = 0.42(0.010) + 0.58(0.013) = 0.01174. We can try many other combinations of a and b (but always a + b = 1) and compute the risk and return for each resulting portfolio. This is shown in the table below and the graph of return against risk on the next page. a 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.65 0.60 0.55 0.50 0.42 0.40 0.35 0.30 0.25 0.20 0.15 0.10 0.05 0.00 b 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.58 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 Risk 0.006100 0.005576 0.005099 0.004669 0.004286 0.003951 0.003663 0.003423 0.003230 0.003084 0.002985 0.002926 0.002930 0.002973 0.003063 0.003201 0.003386 0.003619 0.003899 0.004226 0.004600 Return 0.01000 0.01015 0.01030 0.01045 0.01060 0.01075 0.01090 0.01105 0.01120 0.01135 0.01150 0.01174 0.01180 0.01195 0.01210 0.01225 0.01240 0.01255 0.01270 0.01285 0.01300 2 2 7 Portfolio possibilities curve 0.0130 q q q 0.0125 q q q 0.0120 q q q q Expected return 0.0115 q q q 0.0110 q q q 0.0105 q q q 0.0100 q q 0.055 0.060 0.065 0.070 0.075 Risk (portfolio standard deviation) 8 Efficient frontier with three stocks > summary(returns) ribm Min. :-0.2264526 1st Qu.:-0.0515524 Median :-0.0089916 Mean : 0.0003073 3rd Qu.: 0.0462550 Max. : 0.3537987 > cov(returns) ribm rxom rboeing ribm 9.930174e-03 0.001798962 3.020685e-05 rxom 1.798962e-03 0.006743820 1.781462e-03 rboeing 3.020685e-05 0.001781462 8.282167e-03 rxom Min. :-0.5219233 1st Qu.:-0.0172273 Median : 0.0007013 Mean :-0.0011666 3rd Qu.: 0.0337488 Max. : 0.2269380 rboeing Min. :-0.34570 1st Qu.:-0.04308 Median : 0.01843 Mean : 0.01079 3rd Qu.: 0.07357 Max. : 0.17483 Portfolio possibilities curve with 3 stocks q qq qq qqq qqq qq q qq qqqq qqqq qqq q qqqq q q qq q qq qqqq q qq q qqqq q qq q q q qq q qq q q qqq q qq q q q q q qq qqqqqqq qqq q q qqq q qqqqqqq q qq q q qq q q q q qqq q qq qq qq qqq q q qq qqq qq q qq qq qq q qqq qq qqq q qq q q qqq q qqqqqqqqq qqq qq q qqqqq qq q qqqqq qqq qq qqqqq qqqq qq qqqq q q qqqqqqqq qqqqqq qqq q qq qq qqq qq qqq q q qq q qqqq qqqq qq qqq qqqqqq q q q qq q qq q qq q qq qq q q qq q qq qq q qq qqq qq qqqqq qqqq q qqqqqqqqqq qqqqqqq q q q qq q q qqq q qqqqq qqq q qq q qqqqqqqqqqq qqqqq q qq qq qq qqqq qqqq qqqq q qqq q qqq qqq q q q qq qq q q qqq qqqqq q q qqq q qq q q q qqq q qq q q q qq qq q q q q qqq q qqq q q qq q qqqqq qq q q qq q qqqqq qq q q q qqqq q qqq qq q qqq qqq qqqqq qqq q q qqqq q qq q q qqqqqqq q q q qqqqqqqq q q q qq q qqq qqq q q qqq qq q q qq q q q q qq qqqq q q q q q qq q q q qq q qq qqq qq qqq qqqqq q q q q q q qq qqq q qqqq qqq q q qqq q qqq q q qq qqq q q q qqq q qq q q q qqq qqq qqqqqq qq q q q qqq qqqqqq q q q qqq q q q qqqqqqq q q qq q qqqqqqq q q q q q q qq qqqqqq q q qq q q qqqqqq q q q q qq qq q qq qq q qqq qq q q q qqq q qq qqq qqq q qq q qq q q qqq qqq q q q qqqq qq q q q q qq qq q q qq q q qq q qq q q qq qqqq qqq q q qq qqq q qq q q qq q q q qq qq q q qqq q qq qqq q qqqqqqqq qq q q q q qq q q q q q qqqqqq qq qqq qqqqqqqqqqqqq qqqqqq qqqqqqqq qqq q qqqq q q q qq q q q qq q qqq qqqqq q qq qqqqqqqqq qqqqq qq qq q q qq q q qqq q q qqqqqqqq q qq qq q q qq q q qq qq qqq qq qqq qqqqqq qq qqq qq q q qq q qq qq q qq q qqqqq qqq qqqqqq q q qqq qq q q qqqq qqq qq q qqqqqqq qq q qqq qqqqqqq qq qq qqq qq qq q qqq q q qqqq q qq q qqq q qqq qqqqq qq qq q qqqqqqqqqqqq q qqqqq qqqqq q qqq q qq qqq q q q qq qqqqqqqq q q qqqqqqqq qq qq qq qq qq q qq qqq q qqqqqqqqqqqqqqqq qqqq q q q qq q q qq qq q q q q q q q qq q q qqqqq q qq q q q q qqqqq q qq qq q qqq qqqq q q q q q q qq q qqqqq q qqqqqq q qqq qqqq qqqqq qqq qq qqqqqqqq qq q q q q qqq q q q q q qqq qqq q qq q q q qqq q qqqqqqqqqqqqq qqqqqqqqq q q q qq q qq q q qq q qqqqqqqq q qqqqqq qq qqqqqqqqqq qqqqqq qqqqqq q q q qq qqqqq q q qqqqq qq qq q q q q qq qqq q q q q qqq qqqqqq q qq qqqqqqqqqqqq q q q q q qq qqq q qq qqqqqqq qq qq qqq q q q qq qqq q q q q qqq qqq qq qqqq q q q qq q q qq q qq qqqqqq qqq q q q qqqqqqqqqqqqqqqqqqqqqqq q q q q q qq q q q q q q qqqqqq qq qq q qqq qq q qq q qqqqqqqq qqqq qqqq qqqqqq q q q q qq q q q qq q q q q qqq qq qq q q qqqqq qqqqq qqqq qqqqqqqqqqqqq q q q q q q q q qq qq qq q q qq qqq q q q qqqqq q qqqqqqqqqqqqqqqqq qqqqqq q q q q q q q q qqqqqq qqq qqqqq qq q qqqqqq q q q q qq qq qqqqqqqqqqqqqqqqqqqqqqq q q q q q q q q q qq qqqqq qq qq qq qqqqq q qq q q qqqq q q q qq q q qqq qqq q qqq qqqqqqqq qqq q q q q q q q q q q qq q qq q q qqqq q qq q q q qqqqq qq qq qqqqqqqqqq qqq q q q qq qqqqq q qq qqq qq qqq q qq q q qq qq q q q qqqq qqqqq qqq qqqqqq qq qq qqq q q qqq qqq qqqqqqqq q q q q q q q q q q q q q q qqq q q q qqq q qq q qq qqqqq qq q qqqqqqqq qq q qq q qq q qq q qq q q q q qqq q q qqqqq qqqq qq qqqqqqqqqqq q q q q q q q q q q q q q q qqq qq qq qq q qq qqqqqqqqq q q q q q q q q q q q q qq qq q qq qq qq qq q q qq qqqqqqq qq qqqqq qqq qqq q qq q qq qq qqqqqq q q q qq q q q q q q q q q q qq qqq qq q q qqqqqqqq q q q qqqqq qq qqqqqq q qqq qq qqqqqqq q q q qq q q q q q q q q q q qq q qqq q q q qqq q q q q q qqqqq q q qq qq qqq qqq q qq q qqq qqq qq q q qq qqqqq q qq q q qqqqqqqqqqqqq q q qq q q q q q q q q q q q q qqq qq q qqq q q qqqqqqqqqq q q qq q q q q q q q q q q q qqqqqqq qq qq q qq qq q q q qq q qq qqq qqqq qqqqq qq qqqqqq q q q q q q q qqq qqq q qq q q q qq qq q qqq q q q q qq q q q qqqq q q q q qqq qq qq qqqq q q q q q q qqqqqqqq q q q q q q q q q q q q q q q q q q qqqqqq q q q qqq qqq q qqq qqq q qqqq q qqqqqqq q q q q q q q q q q q q q q q q qqq q qq qqq q qq q qqqq qqqq qqq qq q q q qq q q qq qq qq qqq q qqq q qq qq qqqqqqq q q q q q q q q q q q q q q q q q q q q q q qqq qqq q qq q q q qq q q q q q q q q qq qqq qq qq q qqqqqqq q q qqqqq qq qqqqqqq q q q q q q q q q q q q q q q q q q q qq q q q qq qqq qqq qq q qqq q qq qqq qq q q q qqq q qq q q qq qqqqqqqqq qqq q qq q q q qq qq qqq q q q qqqq q q q q q q q q q qq q qqqqq qq qqq qq q qq qqq q qq q qqq q q qqqq q q q qqq qq q qq q qq q q q qqq qqqqqq qqqq q q q q q q q q q q q q q q q q q q q q q qqq q q q q q q q q q qq q q q qq qqq qqqq q q qq q qq qq q q q qq q q q q q q q q q q q q q qq q q q q q q q qqqqq qqq qqqqqqqqq qqqqqq qqqq qq qq q qq qq q qq q qq qq q q q q q qqqqq q q q qq q qqq q qq qqq qqq qq qqq q q q q qq qqq q qq q qqq q q q q qqqqqqqqq qq q q q qq qqqqqqqqqqqqqqqqqq q q q q q q q q q q q q q q q q q q q q q q q q qq q qqqqq q q q q q q q q q q q q q qqq q q q q q qqq q q qq qqq q qqq q qq q q q q q qqq q qq q q q qqqqq qq qqqq q qqqqqqqqqqqqqqqqqqqq q q q qq q q q q q q q q q q q q q q q q q q q q qq q qq q q q q qq q qqq qq q qq qq q qqq q q q qqqqqqq qqq qq q q qqqqqqqqqqq q q q q q q q q q q q q q q q q q q q q q qq q q q q qq q q qqq qqq qq qq qqq q qq q qqqq qqqqqqqqqqqqq q q q q q q q q q q q q q q qqq qq q qq q q q q q qq qqq qqq q q q q qq q qqq qq q qq qqqqqqqqqqqqqqqqqq qq q q qqq q q q qq qqq qq qq qqqq q qqqqqqqqqqqqq qqq q q qq qqq q q qqq q qq q q q qqqq q q q q qqqqq qqq qq qqqqqq q qqqq q qqqqq qqqq qq q q qq qq qq qq qqq qq q q qqqq qqq qq q q q qqqq qqqqq qq qqq qq q qq q qqqqq q q qqqqqqqqqqq qqq qq q q q qq qq qqqq q qq qq qqq q q q q q qqqqq q q qq qqqq q q q qqqqqq qq qq qqq q q q q qqq qqq qq q q qq q q q q qq qq qqq qqqqqqqqqqq q q qqq qqqqqqq q qq qqqq qqqqq qq q q qqqqq Expected return 0.000 0.002 0.004 0.006 0.008 0.010 0.06 0.07 0.08 Risk (standard deviation) 0.09 9 ...
View Full Document

Ask a homework question - tutors are online