首页 > > 详细

data课程作业代做、代写nberShade作业、代做R课程设计作业、代写R编程语言作业代写R语言编程|代写留学生 Statistics统计、回归、迭代

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.

联系我们 - QQ: 99515681 微信:codinghelp2
© 2014 www.7daixie.com
程序代写网!