联系方式

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

您当前位置:首页 >> Algorithm 算法作业Algorithm 算法作业

日期:2019-12-11 10:02

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
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp