HSG-MCS-HS21_Julia/Problemsets/PS04_YieldToMaturity.ipynb
2021-11-15 21:14:51 +01:00

259 lines
48 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"printyellow (generic function with 1 method)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using Printf, Roots\n",
"\n",
"include(\"jlFiles/printmat.jl\")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"using Plots\n",
"\n",
"#pyplot(size=(600,400))\n",
"gr(size=(480,320))\n",
"default(fmt = :svg)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"# Yield to Maturity"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The yield to maturity (ytm) is the $\\theta$ that solves\n",
"\n",
"$P = \\sum_{k=1}^{K} \\frac{cf_{k}}{(1+\\theta) ^{m_{k}}}$,\n",
"\n",
"where $cf_k$ is the cash flow from the bond (portfolio) $k$ periods ahead and $P$ is the current price of the bond (portfolio).\n",
"\n",
"We typically have to find $\\theta$ by a numerical method."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 1\n",
"\n",
"Starting by coding a function that calculates a price of the bond as a function of the cash flows ($cf$, a vector), times to the cash flows ($k$, also a vector) and the discount rate ($\\theta$, a single number).\n",
"\n",
"Assume that the bond portfolio pays 0.2 each year for 10 years (1 year from now, 2 years from now,...). (It pays no face value. This is an annuity.) \n",
"\n",
"(1) What is a fair price if the discount rate $\\theta$ is 0.05?\n",
"(2) Plot the fair price as a function of $\\theta$ (use θ = -0.02:0.005:0.1)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(1) Price at θ=0.05: 1.544\n"
]
},
{
"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=\"clip170\">\n <rect x=\"0\" y=\"0\" width=\"1920\" height=\"1280\"/>\n </clipPath>\n</defs>\n<path clip-path=\"url(#clip170)\" d=\"\nM0 1280 L1920 1280 L1920 0 L0 0 Z\n \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n<defs>\n <clipPath id=\"clip171\">\n <rect x=\"384\" y=\"0\" width=\"1345\" height=\"1280\"/>\n </clipPath>\n</defs>\n<path clip-path=\"url(#clip170)\" d=\"\nM181.127 1106.38 L1872.76 1106.38 L1872.76 123.472 L181.127 123.472 Z\n \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n<defs>\n <clipPath id=\"clip172\">\n <rect x=\"181\" y=\"123\" width=\"1693\" height=\"984\"/>\n </clipPath>\n</defs>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 494.982,1106.38 494.982,123.472 \n \"/>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 827.457,1106.38 827.457,123.472 \n \"/>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 1159.93,1106.38 1159.93,123.472 \n \"/>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 1492.41,1106.38 1492.41,123.472 \n \"/>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 1824.88,1106.38 1824.88,123.472 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 181.127,1106.38 1872.76,1106.38 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 494.982,1106.38 494.982,1087.48 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 827.457,1106.38 827.457,1087.48 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 1159.93,1106.38 1159.93,1087.48 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 1492.41,1106.38 1492.41,1087.48 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 1824.88,1106.38 1824.88,1087.48 \n \"/>\n<path clip-path=\"url(#clip170)\" d=\"M442.205 1131.73 Q438.594 1131.73 436.765 1135.3 Q434.96 1138.84 434.96 1145.97 Q434.96 1153.07 436.765 1156.64 Q438.594 1160.18 442.205 1160.18 Q445.839 1160.18 447.645 1156.64 Q449.473 1153.07 449.473 1145.97 Q449.473 1138.84 447.645 1135.3 Q445.839 1131.73 442.205 1131.73 M442.205 1128.03 Q448.015 1128.03 451.071 1132.63 Q454.149 1137.22 454.149 1145.97 Q454.149 1154.69 451.071 1159.3 Q448.015 1163.88 442.205 1163.88 Q436.395 1163.88 433.316 1159.3 Q430.261 1154.69 430.261 1145.97 Q430.261 1137.22 433.316 1132.63 Q436.395 1128.03 442.205 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M462.367 1157.33 L467.251 1157.33 L467.251 1163.21 L462.367 1163.21 L462.367 1157.33 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M487.436 1131.73 Q483.825 1131.73 481.996 1135.3 Q480.191 1138.84 480.191 1145.97 Q480.191 1153.07 481.996 1156.64 Q483.825 1160.18 487.436 1160.18 Q491.07 1160.18 492.876 1156.64 Q494.705 1153.07 494.705 1145.97 Q494.705 1138.84 492.876 1135.3 Q491.07 1131.73 487.436 1131.73 M487.436 1128.03 Q493.246 1128.03 496.302 1132.63 Q499.381 1137.22 499.381 1145.97 Q499.381 1154.69 496.302 1159.3 Q493.246 1163.88 487.436 1163.88 Q481.626 1163.88 478.547 1159.3 Q475.492 1154.69 475.492 1145.97 Q475.492 1137.22 478.547 1132.63 Q481.626 1128.03 487.436 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M517.598 1131.73 Q513.987 1131.73 512.158 1135.3 Q510.353 1138.84 510.353 1145.97 Q510.353 1153.07 512.158 1156.64 Q513.987 1160.18 517.598 1160.18 Q521.232 1160.18 523.038 1156.64 Q524.867 1153.07 524.867 1145.97 Q524.867 1138.84 523.038 1135.3 Q521.232 1131.73 517.598 1131.73 M517.598 1128.03 Q523.408 1128.03 526.464 1132.63 Q529.542 1137.22 529.542 1145.97 Q529.542 1154.69 526.464 1159.3 Q523.408 1163.88 517.598 1163.88 Q511.788 1163.88 508.709 1159.3 Q505.654 1154.69 505.654 1145.97 Q505.654 1137.22 508.709 1132.63 Q511.788 1128.03 517.598 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M547.76 1131.73 Q544.149 1131.73 542.32 1135.3 Q540.515 1138.84 540.515 1145.97 Q540.515 1153.07 542.32 1156.64 Q544.149 1160.18 547.76 1160.18 Q551.394 1160.18 553.2 1156.64 Q555.028 1153.07 555.028 1145.97 Q555.028 1138.84 553.2 1135.3 Q551.394 1131.73 547.76 1131.73 M547.76 1128.03 Q553.57 1128.03 556.626 1132.63 Q559.704 1137.22 559.704 1145.97 Q559.704 1154.69 556.626 1159.3 Q553.57 1163.88 547.76 1163.88 Q541.95 1163.88 538.871 1159.3 Q535.816 1154.69 535.816 1145.97 Q535.816 1137.22 538.871 1132.63 Q541.95 1128.03 547.76 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M775.177 1131.73 Q771.566 1131.73 769.737 1135.3 Q767.932 1138.84 767.932 1145.97 Q767.932 1153.07 769.737 1156.64 Q771.566 1160.18 775.177 1160.18 Q778.811 1160.18 780.617 1156.64 Q782.445 1153.07 782.445 1145.97 Q782.445 1138.84 780.617 1135.3 Q778.811 1131.73 775.177 1131.73 M775.177 1128.03 Q780.987 1128.03 784.043 1132.63 Q787.121 1137.22 787.121 1145.97 Q787.121 1154.69 784.043 1159.3 Q780.987 1163.88 775.177 1163.88 Q769.367 1163.88 766.288 1159.3 Q763.233 1154.69 763.233 1145.97 Q763.233 1137.22 766.288 1132.63 Q769.367 1128.03 775.177 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M795.339 1157.33 L800.223 1157.33 L800.223 1163.21 L795.339 1163.21 L795.339 1157.33 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M820.408 1131.73 Q816.797 1131.73 814.968 1135.3 Q813.163 1138.84 813.163 1145.97 Q813.163 1153.07 814.968 1156.64 Q816.797 1160.18 820.408 1160.18 Q824.042 1160.18 825.848 1156.64 Q827.677 1153.07 827.677 1145.97 Q827.677 1138.84 825.848 1135.3 Q824.042 1131.73 820.408 1131.73 M820.408 1128.03 Q826.218 1128.03 829.274 1132.63 Q832.353 1137.22 832.353 1145.97 Q832.353 1154.69 829.274 1159.3 Q826.218 1163.88 820.408 1163.88 Q814.598 1163.88 811.519 1159.3 Q808.464 1154.69 808.464 1145.97 Q808.464 1137.22 811.519 1132.63 Q814.598 1128.03 820.408 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M844.598 1159.28 L860.917 1159.28 L860.917 1163.21 L838.973 1163.21 L838.973 1159.28 Q841.635 1156.52 846.218 1151.89 Q850.825 1147.24 852.005 1145.9 Q854.251 1143.37 855.13 1141.64 Q856.033 1139.88 856.033 1138.19 Q856.033 1135.43 854.089 1133.7 Q852.167 1131.96 849.065 1131.96 Q846.866 1131.96 844.413 1132.73 Q841.982 1133.49 839.204 1135.04 L839.204 1130.32 Q842.028 1129.18 844.482 1128.61 Q846.936 1128.03 848.973 1128.03 Q854.343 1128.03 857.538 1130.71 Q860.732 1133.4 860.732 1137.89 Q860.732 1140.02 859.922 1141.94 Q859.135 1143.84 857.028 1146.43 Q856.45 1147.1 853.348 1150.32 Q850.246 1153.51 844.598 1159.28 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M870.778 1128.65 L889.135 1128.65 L889.135 1132.59 L875.061 1132.59 L875.061 1141.06 Q876.079 1140.71 877.098 1140.55 Q878.116 1140.36 879.135 1140.36 Q884.922 1140.36 888.301 1143.54 Q891.681 1146.71 891.681 1152.12 Q891.681 1157.7 888.209 1160.8 Q884.737 1163.88 878.417 1163.88 Q876.241 1163.88 873.973 1163.51 Q871.727 1163.14 869.32 1162.4 L869.32 1157.7 Q871.403 1158.84 873.626 1159.39 Q875.848 1159.95 878.325 1159.95 Q882.329 1159.95 884.667 1157.84 Q887.005 1155.74 887.005 1152.12 Q887.005 1148.51 884.667 1146.41 Q882.329 1144.3 878.325 1144.3 Q876.45 1144.3 874.575 1144.72 Q872.723 1145.13 870.778 1146.01 L870.778 1128.65 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1107.15 1131.73 Q1103.54 1131.73 1101.71 1135.3 Q1099.91 1138.84 1099.91 1145.97 Q1099.91 1153.07 1101.71 1156.64 Q1103.54 1160.18 1107.15 1160.18 Q1110.79 1160.18 1112.59 1156.64 Q1114.42 1153.07 1114.42 1145.97 Q1114.42 1138.84 1112.59 1135.3 Q1110.79 1131.73 1107.15 1131.73 M1107.15 1128.03 Q1112.96 1128.03 1116.02 1132.63 Q1119.1 1137.22 1119.1 1145.97 Q1119.1 1154.69 1116.02 1159.3 Q1112.96 1163.88 1107.15 1163.88 Q1101.34 1163.88 1098.26 1159.3 Q1095.21 1154.69 1095.21 1145.97 Q1095.21 1137.22 1098.26 1132.63 Q1101.34 1128.03 1107.15 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1127.32 1157.33 L1132.2 1157.33 L1132.2 1163.21 L1127.32 1163.21 L1127.32 1157.33 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1152.38 1131.73 Q1148.77 1131.73 1146.95 1135.3 Q1145.14 1138.84 1145.14 1145.97 Q1145.14 1153.07 1146.95 1156.64 Q1148.77 1160.18 1152.38 1160.18 Q1156.02 1160.18 1157.82 1156.64 Q1159.65 1153.07 1159.65 1145.97 Q1159.65 1138.84 1157.82 1135.3 Q1156.02 1131.73 1152.38 1131.73 M1152.38 1128.03 Q1158.19 1128.03 1161.25 1132.63 Q1164.33 1137.22 1164.33 1145.97 Q1164.33 1154.69 1161.25 1159.3 Q1158.19 1163.88 1152.38 1163.88 Q1146.57 1163.88 1143.5 1159.3 Q1140.44 1154.69 1140.44 1145.97 Q1140.44 1137.22 1143.5 1132.63 Q1146.57 1128.03 1152.38 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1172.59 1128.65 L1190.95 1128.65 L1190.95 1132.59 L1176.88 1132.59 L1176.88 1141.06 Q1177.89 1140.71 1178.91 1140.55 Q1179.93 1140.36 1180.95 1140.36 Q1186.74 1140.36 1190.12 1143.54 Q1193.5 1146.71 1193.5 1152.12 Q1193.5 1157.7 1190.02 1160.8 Q1186.55 1163.88 1180.23 1163.88 Q1178.06 1163.88 1175.79 1163.51 Q1173.54 1163.14 1171.13 1162.4 L1171.13 1157.7 Q1173.22 1158.84 1175.44 1159.39 Q1177.66 1159.95 1180.14 1159.95 Q1184.14 1159.95 1186.48 1157.84 Q1188.82 1155.74 1188.82 1152.12 Q1188.82 1148.51 1186.48 1146.41 Q1184.14 1144.3 1180.14 1144.3 Q1178.26 1144.3 1176.39 1144.72 Q1174.54 1145.13 1172.59 1146.01 L1172.59 1128.65 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1212.71 1131.73 Q1209.1 1131.73 1207.27 1135.3 Q1205.46 1138.84 1205.46 1145.97 Q1205.46 1153.07 1207.27 1156.64 Q1209.1 1160.18 1212.71 1160.18 Q1216.34 1160.18 1218.15 1156.64 Q1219.98 1153.07 1219.98 1145.97 Q1219.98 1138.84 1218.15 1135.3 Q1216.34 1131.73 1212.71 1131.73 M1212.71 1128.03 Q1218.52 1128.03 1221.57 1132.63 Q1224.65 1137.22 1224.65 1145.97 Q1224.65 1154.69 1221.57 1159.3 Q1218.52 1163.88 1212.71 1163.88 Q1206.9 1163.88 1203.82 1159.3 Q1200.76 1154.69 1200.76 1145.97 Q1200.76 1137.22 1203.82 1132.63 Q1206.9 1128.03 1212.71 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1440.13 1131.73 Q1436.51 1131.73 1434.69 1135.3 Q1432.88 1138.84 1432.88 1145.97 Q1432.88 1153.07 1434.69 1156.64 Q1436.51 1160.18 1440.13 1160.18 Q1443.76 1160.18 1445.57 1156.64 Q1447.39 1153.07 1447.39 1145.97 Q1447.39 1138.84 1445.57 1135.3 Q1443.76 1131.73 1440.13 1131.73 M1440.13 1128.03 Q1445.94 1128.03 1448.99 1132.63 Q1452.07 1137.22 1452.07 1145.97 Q1452.07 1154.69 1448.99 1159.3 Q1445.94 1163.88 1440.13 1163.88 Q1434.32 1163.88 1431.24 1159.3 Q1428.18 1154.69 1428.18 1145.97 Q1428.18 1137.22 1431.24 1132.63 Q1434.32 1128.03 1440.13 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1460.29 1157.33 L1465.17 1157.33 L1465.17 1163.21 L1460.29 1163.21 L1460.29 1157.33 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1485.36 1131.73 Q1481.75 1131.73 1479.92 1135.3 Q1478.11 1138.84 1478.11 1145.97 Q1478.11 1153.07 1479.92 1156.64 Q1481.75 1160.18 1485.36 1160.18 Q1488.99 1160.18 1490.8 1156.64 Q1492.63 1153.07 1492.63 1145.97 Q1492.63 1138.84 1490.8 1135.3 Q1488.99 1131.73 1485.36 1131.73 M1485.36 1128.03 Q1491.17 1128.03 1494.22 1132.63 Q1497.3 1137.22 1497.3 1145.97 Q1497.3 1154.69 1494.22 1159.3 Q1491.17 1163.88 1485.36 1163.88 Q1479.55 1163.88 1476.47 1159.3 Q1473.41 1154.69 1473.41 1145.97 Q1473.41 1137.22 1476.47 1132.63 Q1479.55 1128.03 1485.36 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1504.34 1128.65 L1526.56 1128.65 L1526.56 1130.64 L1514.01 1163.21 L1509.13 1163.21 L1520.94 1132.59 L1504.34 1132.59 L1504.34 1128.65 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1535.73 1128.65 L1554.08 1128.65 L1554.08 1132.59 L1540.01 1132.59 L1540.01 1141.06 Q1541.03 1140.71 1542.05 1140.55 Q1543.06 1140.36 1544.08 1140.36 Q1549.87 1140.36 1553.25 1143.54 Q1556.63 1146.71 1556.63 1152.12 Q1556.63 1157.7 1553.16 1160.8 Q1549.69 1163.88 1543.37 1163.88 Q1541.19 1163.88 1538.92 1163.51 Q1536.68 1163.14 1534.27 1162.4 L1534.27 1157.7 Q1536.35 1158.84 1538.57 1159.39 Q1540.8 1159.95 1543.27 1159.95 Q1547.28 1159.95 1549.62 1157.84 Q1551.95 1155.74 1551.95 1152.12 Q1551.95 1148.51 1549.62 1146.41 Q1547.28 1144.3 1543.27 1144.3 Q1541.4 1144.3 1539.52 1144.72 Q1537.67 1145.13 1535.73 1146.01 L1535.73 1128.65 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1772.1 1131.73 Q1768.49 1131.73 1766.66 1135.3 Q1764.86 1138.84 1764.86 1145.97 Q1764.86 1153.07 1766.66 1156.64 Q1768.49 1160.18 1772.1 1160.18 Q1775.74 1160.18 1777.54 1156.64 Q1779.37 1153.07 1779.37 1145.97 Q1779.37 1138.84 1777.54 1135.3 Q1775.74 1131.73 1772.1 1131.73 M1772.1 1128.03 Q1777.91 1128.03 1780.97 1132.63 Q1784.05 1137.22 1784.05 1145.97 Q1784.05 1154.69 1780.97 1159.3 Q1777.91 1163.88 1772.1 1163.88 Q1766.29 1163.88 1763.21 1159.3 Q1760.16 1154.69 1760.16 1145.97 Q1760.16 1137.22 1763.21 1132.63 Q1766.29 1128.03 1772.1 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1792.26 1157.33 L1797.15 1157.33 L1797.15 1163.21 L1792.26 1163.21 L1792.26 1157.33 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1808.14 1159.28 L1815.78 1159.28 L1815.78 1132.91 L1807.47 1134.58 L1807.47 1130.32 L1815.74 1128.65 L1820.41 1128.65 L1820.41 1159.28 L1828.05 1159.28 L1828.05 1163.21 L1808.14 1163.21 L1808.14 1159.28 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1847.5 1131.73 Q1843.88 1131.73 1842.06 1135.3 Q1840.25 1138.84 1840.25 1145.97 Q1840.25 1153.07 1842.06 1156.64 Q1843.88 1160.18 1847.5 1160.18 Q1851.13 1160.18 1852.94 1156.64 Q1854.76 1153.07 1854.76 1145.97 Q1854.76 1138.84 1852.94 1135.3 Q1851.13 1131.73 1847.5 1131.73 M1847.5 1128.03 Q1853.31 1128.03 1856.36 1132.63 Q1859.44 1137.22 1859.44 1145.97 Q1859.44 1154.69 1856.36 1159.3 Q1853.31 1163.88 1847.5 1163.88 Q1841.69 1163.88 1838.61 1159.3 Q1835.55 1154.69 1835.55 1145.97 Q1835.55 1137.22 1838.61 1132.63 Q1841.69 1128.03 1847.5 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1877.66 1131.73 Q1874.05 1131.73 1872.22 1135.3 Q1870.41 1138.84 1870.41 1145.97 Q1870.41 1153.07 1872.22 1156.64 Q1874.05 1160.18 1877.66 1160.18 Q1881.29 1160.18 1883.1 1156.64 Q1884.93 1153.07 1884.93 1145.97 Q1884.93 1138.84 1883.1 1135.3 Q1881.29 1131.73 1877.66 1131.73 M1877.66 1128.03 Q1883.47 1128.03 1886.52 1132.63 Q1889.6 1137.22 1889.6 1145.97 Q1889.6 1154.69 1886.52 1159.3 Q1883.47 1163.88 1877.66 1163.88 Q1871.85 1163.88 1868.77 1159.3 Q1865.71 1154.69 1865.71 1145.97 Q1865.71 1137.22 1868.77 1132.63 Q1871.85 1128.03 1877.66 1128.03 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1037.06 1221.45 L1016.79 1221.45 Q1017.27 1230.96 1019.46 1235 Q1022.2 1239.97 1026.94 1239.97 Q1031.72 1239.97 1034.36 1234.97 Q1036.68 1230.58 1037.06 1221.45 M1036.97 1216.03 Q1036.08 1207 1034.36 1203.81 Q1031.62 1198.78 1026.94 1198.78 Q1022.07 1198.78 1019.49 1203.75 Q1017.46 1207.76 1016.85 1216.03 L1036.97 1216.03 M1026.94 1194.01 Q1034.58 1194.01 1038.94 1200.76 Q1043.3 1207.47 1043.3 1219.38 Q1043.3 1231.25 1038.94 1238 Q1034.58 1244.78 1026.94 1244.78 Q1019.27 1244.78 1014.94 1238 Q1010.58 1231.25 1010.58 1219.38 Q1010.58 1207.47 1014.94 1200.76 Q1019.27 1194.01 1026.94 1194.01 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 181.127,1059.2 1872.76,1059.2 \n \"/>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 181.127,829.655 1872.76,829.655 \n \"/>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 181.127,600.109 1872.76,600.109 \n \"/>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 181.127,370.563 1872.76,370.563 \n \"/>\n<polyline clip-path=\"url(#clip172)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n 181.127,141.017 1872.76,141.017 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 181.127,1106.38 181.127,123.472 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 181.127,1059.2 200.024,1059.2 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 181.127,829.655 200.024,829.655 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 181.127,600.109 200.024,600.109 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 181.127,370.563 200.024,370.563 \n \"/>\n<polyline clip-path=\"url(#clip170)\" style=\"stroke:#000000; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 181.127,141.017 200.024,141.017 \n \"/>\n<path clip-path=\"url(#clip170)\" d=\"M56.7949 1072.55 L64.4337 1072.55 L64.4337 1046.18 L56.1236 1047.85 L56.1236 1043.59 L64.3874 1041.92 L69.0633 1041.92 L69.0633 1072.55 L76.7022 1072.55 L76.7022 1076.48 L56.7949 1076.48 L56.7949 1072.55 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M86.1466 1070.6 L91.0308 1070.6 L91.0308 1076.48 L86.1466 1076.48 L86.1466 1070.6 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M105.244 1072.55 L121.563 1072.55 L121.563 1076.48 L99.6187 1076.48 L99.6187 1072.55 Q102.281 1069.79 106.864 1065.16 Q111.471 1060.51 112.651 1059.17 Q114.896 1056.64 115.776 1054.91 Q116.679 1053.15 116.679 1051.46 Q116.679 1048.7 114.734 1046.97 Q112.813 1045.23 109.711 1045.23 Q107.512 1045.23 105.059 1045.99 Q102.628 1046.76 99.8502 1048.31 L99.8502 1043.59 Q102.674 1042.45 105.128 1041.87 Q107.582 1041.3 109.619 1041.3 Q114.989 1041.3 118.183 1043.98 Q121.378 1046.67 121.378 1051.16 Q121.378 1053.29 120.568 1055.21 Q119.781 1057.11 117.674 1059.7 Q117.095 1060.37 113.994 1063.59 Q110.892 1066.78 105.244 1072.55 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M131.424 1041.92 L149.78 1041.92 L149.78 1045.86 L135.706 1045.86 L135.706 1054.33 Q136.725 1053.98 137.744 1053.82 Q138.762 1053.63 139.781 1053.63 Q145.568 1053.63 148.947 1056.8 Q152.327 1059.98 152.327 1065.39 Q152.327 1070.97 148.855 1074.07 Q145.382 1077.15 139.063 1077.15 Q136.887 1077.15 134.619 1076.78 Q132.373 1076.41 129.966 1075.67 L129.966 1070.97 Q132.049 1072.11 134.271 1072.66 Q136.494 1073.22 138.97 1073.22 Q142.975 1073.22 145.313 1071.11 Q147.651 1069 147.651 1065.39 Q147.651 1061.78 145.313 1059.67 Q142.975 1057.57 138.97 1057.57 Q137.095 1057.57 135.22 1057.99 Q133.369 1058.4 131.424 1059.28 L131.424 1041.92 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M55.7995 842.999 L63.4384 842.999 L63.4384 816.634 L55.1282 818.3 L55.1282 814.041 L63.3921 812.375 L68.068 812.375 L68.068 842.999 L75.7068 842.999 L75.7068 846.935 L55.7995 846.935 L55.7995 842.999 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M85.1512 841.055 L90.0354 841.055 L90.0354 846.935 L85.1512 846.935 L85.1512 841.055 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M100.267 812.375 L118.623 812.375 L118.623 816.31 L104.549 816.31 L104.549 824.782 Q105.568 824.435 106.586 824.273 Q107.605 824.087 108.623 824.087 Q114.41 824.087 117.79 827.259 Q121.17 830.43 121.17 835.847 Q121.17 841.425 117.697 844.527 Q114.225 847.606 107.906 847.606 Q105.73 847.606 103.461 847.235 Q101.216 846.865 98.8085 846.124 L98.8085 841.425 Q100.892 842.56 103.114 843.115 Q105.336 843.671 107.813 843.671 Q111.818 843.671 114.156 841.564 Q116.494 839.458 116.494 835.847 Q116.494 832.236 114.156 830.129 Q111.818 828.023 107.813 828.023 Q105.938 828.023 104.063 828.439 Q102.211 828.856 100.267 829.736 L100.267 812.375 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M140.382 815.453 Q136.771 815.453 134.943 819.018 Q133.137 822.56 133.137 829.689 Q133.137 836.796 134.943 840.361 Q136.771 843.902 140.382 843.902 Q144.017 843.902 145.822 840.361 Q147.651 836.796 147.651 829.689 Q147.651 822.56 145.822 819.018 Q144.017 815.453 140.382 815.453 M140.382 811.75 Q146.193 811.75 149.248 816.356 Q152.327 820.939 152.327 829.689 Q152.327 838.416 149.248 843.023 Q146.193 847.606 140.382 847.606 Q134.572 847.606 131.494 843.023 Q128.438 838.416 128.438 829.689 Q128.438 820.939 131.494 816.356 Q134.572 811.75 140.382 811.75 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M56.7949 613.454 L64.4337 613.454 L64.4337 587.088 L56.1236 588.755 L56.1236 584.495 L64.3874 582.829 L69.0633 582.829 L69.0633 613.454 L76.7022 613.454 L76.7022 617.389 L56.7949 617.389 L56.7949 613.454 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M86.1466 611.509 L91.0308 611.509 L91.0308 617.389 L86.1466 617.389 L86.1466 611.509 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M100.035 582.829 L122.257 582.829 L122.257 584.819 L109.711 617.389 L104.827 617.389 L116.633 586.764 L100.035 586.764 L100.035 582.829 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M131.424 582.829 L149.78 582.829 L149.78 586.764 L135.706 586.764 L135.706 595.236 Q136.725 594.889 137.744 594.727 Q138.762 594.542 139.781 594.542 Q145.568 594.542 148.947 597.713 Q152.327 600.884 152.327 606.301 Q152.327 611.879 148.855 614.981 Q145.382 618.06 139.063 618.06 Q136.887 618.06 134.619 617.69 Q132.373 617.319 129.966 616.579 L129.966 611.879 Q132.049 613.014 134.271 613.569 Q136.494 614.125 138.97 614.125 Q142.975 614.125 145.313 612.018 Q147.651 609.912 147.651 606.301 Q147.651 602.69 145.313 600.583 Q142.975 598.477 138.97 598.477 Q137.095 598.477 135.22 598.893 Q133.369 599.31 131.424 600.19 L131.424 582.829 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M59.0171 383.908 L75.3365 383.908 L75.3365 387.843 L53.3921 387.843 L53.3921 383.908 Q56.0541 381.153 60.6375 376.524 Q65.2439 371.871 66.4245 370.528 Q68.6698 368.005 69.5494 366.269 Q70.4522 364.51 70.4522 362.82 Q70.4522 360.065 68.5078 358.329 Q66.5865 356.593 63.4847 356.593 Q61.2856 356.593 58.8319 357.357 Q56.4014 358.121 53.6236 359.672 L53.6236 354.95 Q56.4477 353.815 58.9014 353.237 Q61.355 352.658 63.3921 352.658 Q68.7624 352.658 71.9568 355.343 Q75.1513 358.028 75.1513 362.519 Q75.1513 364.649 74.3411 366.57 Q73.5541 368.468 71.4476 371.061 Q70.8689 371.732 67.767 374.949 Q64.6652 378.144 59.0171 383.908 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M85.1512 381.963 L90.0354 381.963 L90.0354 387.843 L85.1512 387.843 L85.1512 381.963 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M110.221 356.362 Q106.609 356.362 104.781 359.926 Q102.975 363.468 102.975 370.598 Q102.975 377.704 104.781 381.269 Q106.609 384.811 110.221 384.811 Q113.855 384.811 115.66 381.269 Q117.489 377.704 117.489 370.598 Q117.489 363.468 115.66 359.926 Q113.855 356.362 110.221 356.362 M110.221 352.658 Q116.031 352.658 119.086 357.264 Q122.165 361.848 122.165 370.598 Q122.165 379.324 119.086 383.931 Q116.031 388.514 110.221 388.514 Q104.41 388.514 101.332 383.931 Q98.2761 379.324 98.2761 370.598 Q98.2761 361.848 101.332 357.264 Q104.41 352.658 110.221 352.658 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M140.382 356.362 Q136.771 356.362 134.943 359.926 Q133.137 363.468 133.137 370.598 Q133.137 377.704 134.943 381.269 Q136.771 384.811 140.382 384.811 Q144.017 384.811 145.822 381.269 Q147.651 377.704 147.651 370.598 Q147.651 363.468 145.822 359.926 Q144.017 356.362 140.382 356.362 M140.382 352.658 Q146.193 352.658 149.248 357.264 Q152.327 361.848 152.327 370.598 Q152.327 379.324 149.248 383.931 Q146.193 388.514 140.382 388.514 Q134.572 388.514 131.494 383.931 Q128.438 379.324 128.438 370.598 Q128.438 361.848 131.494 357.264 Q134.572 352.658 140.382 352.658 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M60.0125 154.362 L76.3318 154.362 L76.3318 158.297 L54.3875 158.297 L54.3875 154.362 Q57.0495 151.607 61.6328 146.978 Q66.2393 142.325 67.4198 140.982 Q69.6652 138.459 70.5448 136.723 Q71.4476 134.964 71.4476 133.274 Q71.4476 130.519 69.5032 128.783 Q67.5819 127.047 64.48 127.047 Q62.281 127.047 59.8273 127.811 Q57.3967 128.575 54.619 130.126 L54.619 125.404 Q57.443 124.27 59.8967 123.691 Q62.3504 123.112 64.3874 123.112 Q69.7578 123.112 72.9522 125.797 Q76.1466 128.482 76.1466 132.973 Q76.1466 135.103 75.3365 137.024 Q74.5494 138.922 72.4429 141.515 Q71.8642 142.186 68.7624 145.404 Q65.6606 148.598 60.0125 154.362 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M86.1466 152.418 L91.0308 152.418 L91.0308 158.297 L86.1466 158.297 L86.1466 152.418 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M105.244 154.362 L121.563 154.362 L121.563 158.297 L99.6187 158.297 L99.6187 154.362 Q102.281 151.607 106.864 146.978 Q111.471 142.325 112.651 140.982 Q114.896 138.459 115.776 136.723 Q116.679 134.964 116.679 133.274 Q116.679 130.519 114.734 128.783 Q112.813 127.047 109.711 127.047 Q107.512 127.047 105.059 127.811 Q102.628 128.575 99.8502 130.126 L99.8502 125.404 Q102.674 124.27 105.128 123.691 Q107.582 123.112 109.619 123.112 Q114.989 123.112 118.183 125.797 Q121.378 128.482 121.378 132.973 Q121.378 135.103 120.568 137.024 Q119.781 138.922 117.674 141.515 Q117.095 142.186 113.994 145.404 Q110.892 148.598 105.244 154.362 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M131.424 123.737 L149.78 123.737 L149.78 127.672 L135.706 127.672 L135.706 136.144 Q136.725 135.797 137.744 135.635 Q138.762 135.45 139.781 135.45 Q145.568 135.45 148.947 138.621 Q152.327 141.793 152.327 147.209 Q152.327 152.788 148.855 155.89 Q145.382 158.968 139.063 158.968 Q136.887 158.968 134.619 158.598 Q132.373 158.228 129.966 157.487 L129.966 152.788 Q132.049 153.922 134.271 154.478 Q136.494 155.033 138.97 155.033 Q142.975 155.033 145.313 152.927 Q147.651 150.82 147.651 147.209 Q147.651 143.598 145.313 141.492 Q142.975 139.385 138.97 139.385 Q137.095 139.385 135.22 139.802 Q133.369 140.218 131.424 141.098 L131.424 123.737 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M497.711 18.8205 L497.711 41.5461 L508 41.5461 Q513.712 41.5461 516.831 38.5889 Q519.95 35.6318 519.95 30.163 Q519.95 24.7348 516.831 21.7777 Q513.712 18.8205 508 18.8205 L497.711 18.8205 M489.528 12.096 L508 12.096 Q518.168 12.096 523.353 16.714 Q528.579 21.2916 528.579 30.163 Q528.579 39.1155 523.353 43.6931 Q518.168 48.2706 508 48.2706 L497.711 48.2706 L497.711 72.576 L489.528 72.576 L489.528 12.096 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M564.065 34.1734 Q562.809 33.4443 561.31 33.1202 Q559.852 32.7556 558.069 32.7556 Q551.75 32.7556 548.347 36.8875 Q544.985 40.9789 544.985 48.6757 L544.985 72.576 L537.491 72.576 L537.491 27.2059 L544.985 27.2059 L544.985 34.2544 Q547.335 30.1225 551.102 28.1376 Q554.869 26.1121 560.257 26.1121 Q561.027 26.1121 561.958 26.2337 Q562.89 26.3147 564.024 26.5172 L564.065 34.1734 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M608.868 48.0275 L608.868 51.6733 L574.597 51.6733 Q575.083 59.3701 579.215 63.421 Q583.388 67.4314 590.801 67.4314 Q595.095 67.4314 599.105 66.3781 Q603.156 65.3249 607.126 63.2184 L607.126 70.267 Q603.115 71.9684 598.903 72.8596 Q594.69 73.7508 590.355 73.7508 Q579.499 73.7508 573.139 67.4314 Q566.819 61.1119 566.819 50.3365 Q566.819 39.1965 572.815 32.6746 Q578.851 26.1121 589.059 26.1121 Q598.214 26.1121 603.521 32.0264 Q608.868 37.9003 608.868 48.0275 M601.414 45.84 Q601.333 39.7232 597.971 36.0774 Q594.649 32.4315 589.14 32.4315 Q582.901 32.4315 579.134 35.9558 Q575.407 39.4801 574.84 45.8805 L601.414 45.84 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M650.025 28.5427 L650.025 35.5912 Q646.865 33.9709 643.462 33.1607 Q640.06 32.3505 636.414 32.3505 Q630.864 32.3505 628.069 34.0519 Q625.314 35.7533 625.314 39.156 Q625.314 41.7486 627.299 43.2475 Q629.284 44.7058 635.28 46.0426 L637.832 46.6097 Q645.772 48.3111 649.093 51.4303 Q652.456 54.509 652.456 60.0587 Q652.456 66.3781 647.432 70.0644 Q642.45 73.7508 633.7 73.7508 Q630.054 73.7508 626.084 73.0216 Q622.155 72.3329 617.78 70.9151 L617.78 63.2184 Q621.912 65.3654 625.922 66.4591 Q629.932 67.5124 633.862 67.5124 Q639.128 67.5124 641.964 65.73 Q644.799 63.9071 644.799 60.6258 Q644.799 57.5877 642.733 55.9673 Q640.708 54.3469 633.781 52.8481 L631.188 52.2405 Q624.261 50.7821 621.183 47.7845 Q618.104 44.7463 618.104 39.4801 Q618.104 33.0797 622.641 29.5959 Q627.178 26.1121 635.523 26.1121 Q639.655 26.1121 643.3 26.7198 Q646.946 27.3274 650.025 28.5427 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M703.132 48.0275 L703.132 51.6733 L668.862 51.6733 Q669.348 59.3701 673.48 63.421 Q677.652 67.4314 685.065 67.4314 Q689.359 67.4314 693.37 66.3781 Q697.421 65.3249 701.39 63.2184 L701.39 70.267 Q697.38 71.9684 693.167 72.8596 Q688.954 73.7508 684.62 73.7508 Q673.763 73.7508 667.403 67.4314 Q661.084 61.1119 661.084 50.3365 Q661.084 39.1965 667.079 32.6746 Q673.115 26.1121 683.323 26.1121 Q692.478 26.1121 697.785 32.0264 Q703.132 37.9003 703.132 48.0275 M695.679 45.84 Q695.598 39.7232 692.235 36.0774 Q688.914 32.4315 683.404 32.4315 Q677.166 32.4315 673.399 35.9558 Q669.672 39.4801 669.105 45.8805 L695.679 45.84 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M753.08 45.1919 L753.08 72.576 L745.626 72.576 L745.626 45.4349 Q745.626 38.994 743.115 35.7938 Q740.603 32.5936 735.58 32.5936 Q729.544 32.5936 726.06 36.4419 Q722.577 40.2903 722.577 46.9338 L722.577 72.576 L715.082 72.576 L715.082 27.2059 L722.577 27.2059 L722.577 34.2544 Q725.25 30.163 728.856 28.1376 Q732.501 26.1121 737.241 26.1121 Q745.059 26.1121 749.07 30.9732 Q753.08 35.7938 753.08 45.1919 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M775.319 14.324 L775.319 27.2059 L790.672 27.2059 L790.672 32.9987 L775.319 32.9987 L775.319 57.6282 Q775.319 63.1779 776.818 64.7578 Q778.358 66.3376 783.016 66.3376 L790.672 66.3376 L790.672 72.576 L783.016 72.576 Q774.388 72.576 771.106 69.3758 Q767.825 66.1351 767.825 57.6282 L767.825 32.9987 L762.357 32.9987 L762.357 27.2059 L767.825 27.2059 L767.825 14.324 L775.319 14.324 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M821.5 27.2059 L829.399 27.2059 L843.577 65.2844 L857.755 27.2059 L865.655 27.2059 L848.641 72.576 L838.514 72.576 L821.5 27.2059 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M896.563 49.7694 Q887.529 49.7694 884.046 51.8354 Q880.562 53.9013 880.562 58.8839 Q880.562 62.8538 883.154 65.2034 Q885.788 67.5124 890.284 67.5124 Q896.482 67.5124 900.209 63.1374 Q903.976 58.7219 903.976 51.4303 L903.976 49.7694 L896.563 49.7694 M911.43 46.6907 L911.43 72.576 L903.976 72.576 L903.976 65.6895 Q901.424 69.8214 897.616 71.8063 Q893.808 73.7508 888.299 73.7508 Q881.332 73.7508 877.2 69.8619 Q873.108 65.9325 873.108 59.3701 Q873.108 51.7138 878.212 47.825 Q883.357 43.9361 893.525 43.9361 L903.976 43.9361 L903.976 43.2069 Q903.976 38.0623 900.573 35.2672 Q897.211 32.4315 891.094 32.4315 Q887.205 32.4315 883.519 33.3632 Q879.833 34.295 876.43 36.1584 L876.43 29.2718 Q880.521 27.692 884.37 26.9223 Q888.218 26.1121 891.864 26.1121 Q901.708 26.1121 906.569 31.2163 Q911.43 36.3204 911.43 46.6907 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M926.783 9.54393 L934.236 9.54393 L934.236 72.576 L926.783 72.576 L926.783 9.54393 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M949.063 54.671 L949.063 27.2059 L956.516 27.2059 L956.516 54.3874 Q956.516 60.8284 959.028 64.0691 Q961.539 67.2693 966.563 67.2693 Q972.598 67.2693 976.082 63.421 Q979.607 59.5726 979.607 52.9291 L979.607 27.2059 L987.06 27.2059 L987.06 72.576 L979.607 72.576 L979.607 65.6084 Q976.892 69.7404 973.287 71.7658 Q969.722 73.7508 964.983 73.7508 Q957.165 73.7508 953.114 68.8897 Q949.063 64.0286 949.063 54.671 M967.818 26.1121 L967.818 26.1121 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1041.22 48.0275 L1041.22 51.6733 L1006.95 51.6733 Q1007.44 59.3701 1011.57 63.421 Q1015.74 67.4314 1023.15 67.4314 Q1027.45 67.4314 1031.46 66.3781 Q1035.51 65.3249 1039.48 63.2184 L1039.48 70.267 Q1035.47 71.9684 1031.26 72.8596 Q1027.04 73.7508 1022.71 73.7508 Q1011.85 73.7508 1005.49 67.4314 Q999.172 61.1119 999.172 50.3365 Q999.172 39.1965 1005.17 32.6746 Q1011.2 26.1121 1021.41 26.1121 Q1030.57 26.1121 1035.87 32.0264 Q1041.22 37.9003 1041.22 48.0275 M1033.77 45.84 Q1033.69 39.7232 1030.32 36.0774 Q1027 32.4315 1021.49 32.4315 Q1015.25 32.4315 1011.49 35.9558 Q1007.76 39.4801 1007.19 45.8805 L1033.77 45.84 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1097.41 32.4315 Q1091.41 32.4315 1087.93 37.1306 Q1084.44 41.7891 1084.44 49.9314 Q1084.44 58.0738 1087.89 62.7728 Q1091.37 67.4314 1097.41 67.4314 Q1103.36 67.4314 1106.85 62.7323 Q1110.33 58.0333 1110.33 49.9314 Q1110.33 41.8701 1106.85 37.1711 Q1103.36 32.4315 1097.41 32.4315 M1097.41 26.1121 Q1107.13 26.1121 1112.68 32.4315 Q1118.23 38.7509 1118.23 49.9314 Q1118.23 61.0714 1112.68 67.4314 Q1107.13 73.7508 1097.41 73.7508 Q1087.64 73.7508 1082.09 67.4314 Q1076.59 61.0714 1076.59 49.9314 Q1076.59 38.7509 1082.09 32.4315 Q1087.64 26.1121 1097.41 26.1121 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1153.55 9.54393 L1153.55 15.7418 L1146.42 15.7418 Q1142.41 15.7418 1140.83 17.3622 Q1139.29 18.9825 1139.29 23.1955 L1139.29 27.2059 L1151.57 27.2059 L1151.57 32.9987 L1139.29 32.9987 L1139.29 72.576 L1131.8 72.576 L1131.8 32.9987 L1124.67 32.9987 L1124.67 27.2059 L1131.8 27.2059 L1131.8 24.0462 Q1131.8 16.471 1135.32 13.0277 Q1138.85 9.54393 1146.5 9.54393 L1153.55 9.54393 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1218.81 28.9478 L1218.81 35.9153 Q1215.65 34.1734 1212.45 33.3227 Q1209.29 32.4315 1206.05 32.4315 Q1198.8 32.4315 1194.79 37.0496 Q1190.78 41.6271 1190.78 49.9314 Q1190.78 58.2358 1194.79 62.8538 Q1198.8 67.4314 1206.05 67.4314 Q1209.29 67.4314 1212.45 66.5807 Q1215.65 65.6895 1218.81 63.9476 L1218.81 70.8341 Q1215.69 72.2924 1212.33 73.0216 Q1209.01 73.7508 1205.24 73.7508 Q1194.99 73.7508 1188.96 67.3098 Q1182.92 60.8689 1182.92 49.9314 Q1182.92 38.832 1189 32.472 Q1195.11 26.1121 1205.73 26.1121 Q1209.17 26.1121 1212.45 26.8413 Q1215.73 27.5299 1218.81 28.9478 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1252.39 49.7694 Q1243.36 49.7694 1239.88 51.8354 Q1236.39 53.9013 1236.39 58.8839 Q1236.39 62.8538 1238.99 65.2034 Q1241.62 67.5124 1246.12 67.5124 Q1252.31 67.5124 1256.04 63.1374 Q1259.81 58.7219 1259.81 51.4303 L1259.81 49.7694 L1252.39 49.7694 M1267.26 46.6907 L1267.26 72.576 L1259.81 72.576 L1259.81 65.6895 Q1257.26 69.8214 1253.45 71.8063 Q1249.64 73.7508 1244.13 73.7508 Q1237.16 73.7508 1233.03 69.8619 Q1228.94 65.9325 1228.94 59.3701 Q1228.94 51.7138 1234.04 47.825 Q1239.19 43.9361 1249.36 43.9361 L1259.81 43.9361 L1259.81 43.2069 Q1259.81 38.0623 1256.4 35.2672 Q1253.04 32.4315 1246.93 32.4315 Q1243.04 32.4315 1239.35 33.3632 Q1235.66 34.295 1232.26 36.1584 L1232.26 29.2718 Q1236.35 27.692 1240.2 26.9223 Q1244.05 26.1121 1247.7 26.1121 Q1257.54 26.1121 1262.4 31.2163 Q1267.26 36.3204 1267.26 46.6907 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1311.54 28.5427 L1311.54 35.5912 Q1308.38 33.9709 1304.98 33.1607 Q1301.57 32.3505 1297.93 32.3505 Q1292.38 32.3505 1289.58 34.0519 Q1286.83 35.7533 1286.83 39.156 Q1286.83 41.7486 1288.81 43.2475 Q1290.8 44.7058 1296.79 46.0426 L1299.34 46.6097 Q1307.28 48.3111 1310.61 51.4303 Q1313.97 54.509 1313.97 60.0587 Q1313.97 66.3781 1308.95 70.0644 Q1303.96 73.7508 1295.21 73.7508 Q1291.57 73.7508 1287.6 73.0216 Q1283.67 72.3329 1279.29 70.9151 L1279.29 63.2184 Q1283.42 65.3654 1287.43 66.4591 Q1291.45 67.5124 1295.37 67.5124 Q1300.64 67.5124 1303.48 65.73 Q1306.31 63.9071 1306.31 60.6258 Q1306.31 57.5877 1304.25 55.9673 Q1302.22 54.3469 1295.29 52.8481 L1292.7 52.2405 Q1285.77 50.7821 1282.7 47.7845 Q1279.62 44.7463 1279.62 39.4801 Q1279.62 33.0797 1284.15 29.5959 Q1288.69 26.1121 1297.04 26.1121 Q1301.17 26.1121 1304.81 26.7198 Q1308.46 27.3274 1311.54 28.5427 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1363.55 45.1919 L1363.55 72.576 L1356.1 72.576 L1356.1 45.4349 Q1356.1 38.994 1353.59 35.7938 Q1351.07 32.5936 1346.05 32.5936 Q1340.02 32.5936 1336.53 36.4419 Q1333.05 40.2903 1333.05 46.9338 L1333.05 72.576 L1325.55 72.576 L1325.55 9.54393 L1333.05 9.54393 L1333.05 34.2544 Q1335.72 30.163 1339.33 28.1376 Q1342.97 26.1121 1347.71 26.1121 Q1355.53 26.1121 1359.54 30.9732 Q1363.55 35.7938 1363.55 45.1919 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1427.76 9.54393 L1427.76 15.7418 L1420.63 15.7418 Q1416.62 15.7418 1415.04 17.3622 Q1413.5 18.9825 1413.5 23.1955 L1413.5 27.2059 L1425.77 27.2059 L1425.77 32.9987 L1413.5 32.9987 L1413.5 72.576 L1406 72.576 L1406 32.9987 L1398.88 32.9987 L1398.88 27.2059 L1406 27.2059 L1406 24.0462 Q1406 16.471 1409.53 13.0277 Q1413.05 9.54393 1420.71 9.54393 L1427.76 9.54393 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1434 9.54393 L1441.45 9.54393 L1441.45 72.576 L1434 72.576 L1434 9.54393 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1474.63 32.4315 Q1468.63 32.4315 1465.15 37.1306 Q1461.66 41.7891 1461.66 49.9314 Q1461.66 58.0738 1465.11 62.7728 Q1468.59 67.4314 1474.63 67.4314 Q1480.58 67.4314 1484.07 62.7323 Q1487.55 58.0333 1487.55 49.9314 Q1487.55 41.8701 1484.07 37.1711 Q1480.58 32.4315 1474.63 32.4315 M1474.63 26.1121 Q1484.35 26.1121 1489.9 32.4315 Q1495.45 38.7509 1495.45 49.9314 Q1495.45 61.0714 1489.9 67.4314 Q1484.35 73.7508 1474.63 73.7508 Q1464.86 73.7508 1459.31 67.4314 Q1453.81 61.0714 1453.81 49.9314 Q1453.81 38.7509 1459.31 32.4315 Q1464.86 26.1121 1474.63 26.1121 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip170)\" d=\"M1503.47 27.2059 L1510.92 27.2059 L1520.24 62.6108 L1529.52 27.2059 L1538.31 27.2059 L1547.62 62.6108 L1556.9 27.2059 L1564.35 27.2059 L1552.49 72.576 L1543.69 72.576 L1533.93 35.3887 L1524.13 72.576 L1515.34 72.576 L1503.47 27.2059 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><polyline clip-path=\"url(#clip172)\" style=\"stroke:#009af9; stroke-linecap:butt; stroke-linejoin:round; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n 229.003,151.29 295.498,209.51 361.993,265.388 428.488,319.036 494.982,370.563 561.477,420.069 627.972,467.651 694.467,513.398 760.962,557.398 827.457,599.73 \n 893.952,640.472 960.446,679.696 1026.94,717.472 1093.44,753.864 1159.93,788.936 1226.43,822.745 1292.92,855.348 1359.42,886.797 1425.91,917.142 1492.41,946.433 \n 1558.9,974.713 1625.4,1002.03 1691.89,1028.41 1758.38,1053.91 1824.88,1078.56 \n \"/>\n</svg>\n"
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# calculate the formula above\n",
"function PV(θ, cf, k) #cf is a vector of all cash flows at times k[1],k[2],...\n",
" cdisc = cf./((1.0.+θ).^k) \n",
" P = sum(cdisc) \n",
" return P\n",
"end\n",
"\n",
"θ = -0.02:0.005:0.1\n",
"k = 1:10\n",
"cf = 0.2*ones(10)\n",
"\n",
"printlnPs(\"(1) Price at θ=0.05: \",PV(0.05,cf,k))\n",
"\n",
"n = length(θ)\n",
"Pfair = fill(NaN, n)\n",
"for i = 1:n\n",
" Pfair[i] = PV(θ[i], cf, k)\n",
"end\n",
"\n",
"# Pfair = PV.(θ, Ref(cf), Ref(k))\n",
"\n",
"plot(θ, Pfair, title=\"Present value of cash flow\", legend=false, xlabel=\"θ\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 2\n",
"\n",
"Assume the price this bond (portfolio) is 1.54. Solve for the ytm. Compare with the previous figure. Repeat with a bond price of 1.71.\n",
"\n",
"Hint: the `find_zero()`command of the `Roots.jl` package."
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The price and yield to maturity is \n",
" P θ\n",
" 1.540 0.051\n",
" 1.710 0.030\n",
"\n"
]
}
],
"source": [
"P1 = 1.54\n",
"P2 = 1.71\n",
"\n",
"ytm1 = find_zero(θ->PV(θ,cf,k)-P1,(-0.1,0.1)) \n",
"ytm2 = find_zero(θ->PV(θ,cf,k)-P2,(-0.1,0.1)) \n",
"\n",
"printlnPs(\"The price and yield to maturity is \")\n",
"printmat([P1,P2],[ytm1,ytm2],colNames=[\"P\",\"θ\"])\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 3a\n",
"\n",
"Now interpret `cf` as the cash flow to a company where `cf[1]` also incorporates the initial investment and `m[1]=0`. (Alternatively, let `P` represent the initial investment.)\n",
"\n",
"The cash flow process is as follows. Find the IRR (internal rate of return).\n",
"\n",
"Hint: `findzero(fn,0)` would start searching at 0."
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.2349421128831387"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cf = [-150,100,0,130]\n",
"m = [0,1,2,3]\n",
"\n",
"iir = find_zero(θ->PV(θ, cf, m), 0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 3b\n",
"\n",
"Change the cash flow as in the cell below. Find the IRR. Could there be several solutions?\n",
"\n",
"(Hint: `find_zeros()`)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2-element Vector{Float64}:\n",
" 0.04650143593633046\n",
" 0.9160439083362444"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cf = [-140,320,0,-190]\n",
"\n",
"iir = find_zeros(θ->PV(θ, cf, m),-1,1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Julia 1.7.0-rc1",
"language": "julia",
"name": "julia-1.7"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.7.0"
}
},
"nbformat": 4,
"nbformat_minor": 1
}