楼主: shuiqq19840621
1336 1

[原创博文] 求教 [推广有奖]

  • 0关注
  • 0粉丝

大专生

48%

还不是VIP/贵宾

-

威望
0
论坛币
108 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
308 点
帖子
46
精华
0
在线时间
29 小时
注册时间
2009-9-3
最后登录
2009-12-9

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
朱世武老师程序中的问题?
/* 产生样本债券SampFbd050131未来现金流与对应的时刻 */
data SampFbd050131;  
set ResDat.SampFbd050131;
if freq=0 then _t=Yrstmat+1e-12;                       else _t=mod(yrdif(date,matdt,'act/act'),1/Freq);   /*_t为当前日到下一个付息的时间  */
if mod(_t,1)=0 then do;
_t=_t+1e-12;      /* 正好付息日时,因为_t为整数时,包含_t的函数没有结果 */
end;
run;
data tbond_info;  
set SampFbd050131;
if freq=0 then do;
t=_t;
output;
end;
else do t=_t to Yrstmat by 1/freq; /* 产生现金流对应的时刻 */
output;
end;
proc sort;
by resbdid;
data tbond_info;
set tbond_info;
if In***=2 and last.resbdid=0 then CF=couprt*par/freq;  /*到期日前附息债产生的现金流*/
if In***=2 and last.resbdid=1 then CF=couprt*par/freq+par;  /*到期日附息债产生的现金流*/
if In***=0 and last.resbdid=0 then CF=0; /*到期日前贴现债现金流*/
if In***=0 and last.resbdid=1 then CF=par; /*到期日贴现债现金流*/
if In***=1 and last.resbdid=0 then CF=0; /*到期日前零息票债现金流*/
if In***=1 and last.resbdid=1 then CF=par+couprt*par*maturity; /*到期日贴现债现金流*/
by resbdid;
run;
/* 数据集tbond_info增加了3个变量:
_t为当前日到下一个付息的时间
t:现金流发生时间
CF:现金流量 */
问题一:为什么这里if freq=0 then _t=Yrstmat+1e-12;      要加上1e-12?
问题二:by resbdid;是什么意思?
问题三:if In***=2 and last.resbdid=0 then CF=couprt*par/freq;  /*到期日前附息债产生的现金流*/ 这一行又是什么意思?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:maturity output ResDat 是什么意思 outpu 现金流 程序 样本

沙发
nkwilling 发表于 2009-9-11 10:19:24 |只看作者 |坛友微信交流群
如果你连set datset;by variable中的by意思都不知道,你最好还是先看看base sas.

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-22 12:42