Question The question is about OLS regression. Q2 (1) In[34]: #adivgr2 =… Image transcription textData are from the Center for Researchin Security Prices (CRSP). The twomonthly series from CRSP… Show more… Show moreImage transcription textQ2- {??pts} Predictability 1. [201313)Run the fer-?owing ULS regression Mm:= Ha + ?apdr+ 1+}! {1} for I: … Show more… Show moreThe question is about OLS regression. Q2 (1) In [34]:#adivgr2 = log(DivAA[1:]) – log(DivAA[:-1])#adivgr = np.squeeze(adivgr2,axis=1)from sklearn.linear_model import LinearRegressiondiv_t = np.squeeze(DivA,axis=1)adivgr = np.log(div_t[1:]) – np.log(div_t[:-1])lhsh1 = adivgr[1:].reshape(-1,1)lhsh2 = adivgr[2:].reshape(-1,1)lhsh3 = adivgr[3:].reshape(-1,1)lhsh4 = adivgr[4:].reshape(-1,1)lhsh5 = adivgr[5:].reshape(-1,1)?rhsh1 = np.hstack((np.ones((len(lhsh1),1)), DivAnnual[1:-1]))rhsh2 = np.hstack((np.ones((len(lhsh2),1)), DivAnnual[1:-2]))rhsh3 = np.hstack((np.ones((len(lhsh3),1)), DivAnnual[1:-3]))rhsh4 = np.hstack((np.ones((len(lhsh4),1)), DivAnnual[1:-4]))rhsh5 = np.hstack((np.ones((len(lhsh5),1)), DivAnnual[1:-5]))?model1 = LinearRegression().fit(rhsh1,lhsh1)model2 = LinearRegression().fit(rhsh2,lhsh2)model3 = LinearRegression().fit(rhsh3,lhsh3)model4 = LinearRegression().fit(rhsh4,lhsh4)model5 = LinearRegression().fit(rhsh5,lhsh5) In [35]:print(model1.score(rhsh1,lhsh1))print(model1.intercept_[0])print(model1.coef_[0][1])0.0054602882699797960.0006179187475656566-0.0006386824816410918 The code above are provided by the professorImage transcription textX returns. csy * o O X La A E % FFIC B2 X 0.00649 A B C D E F 1 datereturns 2 8/17/1971 0.00649 -0.3173 3 8/18/1971 -0.01293 -0.0785 48/19/1971 -0.00444 -0.1044 5 8/20/1971 0.001845 0.0703 … Show more… Show moreImage transcription textX dummy.csy + o’ Zhu Yanzong ZY X X1+ % Al X v fx time AB C D E F G H time Random-1 Random Random2 Random3Random4 2 19460131 0.069504 0.068515 0.00… Show more… Show more The two pictures above are the document for the question. Could you please help me solve the problem? Idk how to adjust the program and not sure about what beta_h and dt are. Computer Science Engineering & Technology Python Programming FIN 451 Share QuestionEmailCopy link Comments (0)