HSG-MCS-HS21_Julia/Problemsets/PS07_Optimisation.ipynb

421 lines
53 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Mean Variance Frontier with Short Sales Constraints"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Load Packages and Utility Functions"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"printyellow (generic function with 1 method)"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using Printf, LinearAlgebra, Optim\n",
"\n",
"include(\"jlFiles/printmat.jl\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"using Plots\n",
"\n",
"#pyplot(size=(600,400)) #use pyplot or gr\n",
"gr(size=(480,320))\n",
"default(fmt = :svg)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Traditional MV Calculations \n",
"\n",
"(no constraints)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"μ = [11.5, 9.5, 6]/100 #expected returns\n",
"Σ = [166 34 58; #covariance matrix\n",
" 34 64 4;\n",
" 58 4 100]/100^2\n",
"\n",
"assetNames = [\"A\",\"B\",\"C\"];\n",
"n = length(μ)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## A Function for Calculating the (traditional) Mean-Variance Frontier\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"MVCalc"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"\"\"\n",
" MVCalc(μstar,μ,Σ)\n",
"\n",
"Calculate the std and weights of a portfolio (with mean return μstar) on MVF of risky assets.\n",
"\n",
"# Remark\n",
"- Only (λ,δ) and thus (w,stdRp) depend on μstar. We could therefore speed up the computations a bit\n",
"by doing the loop over different μstar values inside the function (and thus not recalculate Σ_1,a,b,c).\n",
"\"\"\"\n",
"function MVCalc(μstar,μ,Σ)\n",
" n = length(μ)\n",
" Σ_1 = inv(Σ)\n",
" a = μ'Σ_1*μ\n",
" b = μ'Σ_1*ones(n)\n",
" c = ones(n)'Σ_1*ones(n)\n",
" λ = (c*μstar - b)/(a*c-b^2)\n",
" δ = (a-b*μstar)/(a*c-b^2)\n",
" w = Σ_1 *(μ*λ.+δ)\n",
" StdRp = sqrt(w'Σ*w)\n",
" return StdRp,w\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"480\" height=\"320\" viewBox=\"0 0 1920 1280\">\n",
"<defs>\n",
" <clipPath id=\"clip240\">\n",
" <rect x=\"0\" y=\"0\" width=\"1920\" height=\"1280\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<path clip-path=\"url(#clip240)\" d=\"\n",
"M0 1280 L1920 1280 L1920 0 L0 0 Z\n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip241\">\n",
" <rect x=\"384\" y=\"0\" width=\"1345\" height=\"1280\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<path clip-path=\"url(#clip240)\" d=\"\n",
"M197.427 1106.38 L1872.76 1106.38 L1872.76 123.472 L197.427 123.472 Z\n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip242\">\n",
" <rect x=\"197\" y=\"123\" width=\"1676\" height=\"984\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip242)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 197.427,1106.38 197.427,123.472 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip242)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 755.87,1106.38 755.87,123.472 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip242)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1314.31,1106.38 1314.31,123.472 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip242)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1872.76,1106.38 1872.76,123.472 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 197.427,1106.38 1872.76,1106.38 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 197.427,1106.38 197.427,1087.48 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 755.87,1106.38 755.87,1087.48 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1314.31,1106.38 1314.31,1087.48 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1872.76,1106.38 1872.76,1087.48 \n",
" \"/>\n",
"<path clip-path=\"url(#clip240)\" d=\"M197.427 1133.46 Q193.816 1133.46 191.988 1137.02 Q190.182 1140.56 190.182 1147.69 Q190.182 1154.8 191.988 1158.37 Q193.816 1161.91 197.427 1161.91 Q201.062 1161.91 202.867 1158.37 Q204.696 1154.8 204.696 1147.69 Q204.696 1140.56 202.867 1137.02 Q201.062 1133.46 197.427 1133.46 M197.427 1129.75 Q203.238 1129.75 206.293 1134.36 Q209.372 1138.94 209.372 1147.69 Q209.372 1156.42 206.293 1161.03 Q203.238 1165.61 197.427 1165.61 Q191.617 1165.61 188.539 1161.03 Q185.483 1156.42 185.483 1147.69 Q185.483 1138.94 188.539 1134.36 Q191.617 1129.75 197.427 1129.75 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M746.148 1130.38 L764.504 1130.38 L764.504 1134.32 L750.43 1134.32 L750.43 1142.79 Q751.449 1142.44 752.468 1142.28 Q753.486 1142.09 754.505 1142.09 Q760.292 1142.09 763.671 1145.26 Q767.051 1148.44 767.051 1153.85 Q767.051 1159.43 763.579 1162.53 Q760.106 1165.61 753.787 1165.61 Q751.611 1165.61 749.343 1165.24 Q747.097 1164.87 744.69 1164.13 L744.69 1159.43 Q746.773 1160.56 748.995 1161.12 Q751.218 1161.68 753.694 1161.68 Q757.699 1161.68 760.037 1159.57 Q762.375 1157.46 762.375 1153.85 Q762.375 1150.24 760.037 1148.13 Q757.699 1146.03 753.694 1146.03 Q751.819 1146.03 749.944 1146.44 Q748.093 1146.86 746.148 1147.74 L746.148 1130.38 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1289 1161 L1296.64 1161 L1296.64 1134.64 L1288.33 1136.31 L1288.33 1132.05 L1296.59 1130.38 L1301.27 1130.38 L1301.27 1161 L1308.91 1161 L1308.91 1164.94 L1289 1164.94 L1289 1161 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1328.35 1133.46 Q1324.74 1133.46 1322.91 1137.02 Q1321.11 1140.56 1321.11 1147.69 Q1321.11 1154.8 1322.91 1158.37 Q1324.74 1161.91 1328.35 1161.91 Q1331.99 1161.91 1333.79 1158.37 Q1335.62 1154.8 1335.62 1147.69 Q1335.62 1140.56 1333.79 1137.02 Q1331.99 1133.46 1328.35 1133.46 M1328.35 1129.75 Q1334.16 1129.75 1337.22 1134.36 Q1340.3 1138.94 1340.3 1147.69 Q1340.3 1156.42 1337.22 1161.03 Q1334.16 1165.61 1328.35 1165.61 Q1322.54 1165.61 1319.46 1161.03 Q1316.41 1156.42 1316.41 1147.69 Q1316.41 1138.94 1319.46 1134.36 Q1322.54 1129.75 1328.35 1129.75 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1847.94 1161 L1855.58 1161 L1855.58 1134.64 L1847.27 1136.31 L1847.27 1132.05 L1855.53 1130.38 L1860.21 1130.38 L1860.21 1161 L1867.85 1161 L1867.85 1164.94 L1847.94 1164.94 L1847.94 1161 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1877.34 1130.38 L1895.7 1130.38 L1895.7 1134.32 L1881.62 1134.32 L1881.62 1142.79 Q1882.64 1142.44 1883.66 1142.28 Q1884.68 1142.09 1885.7 1142.09 Q1891.48 1142.09 1894.86 1145.26 Q1898.24 1148.44 1898.24 1153.85 Q1898.24 1159.43 1894.77 1162.53 Q1891.3 1165.61 1884.98 1165.61 Q1882.8 1165.61 1880.53 1165.24 Q1878.29 1164.87 1875.88 1164.13 L1875.88 1159.43 Q1877.96 1160.56 1880.19 1161.12 Q1882.41 1161.68 1884.89 1161.68 Q1888.89 1161.68 1891.23 1159.57 Q1893.57 1157.46 1893.57 1153.85 Q1893.57 1150.24 1891.23 1148.13 Q1888.89 1146.03 1884.89 1146.03 Q1883.01 1146.03 1881.14 1146.44 Q1879.28 1146.86 1877.34 1147.74 L1877.34 1130.38 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M895.014 1198.08 L895.014 1204.35 Q891.354 1202.6 888.108 1201.74 Q884.861 1200.88 881.837 1200.88 Q876.586 1200.88 873.721 1202.92 Q870.888 1204.96 870.888 1208.71 Q870.888 1211.87 872.766 1213.49 Q874.676 1215.08 879.959 1216.07 L883.842 1216.86 Q891.036 1218.23 894.441 1221.7 Q897.879 1225.14 897.879 1230.93 Q897.879 1237.84 893.232 1241.4 Q888.617 1244.97 879.673 1244.97 Q876.299 1244.97 872.48 1244.2 Q868.692 1243.44 864.618 1241.94 L864.618 1235.32 Q868.533 1237.52 872.289 1238.63 Q876.045 1239.75 879.673 1239.75 Q885.179 1239.75 888.171 1237.58 Q891.163 1235.42 891.163 1231.41 Q891.163 1227.91 888.999 1225.93 Q886.866 1223.96 881.965 1222.97 L878.05 1222.21 Q870.856 1220.78 867.642 1217.72 Q864.427 1214.67 864.427 1209.22 Q864.427 1202.92 868.851 1199.29 Q873.307 1195.66 881.105 1195.66 Q884.447 1195.66 887.917 1196.27 Q891.386 1196.87 895.014 1198.08 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M913.443 1198.27 L913.443 1208.4 L925.506 1208.4 L925.506 1212.95 L913.443 1212.95 L913.443 1232.3 Q913.443 1236.66 914.621 1237.9 Q915.83 1239.14 919.49 1239.14 L925.506 1239.14 L925.506 1244.04 L919.49 1244.04 Q912.711 1244.04 910.133 1241.53 Q907.555 1238.98 907.555 1232.3 L907.555 1212.95 L903.258 1212.95 L903.258 1208.4 L907.555 1208.4 L907.555 1198.27 L913.443 1198.27 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M956.666 1213.81 L956.666 1194.52 L962.523 1194.52 L962.523 1244.04 L956.666 1244.04 L956.666 1238.7 Q954.82 1241.88 951.987 1243.44 Q949.186 1244.97 945.24 1244.97 Q938.779 1244.97 934.704 1239.81 Q930.662 1234.65 930.662 1226.25 Q930.662 1217.85 934.704 1212.69 Q938.779 1207.54 945.24 1207.54 Q949.186 1207.54 951.987 1209.1 Q954.82 1210.62 956.666 1213.81 M936.71 1226.25 Q936.71 1232.71 939.351 1236.4 Q942.025 1240.07 946.672 1240.07 Q951.319 1240.07 953.993 1236.4 Q956.666 1232.71 956.666 1226.25 Q956.666 1219.79 953.993 1216.13 Q951.319 1212.44 946.672 1212.44 Q942.025 1212.44 939.351 1216.13 Q936.71 1219.79 936.71 1226.25 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M988.654 1194.58 Q984.389 1201.9 982.32 1209.06 Q980.251 1216.23 980.251 1223.58 Q980.251 1230.93 982.32 1238.16 Q984.421 1245.35 988.654 1252.64 L983.561 1252.64 Q978.787 1245.16 976.4 1237.93 Q974.045 1230.71 974.045 1223.58 Q974.045 1216.48 976.4 1209.29 Q978.755 1202.09 983.561 1194.58 L988.654 1194.58 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1022.81 1221.76 Q1024.87 1222.46 1026.82 1224.76 Q1028.79 1227.05 1030.76 1231.06 L1037.29 1244.04 L1030.38 1244.04 L1024.3 1231.85 Q1021.95 1227.08 1019.72 1225.52 Q1017.52 1223.96 1013.7 1223.96 L1006.7 1223.96 L1006.7 1244.04 L1000.27 1244.04 L1000.27 1196.52 L1014.79 1196.52 Q1022.93 1196.52 1026.94 1199.93 Q1030.95 1203.34 1030.95 1210.21 Q1030.95 1214.7 1028.85 1217.66 Q1026.78 1220.62 1022.81 1221.76 M1006.7 1201.81 L1006.7 1218.68 L1014.79 1218.68 Q1019.43 1218.68 1021.79 1216.54 Q1024.17 1214.38 1024.17 1210.21 Q1024.17 1206.04 1021.79 1203.94 Q1019.43 1201.81 1014.79 1201.81 L1006.7 1201.81 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1050.97 1238.7 L1050.97 1257.6 L1045.09 1257.6 L1045.09 1208.4 L1050.97 1208.4 L1050.97 1213.81 Q1052.82 1210.62 1055.62 1209.1 Q1058.45 1207.54 1062.37 1207.54 Q1068.86 1207.54 1072.9 1212.69 Q1076.98 1217.85 1076.98 1226.25 Q1076.98 1234.65 1072.9 1239.81 Q1068.86 1244.97 1062.37 1244.97 Q1058.45 1244.97 1055.62 1243.44 Q1052.82 1241.88 1050.97 1238.7 M1070.9 1226.25 Q1070.9 1219.79 1068.23 1216.13 Q1065.58 1212.44 1060.94 1212.44 Q1056.29 1212.44 1053.62 1216.13 Q1050.97 1219.79 1050.97 1226.25 Q1050.97 1232.71 1053.62 1236.4 Q1056.29 1240.07 1060.94 1240.07 Q1065.58 1240.07 1068.23 1236.4 Q1070.9 1232.71 1070.9 1226.25 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1085.76 1194.58 L1090.86 1194.58 Q1095.63 1202.09 1097.98 1209.29 Q1100.37 1216.48 1100.37 1223.58 Q1100.37 1230.71 1097.98 1237.93 Q1095.63 1245.16 1090.86 1252.64 L1085.76 1252.64 Q1090 1245.35 1092.06 1238.16 Q1094.17 1230.93 1094.17 1223.58 Q1094.17 1216.23 1092.06 1209.06 Q1090 1201.9 1085.76 1194.58 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1113.61 1235.96 L1120.33 1235.96 L1120.33 1241.43 L1115.11 1251.62 L1111 1251.62 L1113.61 1241.43 L1113.61 1235.96 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1194.81 1223.13 Q1192.04 1223.13 1190.45 1225.49 Q1188.89 1227.84 1188.89 1232.04 Q1188.89 1236.18 1190.45 1238.57 Q1192.04 1240.92 1194.81 1240.92 Q1197.51 1240.92 1199.07 1238.57 Q1200.66 1236.18 1200.66 1232.04 Q1200.66 1227.87 1199.07 1225.52 Q1197.51 1223.13 1194.81 1223.13 M1194.81 1219.09 Q1199.84 1219.09 1202.8 1222.59 Q1205.76 1226.09 1205.76 1232.04 Q1205.76 1238 1202.76 1241.5 Q1199.8 1244.97 1194.81 1244.97 Q1189.71 1244.97 1186.75 1241.5 Q1183.79 1238 1183.79 1232.04 Q1183.79 1226.06 1186.75 1222.59 Q1189.75 1219.09 1194.81 1219.09 M1161.96 1199.71 Q1159.22 1199.71 1157.63 1202.09 Q1156.07 1204.45 1156.07 1208.59 Q1156.07 1212.79 1157.63 1215.14 Q1159.19 1217.5 1161.96 1217.5 Q1164.73 1217.5 1166.29 1215.14 Q1167.88 1212.79 1167.88 1208.59 Q1167.88 1204.48 1166.29 1202.09 Q1164.7 1199.71 1161.96 1199.71 M1190.7 1195.66 L1195.79 1195.66 L1166.07 1244.97 L1160.97 1244.97 L1190.7 1195.66 M1161.96 1195.66 Q1166.99 1195.66 1169.98 1199.17 Q1172.97 1202.63 1172.97 1208.59 Q1172.97 1214.6 1169.98 1218.07 Q1167.02 1221.54 1161.96 1221.54 Q1156.9 1221.54 1153.94 1218.07 Q1151.01 1214.57 1151.01 1208.59 Q1151.01 1202.67 1153.97 1199.17 Q1156.93 1195.66 1161.96 1195.66 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><polyline clip-path=\"url(#clip242)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 197.427,1106.38 1872.76,1106.38 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip242)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 197.427,778.744 1872.76,778.744 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip242)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 197.427,451.108 1872.76,451.108 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip242)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 197.427,123.472 1872.76,123.472 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 197.427,1106.38 197.427,123.472 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 197.427,1106.38 216.325,1106.38 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 197.427,778.744 216.325,778.744 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 197.427,451.108 216.325,451.108 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 197.427,123.472 216.325,123.472 \n",
" \"/>\n",
"<path clip-path=\"url(#clip240)\" d=\"M156.683 1092.18 Q153.072 1092.18 151.243 1095.74 Q149.438 1099.28 149.438 1106.41 Q149.438 1113.52 151.243 1117.09 Q153.072 1120.63 156.683 1120.63 Q160.317 1120.63 162.123 1117.09 Q163.952 1113.52 163.952 1106.41 Q163.952 1099.28 162.123 1095.74 Q160.317 1092.18 156.683 1092.18 M156.683 1088.47 Q162.493 1088.47 165.549 1093.08 Q168.627 1097.66 168.627 1106.41 Q168.627 1115.14 165.549 1119.75 Q162.493 1124.33 156.683 1124.33 Q150.873 1124.33 147.794 1119.75 Q144.739 1115.14 144.739 1106.41 Q144.739 1097.66 147.794 1093.08 Q150.873 1088.47 156.683 1088.47 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M147.725 761.464 L166.081 761.464 L166.081 765.399 L152.007 765.399 L152.007 773.871 Q153.026 773.524 154.044 773.362 Q155.063 773.177 156.081 773.177 Q161.868 773.177 165.248 776.348 Q168.627 779.519 168.627 784.936 Q168.627 790.515 165.155 793.617 Q161.683 796.695 155.364 796.695 Q153.188 796.695 150.919 796.325 Q148.674 795.954 146.266 795.214 L146.266 790.515 Q148.35 791.649 150.572 792.205 Q152.794 792.76 155.271 792.76 Q159.276 792.76 161.614 790.654 Q163.952 788.547 163.952 784.936 Q163.952 781.325 161.614 779.218 Q159.276 777.112 155.271 777.112 Q153.396 777.112 151.521 777.529 Q149.669 777.945 147.725 778.825 L147.725 761.464 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M117.331 464.453 L124.97 464.453 L124.97 438.087 L116.66 439.754 L116.66 435.495 L124.924 433.828 L129.6 433.828 L129.6 464.453 L137.239 464.453 L137.239 468.388 L117.331 468.388 L117.331 464.453 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M156.683 436.907 Q153.072 436.907 151.243 440.472 Q149.438 444.013 149.438 451.143 Q149.438 458.249 151.243 461.814 Q153.072 465.356 156.683 465.356 Q160.317 465.356 162.123 461.814 Q163.952 458.249 163.952 451.143 Q163.952 444.013 162.123 440.472 Q160.317 436.907 156.683 436.907 M156.683 433.203 Q162.493 433.203 165.549 437.809 Q168.627 442.393 168.627 451.143 Q168.627 459.87 165.549 464.476 Q162.493 469.059 156.683 469.059 Q150.873 469.059 147.794 464.476 Q144.739 459.87 144.739 451.143 Q144.739 442.393 147.794 437.809 Q150.873 433.203 156.683 433.203 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M118.327 136.817 L125.966 136.817 L125.966 110.451 L117.656 112.118 L117.656 107.859 L125.919 106.192 L130.595 106.192 L130.595 136.817 L138.234 136.817 L138.234 140.752 L118.327 140.752 L118.327 136.817 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M147.725 106.192 L166.081 106.192 L166.081 110.127 L152.007 110.127 L152.007 118.599 Q153.026 118.252 154.044 118.09 Q155.063 117.905 156.081 117.905 Q161.868 117.905 165.248 121.076 Q168.627 124.248 168.627 129.664 Q168.627 135.243 165.155 138.345 Q161.683 141.423 155.364 141.423 Q153.188 141.423 150.919 141.053 Q148.674 140.683 146.266 139.942 L146.266 135.243 Q148.35 136.377 150.572 136.933 Q152.794 137.488 155.271 137.488 Q159.276 137.488 161.614 135.382 Q163.952 133.275 163.952 129.664 Q163.952 126.053 161.614 123.947 Q159.276 121.84 155.271 121.84 Q153.396 121.84 151.521 122.257 Q149.669 122.674 147.725 123.553 L147.725 106.192 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M26.0842 725.546 L26.0842 695.5 L31.495 695.5 L31.495 719.117 L45.5632 719.117 L45.5632 696.487 L50.9741 696.487 L50.9741 719.117 L68.1933 719.117 L68.1933 694.927 L73.6042 694.927 L73.6042 725.546 L26.0842 725.546 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M51.3242 661.825 Q52.0244 659.756 54.3161 657.815 Q56.6077 655.842 60.6181 653.868 L73.6042 647.343 L73.6042 654.25 L61.4138 660.329 Q56.6395 662.685 55.08 664.913 Q53.5204 667.109 53.5204 670.928 L53.5204 677.931 L73.6042 677.931 L73.6042 684.36 L26.0842 684.36 L26.0842 669.846 Q26.0842 661.698 29.4898 657.688 Q32.8955 653.677 39.7704 653.677 Q44.2582 653.677 47.2183 655.778 Q50.1784 657.847 51.3242 661.825 M31.3677 677.931 L48.2368 677.931 L48.2368 669.846 Q48.2368 665.199 46.1043 662.844 Q43.94 660.457 39.7704 660.457 Q35.6009 660.457 33.5002 662.844 Q31.3677 665.199 31.3677 669.846 L31.3677 677.931 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M68.257 633.657 L87.1631 633.657 L87.1631 639.545 L37.9562 639.545 L37.9562 633.657 L43.3671 633.657 Q40.1842 631.811 38.6564 629.01 Q37.0968 626.177 37.0968 622.262 Q37.0968 615.769 42.2531 611.727 Q47.4093 607.653 55.812 607.653 Q64.2147 607.653 69.371 611.727 Q74.5272 615.769 74.5272 622.262 Q74.5272 626.177 72.9994 629.01 Q71.4398 631.811 68.257 633.657 M55.812 613.732 Q49.3508 613.732 45.6905 616.406 Q41.9984 619.048 41.9984 623.695 Q41.9984 628.342 45.6905 631.015 Q49.3508 633.657 55.812 633.657 Q62.2732 633.657 65.9653 631.015 Q69.6256 628.342 69.6256 623.695 Q69.6256 619.048 65.9653 616.406 Q62.2732 613.732 55.812 613.732 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M65.5197 596.45 L65.5197 589.734 L70.9942 589.734 L81.1793 594.954 L81.1793 599.059 L70.9942 596.45 L65.5197 596.45 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M52.6928 515.255 Q52.6928 518.024 55.0481 519.615 Q57.4034 521.175 61.6048 521.175 Q65.7425 521.175 68.1296 519.615 Q70.485 518.024 70.485 515.255 Q70.485 512.55 68.1296 510.99 Q65.7425 509.398 61.6048 509.398 Q57.4353 509.398 55.08 510.99 Q52.6928 512.55 52.6928 515.255 M48.6506 515.255 Q48.6506 510.226 52.1517 507.266 Q55.6529 504.306 61.6048 504.306 Q67.5567 504.306 71.0579 507.298 Q74.5272 510.258 74.5272 515.255 Q74.5272 520.347 71.0579 523.308 Q67.5567 526.268 61.6048 526.268 Q55.621 526.268 52.1517 523.308 Q48.6506 520.316 48.6506 515.255 M29.267 548.102 Q29.267 550.839 31.6542 552.431 Q34.0095 553.99 38.1472 553.99 Q42.3485 553.99 44.7038 552.431 Q47.0592 550.871 47.0592 548.102 Q47.0592 545.333 44.7038 543.773 Q42.3485 542.182 38.1472 542.182 Q34.0413 542.182 31.6542 543.773 Q29.267 545.365 29.267 548.102 M25.2248 519.361 L25.2248 514.268 L74.5272 543.996 L74.5272 549.089 L25.2248 519.361 M25.2248 548.102 Q25.2248 543.073 28.7259 540.081 Q32.1952 537.089 38.1472 537.089 Q44.1628 537.089 47.6321 540.081 Q51.1014 543.041 51.1014 548.102 Q51.1014 553.163 47.6321 556.123 Q44.1309 559.051 38.1472 559.051 Q32.2271 559.051 28.7259 556.091 Q25.2248 553.131 25.2248 548.102 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M427.152 12.096 L439.345 12.096 L454.779 53.2532 L470.294 12.096 L482.488 12.096 L482.488 72.576 L474.507 72.576 L474.507 19.4686 L458.911 60.9499 L450.688 60.9499 L435.092 19.4686 L435.092 72.576 L427.152 72.576 L427.152 12.096 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M514.328 72.576 L491.238 12.096 L499.785 12.096 L518.946 63.0159 L538.147 12.096 L546.654 12.096 L523.604 72.576 L514.328 72.576 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M555.485 12.096 L590.242 12.096 L590.242 18.9825 L563.668 18.9825 L563.668 36.8065 L587.649 36.8065 L587.649 43.6931 L563.668 43.6931 L563.668 72.576 L555.485 72.576 L555.485 12.096 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M647.157 9.62495 Q641.729 18.942 639.096 28.0566 Q636.462 37.1711 636.462 46.5287 Q636.462 55.8863 639.096 65.0818 Q641.769 74.2369 647.157 83.5134 L640.675 83.5134 Q634.599 73.9938 631.561 64.7983 Q628.563 55.6027 628.563 46.5287 Q628.563 37.4952 631.561 28.3401 Q634.559 19.1851 640.675 9.62495 L647.157 9.62495 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M699.332 45.1919 L699.332 72.576 L691.879 72.576 L691.879 45.4349 Q691.879 38.994 689.367 35.7938 Q686.856 32.5936 681.833 32.5936 Q675.797 32.5936 672.313 36.4419 Q668.829 40.2903 668.829 46.9338 L668.829 72.576 L661.335 72.576 L661.335 27.2059 L668.829 27.2059 L668.829 34.2544 Q671.503 30.163 675.108 28.1376 Q678.754 26.1121 683.493 26.1121 Q691.312 26.1121 695.322 30.9732 Q699.332 35.7938 699.332 45.1919 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M731.78 32.4315 Q725.785 32.4315 722.301 37.1306 Q718.817 41.7891 718.817 49.9314 Q718.817 58.0738 722.261 62.7728 Q725.744 67.4314 731.78 67.4314 Q737.735 67.4314 741.219 62.7323 Q744.703 58.0333 744.703 49.9314 Q744.703 41.8701 741.219 37.1711 Q737.735 32.4315 731.78 32.4315 M731.78 26.1121 Q741.502 26.1121 747.052 32.4315 Q752.602 38.7509 752.602 49.9314 Q752.602 61.0714 747.052 67.4314 Q741.502 73.7508 731.78 73.7508 Q722.018 73.7508 716.468 67.4314 Q710.959 61.0714 710.959 49.9314 Q710.959 38.7509 716.468 32.4315 Q722.018 26.1121 731.78 26.1121 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M798.539 65.7705 L798.539 89.8329 L791.045 89.8329 L791.045 27.2059 L798.539 27.2059 L798.539 34.0924 Q800.889 30.0415 804.453 28.0971 Q808.059 26.1121 813.041 26.1121 Q821.305 26.1121 826.45 32.6746 Q831.635 39.2371 831.635 49.9314 Q831.635 60.6258 826.45 67.1883 Q821.305 73.7508 813.041 73.7508 Q808.059 73.7508 804.453 71.8063 Q800.889 69.8214 798.539 65.7705 M823.898 49.9314 Q823.898 41.7081 820.495 37.0496 Q817.133 32.3505 811.218 32.3505 Q805.304 32.3505 801.901 37.0496 Q798.539 41.7081 798.539 49.9314 Q798.539 58.1548 801.901 62.8538 Q805.304 67.5124 811.218 67.5124 Q817.133 67.5124 820.495 62.8538 Q823.898 58.1548 823.898 49.9314 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M861.571 32.4315 Q855.576 32.4315 852.092 37.1306 Q848.608 41.7891 848.608 49.9314 Q848.608 58.0738 852.052 62.7728 Q855.535 67.4314 861.571 67.4314 Q867.526 67.4314 871.01 62.7323 Q874.494 58.0333 874.494 49.9314 Q874.494 41.8701 871.01 37.1711 Q867.526 32.4315 861.571 32.4315 M861.571 26.1121 Q871.293 26.1121 876.843 32.4315 Q882.393 38.7509 882.393 49.9314 Q882.393 61.0714 876.843 67.4314 Q871.293 73.7508 861.571 73.7508 Q851.809 73.7508 846.259 67.4314 Q840.75 61.0714 840.75 49.9314 Q840.75 38.7509 846.259 32.4315 Q851.809 26.1121 861.571 26.1121 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M921.038 34.1734 Q919.783 33.4443 918.284 33.1202 Q916.826 32.7556 915.043 32.7556 Q908.724 32.7556 905.321 36.8875 Q901.959 40.9789 901.959 48.6757 L901.959 72.576 L894.465 72.576 L894.465 27.2059 L901.959 27.2059 L901.959 34.2544 Q904.308 30.1225 908.076 28.1376 Q911.843 26.1121 917.231 26.1121 Q918 26.1121 918.932 26.2337 Q919.864 26.3147 920.998 26.5172 L921.038 34.1734 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M936.229 14.324 L936.229 27.2059 L951.582 27.2059 L951.582 32.9987 L936.229 32.9987 L936.229 57.6282 Q936.229 63.1779 937.728 64.7578 Q939.268 66.3376 943.926 66.3376 L951.582 66.3376 L951.582 72.576 L943.926 72.576 Q935.298 72.576 932.016 69.3758 Q928.735 66.1351 928.735 57.6282 L928.735 32.9987 L923.266 32.9987 L923.266 27.2059 L928.735 27.2059 L928.735 14.324 L936.229 14.324 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M984.354 9.54393 L984.354 15.7418 L977.225 15.7418 Q973.214 15.7418 971.634 17.3622 Q970.095 18.9825 970.095 23.1955 L970.095 27.2059 L982.369 27.2059 L982.369 32.9987 L970.095 32.9987 L970.095 72.576 L962.601 72.576 L962.601 32.9987 L955.471 32.9987 L955.471 27.2059 L962.601 27.2059 L962.601 24.0462 Q962.601 16.471 966.125 13.0277 Q969.649 9.54393 977.306 9.54393 L984.354 9.54393 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1008.17 32.4315 Q1002.18 32.4315 998.694 37.1306 Q995.211 41.7891 995.211 49.9314 Q995.211 58.0738 998.654 62.7728 Q1002.14 67.4314 1008.17 67.4314 Q1014.13 67.4314 1017.61 62.7323 Q1021.1 58.0333 1021.1 49.9314 Q1021.1 41.8701 1017.61 37.1711 Q1014.13 32.4315 1008.17 32.4315 M1008.17 26.1121 Q1017.9 26.1121 1023.45 32.4315 Q1029 38.7509 1029 49.9314 Q1029 61.0714 1023.45 67.4314 Q1017.9 73.7508 1008.17 73.7508 Q998.411 73.7508 992.861 67.4314 Q987.352 61.0714 987.352 49.9314 Q987.352 38.7509 992.861 32.4315 Q998.411 26.1121 1008.17 26.1121 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1041.35 9.54393 L1048.8 9.54393 L1048.8 72.576 L1041.35 72.576 L1041.35 9.54393 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1064.4 27.2059 L1071.85 27.2059 L1071.85 72.576 L1064.4 72.576 L1064.4 27.2059 M1064.4 9.54393 L1071.85 9.54393 L1071.85 18.9825 L1064.4 18.9825 L1064.4 9.54393 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1105.03 32.4315 Q1099.04 32.4315 1095.55 37.1306 Q1092.07 41.7891 1092.07 49.9314 Q1092.07 58.0738 1095.51 62.7728 Q1098.99 67.4314 1105.03 67.4314 Q1110.99 67.4314 1114.47 62.7323 Q1117.95 58.0333 1117.95 49.9314 Q1117.95 41.8701 1114.47 37.1711 Q1110.99 32.4315 1105.03 32.4315 M1105.03 26.1121 Q1114.75 26.1121 1120.3 32.4315 Q1125.85 38.7509 1125.85 49.9314 Q1125.85 61.0714 1120.3 67.4314 Q1114.75 73.7508 1105.03 73.7508 Q1095.27 73.7508 1089.72 67.4314 Q1084.21 61.0714 1084.21 49.9314 Q1084.21 38.7509 1089.72 32.4315 Q1095.27 26.1121 1105.03 26.1121 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1197.23 28.9478 L1197.23 35.9153 Q1194.07 34.1734 1190.87 33.3227 Q1187.71 32.4315 1184.47 32.4315 Q1177.22 32.4315 1173.21 37.0496 Q1169.2 41.6271 1169.2 49.9314 Q1169.2 58.2358 1173.21 62.8538 Q1177.22 67.4314 1184.47 67.4314 Q1187.71 67.4314 1190.87 66.5807 Q1194.07 65.6895 1197.23 63.9476 L1197.23 70.8341 Q1194.11 72.2924 1190.75 73.0216 Q1187.43 73.7508 1183.66 73.7508 Q1173.41 73.7508 1167.37 67.3098 Q1161.34 60.8689 1161.34 49.9314 Q1161.34 38.832 1167.41 32.472 Q1173.53 26.1121 1184.14 26.1121 Q1187.59 26.1121 1190.87 26.8413 Q1194.15 27.5299 1197.23 28.9478 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1227.77 32.4315 Q1221.78 32.4315 1218.29 37.1306 Q1214.81 41.7891 1214.81 49.9314 Q1214.81 58.0738 1218.25 62.7728 Q1221.74 67.4314 1227.77 67.4314 Q1233.73 67.4314 1237.21 62.7323 Q1240.7 58.0333 1240.7 49.9314 Q1240.7 41.8701 1237.21 37.1711 Q1233.73 32.4315 1227.77 32.4315 M1227.77 26.1121 Q1237.5 26.1121 1243.04 32.4315 Q1248.59 38.7509 1248.59 49.9314 Q1248.59 61.0714 1243.04 67.4314 Q1237.5 73.7508 1227.77 73.7508 Q1218.01 73.7508 1212.46 67.4314 Q1206.95 61.0714 1206.95 49.9314 Q1206.95 38.7509 1212.46 32.4315 Q1218.01 26.1121 1227.77 26.1121 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1298.66 45.1919 L1298.66 72.576 L1291.21 72.576 L1291.21 45.4349 Q1291.21 38.994 1288.7 35.7938 Q1286.19 32.5936 1281.16 32.5936 Q1275.13 32.5936 1271.64 36.4419 Q1268.16 40.2903 1268.16 46.9338 L1268.16 72.576 L1260.67 72.576 L1260.67 27.2059 L1268.16 27.2059 L1268.16 34.2544 Q1270.83 30.163 1274.44 28.1376 Q1278.09 26.1121 1282.82 26.1121 Q1290.64 26.1121 1294.65 30.9732 Q1298.66 35.7938 1298.66 45.1919 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1342.45 28.5427 L1342.45 35.5912 Q1339.29 33.9709 1335.89 33.1607 Q1332.49 32.3505 1328.84 32.3505 Q1323.29 32.3505 1320.5 34.0519 Q1317.74 35.7533 1317.74 39.156 Q1317.74 41.7486 1319.73 43.2475 Q1321.71 44.7058 1327.71 46.0426 L1330.26 46.6097 Q1338.2 48.3111 1341.52 51.4303 Q1344.88 54.509 1344.88 60.0587 Q1344.88 66.3781 1339.86 70.0644 Q1334.88 73.7508 1326.13 73.7508 Q1322.48 73.7508 1318.51 73.0216 Q1314.58 72.3329 1310.21 70.9151 L1310.21 63.2184 Q1314.34 65.3654 1318.35 66.4591 Q1322.36 67.5124 1326.29 67.5124 Q1331.56 67.5124 1334.39 65.73 Q1337.23 63.9071 1337.23 60.6258 Q1337.23 57.5877 1335.16 55.9673 Q1333.14 54.3469 1326.21 52.8481 L1323.62 52.2405 Q1316.69 50.7821 1313.61 47.7845 Q1310.53 44.7463 1310.53 39.4801 Q1310.53 33.0797 1315.07 29.5959 Q1319.61 26.1121 1327.95 26.1121 Q1332.08 26.1121 1335.73 26.7198 Q1339.38 27.3274 1342.45 28.5427 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1364.13 14.324 L1364.13 27.2059 L1379.48 27.2059 L1379.48 32.9987 L1364.13 32.9987 L1364.13 57.6282 Q1364.13 63.1779 1365.63 64.7578 Q1367.16 66.3376 1371.82 66.3376 L1379.48 66.3376 L1379.48 72.576 L1371.82 72.576 Q1363.19 72.576 1359.91 69.3758 Q1356.63 66.1351 1356.63 57.6282 L1356.63 32.9987 L1351.16 32.9987 L1351.16 27.2059 L1356.63 27.2059 L1356.63 14.324 L1364.13 14.324 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1415.57 34.1734 Q1414.32 33.4443 1412.82 33.1202 Q1411.36 32.7556 1409.58 32.7556 Q1403.26 32.7556 1399.86 36.8875 Q1396.49 40.9789 1396.49 48.6757 L1396.49 72.576 L1389 72.576 L1389 27.2059 L1396.49 27.2059 L1396.49 34.2544 Q1398.84 30.1225 1402.61 28.1376 Q1406.38 26.1121 1411.77 26.1121 Q1412.53 26.1121 1413.47 26.2337 Q1414.4 26.3147 1415.53 26.5172 L1415.57 34.1734 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1444.01 49.7694 Q1434.98 49.7694 1431.49 51.8354 Q1428.01 53.9013 1428.01 58.8839 Q1428.01 62.8538 1430.6 65.2034 Q1433.23 67.5124 1437.73 67.5124 Q1443.93 67.5124 1447.66 63.1374 Q1451.42 58.7219 1451.42 51.4303 L1451.42 49.7694 L1444.01 49.7694 M1458.88 46.6907 L1458.88 72.576 L1451.42 72.576 L1451.42 65.6895 Q1448.87 69.8214 1445.06 71.8063 Q1441.26 73.7508 1435.75 73.7508 Q1428.78 73.7508 1424.65 69.8619 Q1420.56 65.9325 1420.56 59.3701 Q1420.56 51.7138 1425.66 47.825 Q1430.8 43.9361 1440.97 43.9361 L1451.42 43.9361 L1451.42 43.2069 Q1451.42 38.0623 1448.02 35.2672 Q1444.66 32.4315 1438.54 32.4315 Q1434.65 32.4315 1430.97 33.3632 Q1427.28 34.295 1423.88 36.1584 L1423.88 29.2718 Q1427.97 27.692 1431.82 26.9223 Q1435.67 26.1121 1439.31 26.1121 Q1449.15 26.1121 1454.02 31.2163 Q1458.88 36.3204 1458.88 46.6907 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1474.23 27.2059 L1481.68 27.2059 L1481.68 72.576 L1474.23 72.576 L1474.23 27.2059 M1474.23 9.54393 L1481.68 9.54393 L1481.68 18.9825 L1474.23 18.9825 L1474.23 9.54393 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1534.99 45.1919 L1534.99 72.576 L1527.54 72.576 L1527.54 45.4349 Q1527.54 38.994 1525.03 35.7938 Q1522.52 32.5936 1517.49 32.5936 Q1511.46 32.5936 1507.97 36.4419 Q1504.49 40.2903 1504.49 46.9338 L1504.49 72.576 L1497 72.576 L1497 27.2059 L1504.49 27.2059 L1504.49 34.2544 Q1507.16 30.163 1510.77 28.1376 Q1514.41 26.1121 1519.15 26.1121 Q1526.97 26.1121 1530.98 30.9732 Q1534.99 35.7938 1534.99 45.1919 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1557.23 14.324 L1557.23 27.2059 L1572.59 27.2059 L1572.59 32.9987 L1557.23 32.9987 L1557.23 57.6282 Q1557.23 63.1779 1558.73 64.7578 Q1560.27 66.3376 1564.93 66.3376 L1572.59 66.3376 L1572.59 72.576 L1564.93 72.576 Q1556.3 72.576 1553.02 69.3758 Q1549.74 66.1351 1549.74 57.6282 L1549.74 32.9987 L1544.27 32.9987 L1544.27 27.2059 L1549.74 27.2059 L1549.74 14.324 L1557.23 14.324 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1611.31 28.5427 L1611.31 35.5912 Q1608.15 33.9709 1604.75 33.1607 Q1601.35 32.3505 1597.7 32.3505 Q1592.15 32.3505 1589.36 34.0519 Q1586.6 35.7533 1586.6 39.156 Q1586.6 41.7486 1588.59 43.2475 Q1590.57 44.7058 1596.57 46.0426 L1599.12 46.6097 Q1607.06 48.3111 1610.38 51.4303 Q1613.74 54.509 1613.74 60.0587 Q1613.74 66.3781 1608.72 70.0644 Q1603.74 73.7508 1594.99 73.7508 Q1591.34 73.7508 1587.37 73.0216 Q1583.44 72.3329 1579.07 70.9151 L1579.07 63.2184 Q1583.2 65.3654 1587.21 66.4591 Q1591.22 67.5124 1595.15 67.5124 Q1600.42 67.5124 1603.25 65.73 Q1606.09 63.9071 1606.09 60.6258 Q1606.09 57.5877 1604.02 55.9673 Q1602 54.3469 1595.07 52.8481 L1592.48 52.2405 Q1585.55 50.7821 1582.47 47.7845 Q1579.39 44.7463 1579.39 39.4801 Q1579.39 33.0797 1583.93 29.5959 Q1588.47 26.1121 1596.81 26.1121 Q1600.94 26.1121 1604.59 26.7198 Q1608.23 27.3274 1611.31 28.5427 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M1624.44 9.62495 L1630.92 9.62495 Q1637 19.1851 1639.99 28.3401 Q1643.03 37.4952 1643.03 46.5287 Q1643.03 55.6027 1639.99 64.7983 Q1637 73.9938 1630.92 83.5134 L1624.44 83.5134 Q1629.83 74.2369 1632.46 65.0818 Q1635.13 55.8863 1635.13 46.5287 Q1635.13 37.1711 1632.46 28.0566 Q1629.83 18.942 1624.44 9.62495 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><polyline clip-path=\"url(#clip242)\" style=\"stroke:#ff0000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:8; stroke-opacity:1; fill:none\" points=\"\n",
" 1425.43,844.271 1414.49,840.667 1403.6,837.063 1392.77,833.459 1381.99,829.855 1371.26,826.251 1360.59,822.647 1349.99,819.043 1339.44,815.439 1328.95,811.835 \n",
" 1318.53,808.231 1308.17,804.627 1297.88,801.023 1287.66,797.419 1277.52,793.815 1267.44,790.211 1257.44,786.607 1247.52,783.003 1237.68,779.399 1227.92,775.795 \n",
" 1218.25,772.191 1208.66,768.587 1199.17,764.983 1189.76,761.379 1180.45,757.775 1171.24,754.171 1162.12,750.567 1153.12,746.963 1144.21,743.359 1135.42,739.755 \n",
" 1126.74,736.151 1118.17,732.547 1109.72,728.943 1101.4,725.339 1093.19,721.735 1085.12,718.131 1077.18,714.527 1069.38,710.923 1061.72,707.319 1054.2,703.715 \n",
" 1046.82,700.111 1039.6,696.507 1032.54,692.903 1025.63,689.299 1018.88,685.695 1012.31,682.091 1005.9,678.487 999.669,674.883 993.618,671.279 987.75,667.675 \n",
" 982.069,664.071 976.58,660.467 971.287,656.863 966.194,653.259 961.305,649.655 956.623,646.051 952.154,642.447 947.899,638.843 943.864,635.239 940.051,631.635 \n",
" 936.465,628.031 933.108,624.427 929.983,620.823 927.094,617.219 924.444,613.615 922.034,610.011 919.868,606.407 917.948,602.803 916.275,599.199 914.851,595.595 \n",
" 913.678,591.991 912.758,588.387 912.09,584.783 911.676,581.179 911.516,577.575 911.61,573.971 911.959,570.368 912.562,566.764 913.417,563.16 914.525,559.556 \n",
" 915.885,555.952 917.493,552.348 919.35,548.744 921.454,545.14 923.801,541.536 926.389,537.932 929.217,534.328 932.281,530.724 935.579,527.12 939.107,523.516 \n",
" 942.861,519.912 946.84,516.308 951.038,512.704 955.453,509.1 960.08,505.496 964.917,501.892 969.958,498.288 975.2,494.684 980.639,491.08 986.27,487.476 \n",
" 992.09,483.872 998.095,480.268 1004.28,476.664 1010.64,473.06 1017.18,469.456 1023.88,465.852 1030.74,462.248 1037.77,458.644 1044.95,455.04 1052.29,451.436 \n",
" 1059.77,447.832 1067.4,444.228 1075.16,440.624 1083.07,437.02 1091.11,433.416 1099.27,429.812 1107.57,426.208 1115.98,422.604 1124.52,419 1133.17,415.396 \n",
" 1141.94,411.792 1150.81,408.188 1159.8,404.584 1168.88,400.98 1178.07,397.376 1187.36,393.772 1196.74,390.168 1206.21,386.564 1215.77,382.96 1225.43,379.356 \n",
" 1235.16,375.752 1244.98,372.148 1254.88,368.544 1264.86,364.94 1274.92,361.336 1285.05,357.732 1295.25,354.128 1305.52,350.524 1315.86,346.92 1326.26,343.316 \n",
" 1336.73,339.712 1347.27,336.108 1357.86,332.504 1368.51,328.9 1379.22,325.296 1389.99,321.692 1400.81,318.088 1411.68,314.484 1422.61,310.88 1433.59,307.276 \n",
" 1444.61,303.672 1455.68,300.068 1466.8,296.464 1477.97,292.86 1489.18,289.256 1500.43,285.652 1511.72,282.048 1523.06,278.444 1534.43,274.84 1545.84,271.236 \n",
" 1557.29,267.632 1568.78,264.028 1580.31,260.424 1591.86,256.82 1603.46,253.216 1615.08,249.612 1626.74,246.008 1638.43,242.404 1650.15,238.8 1661.9,235.196 \n",
" 1673.69,231.592 1685.5,227.988 1697.33,224.384 1709.2,220.78 1721.09,217.176 1733.01,213.572 1744.95,209.968 1756.92,206.364 1768.91,202.76 1780.93,199.156 \n",
" 1792.97,195.552 1805.04,191.948 1817.12,188.344 1829.23,184.74 1841.36,181.136 1853.51,177.532 1865.68,173.928 1877.87,170.324 1890.08,166.72 1902.3,163.116 \n",
" 1914.55,159.512 1926.82,155.908 1939.1,152.304 1951.4,148.7 1963.72,145.096 1976.05,141.492 1988.4,137.888 2000.77,134.284 2013.16,130.68 2025.55,127.076 \n",
" 2037.97,123.472 \n",
" \"/>\n",
"<circle clip-path=\"url(#clip242)\" cx=\"1636.43\" cy=\"352.817\" r=\"14\" fill=\"#ff0000\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"2.56\"/>\n",
"<circle clip-path=\"url(#clip242)\" cx=\"1090.94\" cy=\"483.872\" r=\"14\" fill=\"#ff0000\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"2.56\"/>\n",
"<circle clip-path=\"url(#clip242)\" cx=\"1314.31\" cy=\"713.217\" r=\"14\" fill=\"#ff0000\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"2.56\"/>\n",
"<path clip-path=\"url(#clip240)\" d=\"\n",
"M253.272 311.756 L585.159 311.756 L585.159 156.236 L253.272 156.236 Z\n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 253.272,311.756 585.159,311.756 585.159,156.236 253.272,156.236 253.272,311.756 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip240)\" style=\"stroke:#ff0000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 271.887,208.076 383.575,208.076 \n",
" \"/>\n",
"<path clip-path=\"url(#clip240)\" d=\"M402.19 190.796 L409.157 190.796 L417.977 214.314 L426.842 190.796 L433.81 190.796 L433.81 225.356 L429.25 225.356 L429.25 195.009 L420.338 218.712 L415.639 218.712 L406.727 195.009 L406.727 225.356 L402.19 225.356 L402.19 190.796 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M452.004 225.356 L438.81 190.796 L443.694 190.796 L454.643 219.893 L465.615 190.796 L470.477 190.796 L457.305 225.356 L452.004 225.356 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M475.523 190.796 L495.384 190.796 L495.384 194.731 L480.199 194.731 L480.199 204.916 L493.902 204.916 L493.902 208.851 L480.199 208.851 L480.199 225.356 L475.523 225.356 L475.523 190.796 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><circle clip-path=\"url(#clip240)\" cx=\"327.731\" cy=\"259.916\" r=\"23\" fill=\"#ff0000\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"4.096\"/>\n",
"<path clip-path=\"url(#clip240)\" d=\"M415.593 264.163 Q410.431 264.163 408.44 265.344 Q406.449 266.524 406.449 269.372 Q406.449 271.64 407.931 272.983 Q409.435 274.302 412.005 274.302 Q415.546 274.302 417.676 271.802 Q419.829 269.279 419.829 265.112 L419.829 264.163 L415.593 264.163 M424.088 262.404 L424.088 277.196 L419.829 277.196 L419.829 273.261 Q418.37 275.622 416.194 276.756 Q414.018 277.867 410.87 277.867 Q406.889 277.867 404.528 275.645 Q402.19 273.399 402.19 269.649 Q402.19 265.274 405.106 263.052 Q408.046 260.83 413.856 260.83 L419.829 260.83 L419.829 260.413 Q419.829 257.474 417.884 255.876 Q415.963 254.256 412.468 254.256 Q410.245 254.256 408.139 254.788 Q406.032 255.321 404.088 256.386 L404.088 252.45 Q406.426 251.548 408.625 251.108 Q410.824 250.645 412.907 250.645 Q418.532 250.645 421.31 253.562 Q424.088 256.478 424.088 262.404 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M449.389 252.034 L449.389 256.062 Q447.583 255.136 445.639 254.673 Q443.694 254.21 441.611 254.21 Q438.44 254.21 436.842 255.182 Q435.268 256.154 435.268 258.099 Q435.268 259.58 436.403 260.437 Q437.537 261.27 440.963 262.034 L442.421 262.358 Q446.958 263.33 448.856 265.112 Q450.778 266.872 450.778 270.043 Q450.778 273.654 447.907 275.761 Q445.06 277.867 440.06 277.867 Q437.977 277.867 435.708 277.45 Q433.463 277.057 430.963 276.247 L430.963 271.849 Q433.324 273.075 435.616 273.7 Q437.907 274.302 440.153 274.302 Q443.162 274.302 444.782 273.284 Q446.403 272.242 446.403 270.367 Q446.403 268.631 445.222 267.705 Q444.065 266.779 440.106 265.923 L438.625 265.575 Q434.667 264.742 432.907 263.029 Q431.148 261.293 431.148 258.284 Q431.148 254.626 433.741 252.636 Q436.333 250.645 441.102 250.645 Q443.463 250.645 445.546 250.992 Q447.629 251.339 449.389 252.034 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M474.088 252.034 L474.088 256.062 Q472.282 255.136 470.338 254.673 Q468.393 254.21 466.31 254.21 Q463.139 254.21 461.541 255.182 Q459.967 256.154 459.967 258.099 Q459.967 259.58 461.102 260.437 Q462.236 261.27 465.662 262.034 L467.12 262.358 Q471.657 263.33 473.555 265.112 Q475.476 266.872 475.476 270.043 Q475.476 273.654 472.606 275.761 Q469.759 277.867 464.759 277.867 Q462.676 277.867 460.407 277.45 Q458.162 277.057 455.662 276.247 L455.662 271.849 Q458.023 273.075 460.315 273.7 Q462.606 274.302 464.852 274.302 Q467.861 274.302 469.481 273.284 Q471.102 272.242 471.102 270.367 Q471.102 268.631 469.921 267.705 Q468.764 266.779 464.805 265.923 L463.324 265.575 Q459.365 264.742 457.606 263.029 Q455.847 261.293 455.847 258.284 Q455.847 254.626 458.44 252.636 Q461.032 250.645 465.801 250.645 Q468.162 250.645 470.245 250.992 Q472.328 251.339 474.088 252.034 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M504.435 263.168 L504.435 265.251 L484.851 265.251 Q485.129 269.649 487.49 271.964 Q489.875 274.256 494.111 274.256 Q496.564 274.256 498.856 273.654 Q501.171 273.052 503.439 271.849 L503.439 275.876 Q501.148 276.848 498.74 277.358 Q496.333 277.867 493.856 277.867 Q487.652 277.867 484.018 274.256 Q480.407 270.645 480.407 264.487 Q480.407 258.122 483.833 254.395 Q487.282 250.645 493.115 250.645 Q498.347 250.645 501.379 254.025 Q504.435 257.381 504.435 263.168 M500.175 261.918 Q500.129 258.423 498.208 256.339 Q496.31 254.256 493.162 254.256 Q489.597 254.256 487.444 256.27 Q485.314 258.284 484.99 261.941 L500.175 261.918 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M515.638 243.909 L515.638 251.27 L524.411 251.27 L524.411 254.58 L515.638 254.58 L515.638 268.654 Q515.638 271.825 516.495 272.728 Q517.374 273.631 520.036 273.631 L524.411 273.631 L524.411 277.196 L520.036 277.196 Q515.106 277.196 513.231 275.367 Q511.356 273.515 511.356 268.654 L511.356 254.58 L508.231 254.58 L508.231 251.27 L511.356 251.27 L511.356 243.909 L515.638 243.909 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip240)\" d=\"M546.541 252.034 L546.541 256.062 Q544.735 255.136 542.791 254.673 Q540.847 254.21 538.763 254.21 Q535.592 254.21 533.995 255.182 Q532.421 256.154 532.421 258.099 Q532.421 259.58 533.555 260.437 Q534.689 261.27 538.115 262.034 L539.573 262.358 Q544.11 263.33 546.009 265.112 Q547.93 266.872 547.93 270.043 Q547.93 273.654 545.059 275.761 Q542.212 277.867 537.212 277.867 Q535.129 277.867 532.86 277.45 Q530.615 277.057 528.115 276.247 L528.115 271.849 Q530.476 273.075 532.768 273.7 Q535.059 274.302 537.305 274.302 Q540.314 274.302 541.934 273.284 Q543.555 272.242 543.555 270.367 Q543.555 268.631 542.374 267.705 Q541.217 266.779 537.259 265.923 L535.777 265.575 Q531.819 264.742 530.06 263.029 Q528.3 261.293 528.3 258.284 Q528.3 254.626 530.893 252.636 Q533.485 250.645 538.254 250.645 Q540.615 250.645 542.698 250.992 Q544.782 251.339 546.541 252.034 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /></svg>\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"μstar_range = range(0.04,0.15,length=201)\n",
"L = length(μstar_range)\n",
"\n",
"StdRp = fill(NaN,L)\n",
"for i = 1:L\n",
" StdRp[i] = MVCalc(μstar_range[i],μ,Σ)[1]\n",
"end\n",
"\n",
"p1 = plot( StdRp*100,μstar_range*100,\n",
" linecolor = :red,\n",
" linewidth = 2,\n",
" label = \"MVF\",\n",
" legend = :topleft,\n",
" xlim = (0,15),\n",
" ylim = (0,15),\n",
" title = \"MVF (no portfolio constraints)\",\n",
" xlabel = \"Std(Rp), %\",\n",
" ylabel = \"ERp, %\" )\n",
"scatter!(sqrt.(diag(Σ))*100,μ*100,color=:red,label=\"assets\")\n",
"display(p1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# The Maximization Problem\n",
"\n",
"The investor maximizes:\n",
"\n",
"$\\text{E}R_{p}-\\frac{k}{2} \\text{Var}(R_{p})$,\n",
"\n",
"where $\\text{E}R_{p}= w'\\mu$ and $\\text{Var}(R_{p}=w'\\Sigma w$\n",
"\n",
"subject to $\\Sigma_{i=1}^n w_{i} = 1$.\n",
"\n",
"We can trace out the mean-variance frontier by solving this problem for different values of $k$.\n",
"\n",
"To impose the restriction, optimise over `v` and let `w=[v;1-sum(v)]`"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"objfun1 (generic function with 1 method)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function objfun1(v,k,μ,Σ)\n",
" w = [v;1-sum(v)]\n",
" ERp = w'μ\n",
" VarRp = w'Σ*w\n",
" StdRp = sqrt(VarRp)\n",
" U = ERp - k/2*VarRp\n",
" loss = -U #minimise this\n",
" return loss, w, ERp, StdRp\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"A 0.313\n",
"B 0.695\n",
"C -0.008\n",
"\n",
"σₚ 0.079\n",
"μₚ 0.102\n",
"\n"
]
}
],
"source": [
"k = 10\n",
"Sol = optimize(v -> objfun1(v,k,μ,Σ)[1],zeros(n-1))\n",
"\n",
"v = Optim.minimizer(Sol)\n",
"(_,w,ERp,StdRp) = objfun1(v,k,μ,Σ)\n",
"\n",
"printmat(w,rowNames=assetNames)\n",
"printmat([StdRp,ERp],rowNames=[\"σₚ\",\"μₚ\"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 1\n",
"\n",
"Redo the optimisation for the following range of $k$ values:\n",
"`k = [range(0.1,1.9,length=30);range(1,30,length=25)]`\n",
"\n",
"Then plot the resulting \"efficient frontier\" (similar to the MV plot above). Is is the same as the plot above?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 2\n",
"\n",
"Change the optimisation problem to `U = ERp + cost - k/2*VarRp` where `cost` is (sum of the *negative* portfolio weights)*0.05. This is a (crude/dramatic) attaempt to illustrate the impact of costs of short selling ($w_i<0$) assets. Plot the new \"effecient frontier\" together with the old one."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 3\n",
"\n",
"Compare the portfolio weights (with/without the extra `cost`)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Julia 1.6.3",
"language": "julia",
"name": "julia-1.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}