【问题标题】:Matlab regression returns beta coffecient not right?Matlab回归返回β系数不正确?
【发布时间】: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


【解决方案1】:

傻大个,我换成:

retIdx,o,h,l,clI]=YahooGetData(symIdx, priords, now,'d')

不使用符号。啊!对此感到抱歉

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-05
    • 2013-03-15
    • 2018-10-02
    • 2015-01-04
    相关资源
    最近更新 更多