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
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.

• QQ：99515681
• 邮箱：99515681@qq.com
• 工作时间：8:00-23:00
• 微信：codinghelp