Assignment #6
Question 1: Probit Recession Forecast
Forecast the recession probability in the US by regressing a binary recession variable on the yield spread.
1. Get data. Using the ‘quantmod’ library, read in the monthly recession variable ‘USREC’ and the
10-year to 3-month yield spread ‘T10Y3MM’ from FRED into R.
2. Produce a nice graph. Convert both variables into time series and cut them to the same length
using the window() command. Plot the yield spread and use ‘nberShade’ from the ‘tis’ package
to add recession shading to your graph.
3. Find the best lag of the yield spread. In a loop, regress the recession variable on lag 0 to the 10th
lag of the yield spread using a probit model. Create an empty vector ‘GF’ outside the loop with
11 elements. In each loop save the loglikelihood as a goodness of fit measure in the i’th element
of the vector. Plot the Loglikelihood on the respective number of lags, which lag has the highest
explanatory power? Remember that your X-axis should start at 0, not 1.
4. Use this lag to forecast the probability of recession in the US for the next 6 months. Produce a
graph of the forecast.
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。