楼主: niuniuyiwan
6060 5

[MATLAB] 单因素vasicek模型在Matlab中的实现 [推广有奖]

  • 7关注
  • 91粉丝

VIP

学科带头人

89%

还不是VIP/贵宾

-

威望
0
论坛币
12644 个
通用积分
1551.1638
学术水平
1116 点
热心指数
1164 点
信用等级
1058 点
经验
8347 点
帖子
1625
精华
1
在线时间
2447 小时
注册时间
2010-10-10
最后登录
2024-4-26

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
  1. %Parameters initial valus for one factor Vasicek model
  2. alpha=1.3;
  3. gamma=0.05;
  4. rho=0.06;
  5. q=0.1;
  6. Maturity=3;
  7. rInit=0.05;
  8. NbStep=1000;
  9. DeltaT=Maturity/NbStep;
  10. %Initialisation of the answer vector
  11. r=zeros(1,NbStep);
  12. r(1)=rInit;

  13. %For each step, we simulate the rate following the model
  14. for i=2:NbStep
  15.      r(i)=r(i-1)+alpha*(gamma-r(i-1))*DeltaT+ ...
  16.              rho*sqrt(DeltaT)*randn(1);
  17. end
  18. %Parameters of model to rate R.
  19. RInfinity=gamma+rho*q/alpha-rho^2/(2*alpha^2);

  20. %Vector of time steps
  21. t=[0:1:NbStep-1]*DeltaT;

  22. %Computation of rates for the points represented in vector r
  23. R=RInfinity + ...
  24.     (r-RInfinity).*(1-exp(-alpha*(Maturity-t)))./(alpha*(Maturity-t))+ ...
  25.     rho^2.*((1-exp(-alpha*(Maturity-t))).^2)./(4*alpha^3*(Maturity-t));

  26. %Graph of the interest rate as function of maturity
  27. plot([t,Maturity],[R,rInit]);
  28. ylabel('R[t,T]');
  29. xlabel('t');
复制代码

vasicek1factor.png


二维码

扫码加我 拉你入群

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

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

关键词:Vasicek MATLAB matla atlab ASIC 模型

已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 100 + 100 + 5 + 5 + 5 精彩帖子

总评分: 经验 + 100  论坛币 + 100  学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

沙发
xddlovejiao1314 学生认证  发表于 2015-7-1 18:47:52 |只看作者 |坛友微信交流群
谢谢分享。

使用道具

藤椅
wfh仰望星空 发表于 2015-7-15 12:46:21 |只看作者 |坛友微信交流群
感谢大侠

使用道具

板凳
464094729@qq 发表于 2015-8-31 09:15:03 |只看作者 |坛友微信交流群
谢谢分享。

使用道具

报纸
sara_mongol 发表于 2018-1-27 20:01:55 |只看作者 |坛友微信交流群
弱弱的问下哦,这个里的数据是在哪里导入的

使用道具

地板
水轻轻 发表于 2018-11-8 14:02:41 |只看作者 |坛友微信交流群
sara_mongol 发表于 2018-1-27 20:01
弱弱的问下哦,这个里的数据是在哪里导入的
这个只是模拟,实际数据要把代码改一下

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

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

GMT+8, 2024-4-27 04:56