数据是一个企业的若干月份的股票回报以及市场回报和行业回报。想要求残差。
回归就用 reg return market ind
但是需要月份数据滚动回归,然后求残差。具体而言
1.使用本企业前60个月的数据进行回归。用所得回归系数与本年数据计算本年各个月份的残差。
to obtain residual for IBM between January 1990 and December 1990, we first estimate above equation using monthly returns from January 1985 through December 1989. Using the estimated coefficients and the factor returns from January 1990 through December 1990, we use above equation to compute the expected return and idiosyncratic returns
这是计算的原文,应该跟我理解一致。
2.在计算完本年残差之后,同样的过程,滚动到下一年求残差。
3.一个企业完成上述过程之后,继续第二个企业。。。(我企业样本一千多)
请教这个程序应该如何编写啊?
感谢各位了!
注:所附数据是从1996年1月开始到2012年12月结束。也就是说前五年是没有残差的。应该是2001年的残差是用前五年回归的系数乘以2001年各个月份的数值得到。后续几年以此类推。



雷达卡




京公网安备 11010802022788号







