【发布时间】:2014-11-05 04:59:30
【问题描述】:
我正在尝试使用 regstat 之类的回归来计算 beta 系数。我的 Matlab 代码如下所示:
%get stock
sym = 'F'
%calculaltes returns with output of standard Open High Low Close
[o,h,l,clS]=YahooGetData(sym, priords, now,'d')
y = diff(clS)
%index like S&P 500
symIdx='^GSPC'
[o,h,l,clI]=YahooGetData(sym, priords, now,'d')
x = diff(clI)
mdl = regstats(x,y)
无论我使用什么股票代码,我的 beta 系数总是返回 1 和 0。有什么理由吗?你觉得我做错了什么?我也使用 polyfit 得到了相同的结果。
谢谢
【问题讨论】:
-
如果这是 Matlab,那么就不是 R。
标签: matlab