- 0
- 0
- 约2.07千字
- 约 4页
- 2023-12-10 发布于北京
- 举报
ForecastinginFinanceandEconomicSilinHeMAief
ProblemSet3
1.
1)
sp500=hist_stock_data31122011,^GSPC)
y=sp500.AdjClose(end:-1:1);
date=datenum(sp500.Date);
rdate=date(end:-1:1)/365.25;
x=rdate-rdate(1);
logy=log(y);
[beta1,se1,res1,logyhat1,r21]=ols(logy,x,1);
subplot(2,1,1)
plot(rdate,logy);
holdon
plot(rdate,logyhat1);
gridon
xlabel(year);
ylabel(SP500);
subplot(2,1,2)
plot(rdate,res1);
gridon
xlabel(year);
ylabel(residual);
ForecastinginFinanceandEconomic
原创力文档

文档评论(0)