<jupyter_start><jupyter_text>Homework 2 - <NAME>  Question 1 You believe that interest rates will rise. Accordingly, you  A. Buy a December Eurodollar futures - FalseHow the Eurodollar futures contract worksFor example, if on a particular day an investor buys a single three-month contract at 95.00 (implied settlement LIBOR of 5.00%):if at the close of business on that day, the contract price has risen to 95.01 (implying a LIBOR decrease to 4.99%), US\\$25 will be paid into the investor's margin account; orif at the close of business on that day, the contract price has fallen to 94.99 (implying a LIBOR increase to 5.01%), US\\$25 will be deducted from the investor's margin account.Therefore, an invester who long the future would want the LIBOR rate to decrease. Now I expect the LIBOR rate to increase, which mean I would not want to buy the future.  B. Sell a December Eurodollar futures - TrueSimilar to above, I would want to sell the future because I bet the rate goes up and the price goes down.  C. Pay fixed on a 5-year swap - TrueIf I believe the interest rates will rise, I believe the floating leg rate of a swap will rise. Therefore, I would rather pay the fixed leg and receive the floating leg payment.  D. Receive fixed on a 5-year swap - FalseSimilar to C, I believe the floating rate will rise. Then, I would not want to receive fixed payment and pay the floating rate.  Question 2 Consider a FRA in which you will borrow money for 6 months on December 20, 2019 (T) based on the 3-month LIBOR rate:  Please see attached handwritten problem solving.  Question 3 Build a smooth discount curve (Z-curve) with monthly granularity for LIBOR rates on October 8, 2019, using the following information:<jupyter_code>from scipy.interpolate import interp1d
import numpy as np
import matplotlib.pyplot as plt

data = []
data += [(30/365, 1.94)]
data += [(90/365, 2.01)]
data += [(1, 1.67)]
data += [(2, 1.47)]
data += [(3, 1.39)]
data += [(5, 1.35)]
data += [(7, 1.38)]
data += [(10, 1.45)]
data += [(30, 1.63)]
x, y = [], []
for (t,r) in data:
    x += [t]
    y += [r]
    
x = np.asarray(x)
y = np.asarray(y)

f = interp1d(x, y,fill_value="extrapolate")
f2 = interp1d(x, y, kind='cubic',fill_value="extrapolate")
xnew = np.linspace(0, 30, num=41, endpoint=True)
plt.plot(x, y, 'o', xnew, f(xnew), '-', xnew, f2(xnew), '--')
plt.legend(['data', 'linear', 'cubic'], loc='best')
plt.xlabel('years-LIBOR')
plt.ylabel('rate (%)')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11120064464141821, 'fraction_numerical': 0.040290088638195005, 'mean_word_length': 4.172916666666667, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '163864', 'license': 'MIT', 'n_tokens_mistral': 882, 'n_tokens_neox': 772, 'n_words': 369, 'path': 'homework/hw2/hw2.ipynb', 'repo_name': 'balloonio/derivative-securities', 'size': '2487'}