pf_Beta
简述
组合-Beta
pf_Beta(t1:Array;fName1:String;t2:Array;fName2:String):Float
名称 | 类型 | 说明 |
---|
t1 | Array | 组合收益率序列 |
fName1 | String | t1数组中,代表收益率序列的字段名(涨幅、收益率等) |
t2 | Array | 基准收益率序列 |
fName2 | String | t2数组中,代表收益率序列的字段名(涨幅、收益率等) |
返回 | Float | 实数 |
即组合收益率序列与基准收益率序列的回归斜率
//此处以浦发银行收益率序列作为用户组合的收益率序列,基准为上证指数
stockid := 'SH600000';
IndexId := 'SH000001';
BegT := inttodate(20110101);
EndT := inttodate(20110630);
setsysparam(pn_date(),EndT);
n := tradedays(begt,endt);
t := nday(n,'日期',sp_time(),'涨幅1',spec(StockZf3(),stockid),'涨幅2',spec(StockZf3(),IndexId));
return pf_Beta(t,'涨幅1',t,'涨幅2');
//返回结果:0.97