# Calculating weights of tangency portfolio

Im having trouble calculating the market portfolio weights (tangency portfolio) for a portfolio consisting of 5 risky assets and 1 risk free asset with 2% return. The data is from 5 assets from the DOW index, weekly (simple) returns over 10 years.

mu_vector
[1] 0.0047814980 0.0006305876 0.0019639934 0.0022272630 0.0017666784

cov_matrix
[,1]         [,2]         [,3]         [,4]         [,5]
[1,] 0.0013136428 0.0004440908 0.0006384975 0.0002187552 0.0002699354
[2,] 0.0004440908 0.0006261272 0.0004859392 0.0002176951 0.0002377565
[3,] 0.0006384975 0.0004859392 0.0015624367 0.0002051366 0.0002193841
[4,] 0.0002187552 0.0002176951 0.0002051366 0.0004290360 0.0002074602
[5,] 0.0002699354 0.0002377565 0.0002193841 0.0002074602 0.0004136037

C_inv
[,1]      [,2]        [,3]        [,4]         [,5]
[1,] 1113.71762 -447.8322 -265.282719   -72.39333  -292.403774
[2,] -447.83220 2795.3090 -503.732477  -584.45180  -754.238655
[3,] -265.28272 -503.7325  910.756998   -45.87658     2.627825
[4,]  -72.39333 -584.4518  -45.876579  3286.18313 -1240.774361
[5,] -292.40377 -754.2387    2.627825 -1240.77436  3663.144774


Now im using the property that all portfolios on the efficient frontier satisfy that $$\gamma\cdot \vec{w_{tan}} \cdot C=\vec{mu}-RF\cdot \vec{1}$$

given that RF=0.02

$$\gamma \cdot \vec{w_{tan}} = (3.127893, -14.10325, -1.864773, -22.53139, -25.72763)$$

since the weights must sum to 1 I get that $$\gamma = -61.09915$$

I get that $$\vec{w_{tan}} = (-0.05119373, 0.2308257, 0.03052044, 0.3687677, 0.42108)$$

using the formula for expected return on the portfolio : $$\mu_v = \vec{mu} \cdot \vec{w^T_{tan}}=0.001525971$$

and $$std= \sqrt{\vec{w_{tan}} \cdot C \cdot \vec{w^T_{tan}}} = 0.01712042$$ This return is smaller than the global min variance portfolio's return, and with higher risk, and is thus not on the efficient frontier. What have I done wrong? Any help is appreciated. If I need to provide the data ill do that!

• The risk free rate is 0.02 per year (I presume). The return on the first risky security is 0.0047814980 per what ? Clearly not per year, since it is so small. You have to put all the returns on the same basis (per year, per month, per day) or the math is not going to work. – Alex C Mar 9 at 1:01
• Geometrically what is happening is that because the risk free rate is larger than the returns on stocks the point of tangency is on the bottom part of the mean-variance frntier (i.e. the inefficient part), below the Global Min Variance Portfolio. – Alex C Mar 9 at 1:29
• all returns of the risky assets are weekly simple returns, while the risk free rate is 2% continuous compounding per year. So I would have to recalculate my mu vector by multiplying it by 52? And recalculate the cov_matrix to be ajusted to yearly returns aswell? – kroneckersdelta Mar 9 at 13:34
• Easiest solution would be to use 0.02/52 = 0.0003846 for risk free rate and leave everything else unchanged (i.e. make everything weekly). – Alex C Mar 9 at 21:34