Question
From this question, you will see that the second principal component has a strong relationship with 10-Year yield rates subtracted by 3-Month yield rates. (1
From this question, you will see that the second principal component has a strong relationship with 10-Year yield rates subtracted by 3-Month yield rates.
(1 point) Create a variable slope for the difference between column 10 yr and 3 mo of df.
(1 point) Create a figure that includes two line graphs for -pc2 and slope over date. (Notice that it is not pc2 but -pc2.)
(1 point) Print out the correlation coefficient between pc2 and slope to five decimal places.
(2 pint) Interpret the meaning the PC2. On the last line of your code, write your response as a commented test as follows.
Your code here # Your interpretation here
The graph for Part 2 must be as follows:
Hint: Replace the ????? part with your solution.
slope = df['?????']-df['?????'] fig = plt.figure(figsize=(15, 10)) plt.plot(?????, ?????, label='pc2') plt.plot(?????, ?????, label='10Y-3M (slope)') plt.legend(loc="upper right") plt.grid() plt.show() print('Correlation between -pc2 and slope',np.round(np.?????(-pc2, slope)[0,1],5)) # Your answer to Question 9-4 here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started