首页 > > 详细

辅导FE 535辅导留学生R语言、R语言辅导留学生

FE 535: Introduction to Financial Risk Management
Project 2
Majeed Simaan
Due Date 11:59 PM, April 19th, 2020
Instructions
1. This is a teamwork project - please check your assigned team in the course website.
2. There are 5 main independent questions in this project (total 120 points).
3. Each member should contribute equally.
4. Feel free to use the handouts and the published codes to do your project.
5. You are welcome to use any programming language or statistical software. Also, you are
welcome to use any library/package unless stated otherwise.
6. You will need to download data on your own - unless provided otherwise.
7. The final report should be written using a special document editor, e.g. Word, Latex, Mark-
down, etc. Any form of document with a handwriting would not be accepted.
8. Please submit a pdf copy of your final report, please include your code as an appendix or as
part of the your Markdown output. Note that Canvas will not accept any other formats than
pdf.
9. Not including the code appendix, the maximum report’s length should be no more than
15 pages - with font 11 point size, 1.5 line space, and 1in margin (just like this document).
10. Please avoid taking picture snapshots. You should report your results in an organized
table. The same applies to plots and other visualizations - do not paste any low resolution
figures.
11. Please use a special equation editor to write any math, in case needed.
1 Interest Rate Risk: Empirical Investigation (20 Points)
Download adjusted prices for three ETFs: SPY, IEF, and SHY from Yahoo Finance. The first one
tracks the SP 500 index, whereas the other two track bond indices. In particular, IEF tracks a
bond index that represents the prices of Treasury bonds with maturity ranging between 7 and 10
years, whereas the SHY ETF tracks the prices of government bonds with lower maturity ranging
between 1 and 3 years. After merging altogether, the data should date between July 2002 and
Feb 2020.
1. Your first task is to consider the return on each ETF. In particular, compute the mean return
for each ETF and report in annual basis. How does the SPY compare with the bond ETFs?
In terms of risk-return reward trade-off how do you explain the heterogeneity in the mean
returns of the ETFs? (5 Points)
2. For each ETF compute a time series of monthly returns. In other words, for a given ETF,
consider the sum of daily returns over each month in the time series to represent the monthly
return. Report the Pearson correlation coefficients for the three ETF monthly returns (note
that in total you should have three unique coefficients). In addition, plot the cumulative
monthly return of each ETF in one figure. Looking at the plot, how can you justify the sign
and magnitude of each correlation coefficient? Provide some economic rationale. (5 Points)
3. As a final perspective, let’s investigate how the interest rates affect the returns of the three
ETFs. To do so, consider the Federal Funds rate, which corresponds to the target interest
rate assigned by the Federal Reserve to monitor economic activity:
(a) Go to Federal Reserve Economic Data (FRED) at St. Louis Fed website (see link) and
download a time series data for the effective Federal Funds rate.1 The Fed Funds rate is
reported on a monthly basis. To merge with the ETF data, refer to the monthly returns
from question 2 above. Note that to merge the Yahoo Finance and FRED data, you need
to find a common key index. One suggestion is to create a year-month time index. After
merging, this should result in 4 monthly time series. Similar to the figure from question 2
above, plot the cumulative returns over time for each ETF along with the corresponding
Fed Funds rate. Ideally, you should use two y-axes, where the left hand side refers to the
ETF cumulative return and the right-hand side to the Fed Funds Rate. Provide a number
of insights. (5 Points)
(b) Consider the monthly change in the Fed Funds rate denoted by ∆rt, which is the difference
between the current month rate and the previous one. As a final exercise, regress the
monthly return of each ETF against ∆rt using a linear regression. Report the beta of
each regression. How do explain the magnitudes and signs of each beta? (5 Points)
1You may also download this using the R quantmod package, the symbol for which is “FEDFUNDS”.
1
Note on the Fed Funds Rate: when it comes to the yield curve, the Fed Funds rate is
considered the interest charged for loans with the shortest maturity. These loans, mostly, take
place overnight between banks and financial institutions. The Federal Reserve can influence
the amount of cash in the economy by setting the Fed Funds rate, which, as a result, would
influence how much money is being circulated in the economy. Hence, changes in the Fed
Fund rates should, eventually, be reflected in the yield curve, i.e. affect the yield on bonds
with higher maturity as well as reflect economic activity.
2
2 Bond Portfolio Management (30 Points)
Consider the following Treasury bond data collected from different dates over the last two years:
Number Coupon Price Yield Maturity
Panel (a) Oct 5, 2018
1 2.75 99.74 2.88 2
2 2.88 99.11 3.07 5
3 2.88 97.00 3.23 10
4 3.00 92.47 3.40 30
Panel (b) Oct 7, 2019
5 1.50 100.06 1.47 2
6 1.50 100.50 1.40 5
7 1.63 100.55 1.56 10
8 2.25 104.28 2.06 30
Panel (b) March 20, 2020
9 1.13 101.57 0.31 2
10 1.13 103.25 0.46 5
11 1.50 106.20 0.85 10
12 2.00 114.17 1.42 30
Given the above table, address the following questions:
1. Use the pricing equation of a fixed-coupon bond to price each of the above bonds. I recommend
writing a function that takes yield, coupon, face value, and maturity as its main arguments.
The resulting prices should correspond to the ones reported above. Hence, you should plot
the computed prices against the reported ones. To confirm, you should observe a 45-degree
line. (6 Points)
2. Prices should reflect investors’ perception of future interest rates. Rather than computing
the prices using yields as the case in the previous question, in practice, it is the other way
around. We try to deduce yields from market prices. Hence, given a pricing function, you
need to find the yield that matches the market price. For each bond, find the implied yield
and plot it against the corresponding yield reported in the table above. Again, this should
result in a 45-degree line. (6 Points)
Hint: This relies on a numerical solution. Recall that the solution for function f is the x∗
that satisfies f(x∗) = 0. Since the price of the bond is a function of yield, i.e. f(y) = P ,
design a function g(y) = f(y)− P0, where P0 is fixed using the values from the above table.
As a result, the implied yield is the solution y∗ that satisfies g(y∗) = 0, i.e. f(y∗) = P . In R,
you may refer to the uniroot function. In Excel, this can be attained using “goalseek”.
3. Compute and report the Macaulay duration for each of the 12 US bonds. Ideally, you should
report this in three 2× 4 tables, where the first row corresponds to the bond number and the
3
second to the Macaulay duration. The first table refers to the data from 2018, the second
to 2019, and the third to 2020. Given these tables, how do they compare? Provide some
rationale. (6 Points)
4. Using first order Taylor expansion, calculate the change in the Treasury bond prices, if the
yield curve in the US shifts down by 25 bps. Focus only on the recent bond data to answer
this part, i.e. bonds numbered 9, 10, 11, and 12. To summarize, plot both the original and
new prices against maturity. How do you justify this observation? (6 Points)
Note: since you have a pricing function for a fixed coupon bond, you should confirm whether
the new price is correct. For instance, if the price P is a function of yield y, then we know
that price is P = f(y). To check whether your answer is correct, you should compare your
Taylor expansion results with the exact price, which would be P1 = f(y + ∆y).
5. Assume that the prices in the above table reflect the dollar price of each bond, e.g. the price
of bond 9 is $101.57. As a portfolio manager, you need to allocate $100,000 between bonds 9
and 10 from the above table. If you believe that the Federal Reserve will increase in the near
future, you need to limit your portfolio duration to 3 years. As a result, how many units of
each bond you need to purchase to satisfy this? How would your answer change if you target
a duration of 6 years instead? Explain why these numbers make sense. (6 Points)
6. Bonus Question Consider the details from the previous question. However, in this case,
you need to allocate $100,000 among the four Treasury bonds numbered 9, 10, 11, and 12. If
you are targeting a portfolio duration of 6 years, how many units of each bond you need to
buy? The position in each one of the four bonds should not be zero. (6 Points)
Hint: In this case, you need to satisfy two conditions by choosing four unknowns. This
results in an under-determined linear system of equations. To solve this, you need to think
in terms of a generalized solution. A possible suggestion is to look into a generalized matrix
inverse - for instance, see Moore-Penrose pseudoinverse (Wiki page). As a confirmation, check
whether the proposed solution satisfies the two requirements.
4
3 The Yield Curve (20 Points)
Part I
The yield curve is plot of the yield on bonds with differing terms to maturity but the same
credit risk, liquidity, and tax considerations. Over time, we have witnessed different shapes
• Upward-sloping: long-term rates are above short-term rates
• Flat: short- and long-term rates are the same
• Inverted: long-term rates are below short-term rates
Your first task is to show an empirical evidence for each of above shapes using real-data:
1. To do so, you need to download data for Treasury yields of different maturities using the
FRED database. In particular, you need to download data for the following codes DGS1MO,
DGS3MO, DGS1, DGS2, DGS5, DGS7, and DGS10. After merging and dropping missing
values, the final dataset is daily and dates between late July 31st, 2001 and March 19, 2020.
As a summary, you need to report a number of statistics for each maturity: mean, standard
deviation, skewness, and kurtosis. You should summarize your results in a 7× 4 table, where
rows refer to maturities and columns to statistics. (5 Points)
2. Given the data, you need to provide three plots of the yield curve from different dates in
which we witnessed one of the above three shapes, upward-sloping, flat, and inverted. (6
Points)
Part II
The theory of the term structure of interest rates tries to explain the following facts about the
yield curve
• Interest rates on bonds of different maturities move together over time.
• When short-term interest rates are low, yield curves are more likely to have an upward slope.
Alternatively, when short-term rates are high, yield curves are more likely to slope downward
and be inverted.
• Yield curves almost always slope upward.
Your second task is to empirically validate the above facts. My recommendations to pro-
vide a statistical evidence using the downloaded data to check each one of the above facts. You
may consider performing a statistical test with significance levels, but basic descriptive statistics
combined with qualitative description should suffice. (9 Points)
5
4 Forward Contracts and No-Arbitrage Pricing (20 Points)
Under no-arbitrage pricing it follows that future price of a stock index corresponds to the following
geometric Brownian motion (GBM):
ST = St × exp
(
(r − d− σ
2
2 )τ + σZτ
)
(1)
with r is the risk-free rate, d is the continuous annual dividend yield, and Zτ is a standard Brownian
motion.
To address the following questions, assume that r = 1.75% and σ = 0.2, while d = 0, i.e. the
underlying stocks of the index pay no dividends. Additionally, suppose that the spot price is $100.
Given this information, address the following questions:
1. Under no-arbitrage pricing, what is the fair value of a k-years forward contract on the above
stock index? Report your answer for k = 1, 2, 3, 4, 5. As a summary, plot the forward price
versus k. What does the graph say? (4 Points)
2. Repeat the previous part but using Monte Carlo simulation. In particular, you will need to
simulate the future price of the index for k = 1, 2, 3, 4, 5 years. Using a boxplot, plot the
distribution of the simulated price for each year and highlight the forward price. How does
your results compare with the previous part? (4 Points)
Hint: Remember the economic implications of the forward contract.
3. Suppose you have a long position in the above stock index and you are planning to liquidate
your position exactly one year from now.
• Using the 1-year forward contract, explain how would you hedge your position? Elabo-
rate (2 Points)
• Given the previous answer, you need to evaluate the profit and loss (PL) of the final
payoff of the hedged position. As a summary, report the Value-at-Risk of the hedged
position? Elaborate (2 Points)
4. Suppose that you are an arbitrageur and that the market price of the 1-year forward contract
is trading $0.25 lower than the price you computed in the first part of this question. Describe
a trading strategy that would exploit this mispricing. As a summary, you need to simulate
and plot two price paths in which the future stock index either increases or decreases. For
each scenario, how does your arbitrage strategy perform? Elaborate (4 Points)
5. An assumption of the risk-neutral and, hence, the no-arbitrage pricing is that r is constant
over time. Suppose after executing your arbitrage strategy the Fed cuts the interest rate
by 50 basis points exactly six months after. How does this affect your arbitrage strategy?
Elaborate (4 Points)

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!