楼主: fabregasmu
14096 9

[讨论交流] Matlab描述几何布朗运动(GBM)的代码,为什么要用rand(),不用normrnd()函数 [推广有奖]

  • 4关注
  • 0粉丝

硕士生

19%

还不是VIP/贵宾

-

威望
0
论坛币
1807 个
通用积分
0.6178
学术水平
2 点
热心指数
6 点
信用等级
0 点
经验
2306 点
帖子
94
精华
0
在线时间
128 小时
注册时间
2012-9-27
最后登录
2019-2-6

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
wenti.JPG wenti1.JPG 问题一:布朗运动经过时间,则布朗运动的改变量,不是服从均值为0,标准差为的正态分布吗?为什么自己用这样的代码标出来的图像明显不是股价图形呢,我理解是布朗运动的增量太大了,但按照定义,不就应该是这样写代码吗??
二维码

扫码加我 拉你入群

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

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

关键词:MATLAB atlab matla 布朗运动 Norm 正态分布 标准差

回帖推荐

Chemist_MZ 发表于4楼  查看完整内容

rand肯定是错的,可以用randn,或者你说的noramrnd

Chemist_MZ 发表于11楼  查看完整内容

That's it. This is correct. If you want to make it better, choose a smaller time interval, as small as possible (as long as you do not run out of memory). Another thing is your time horizon is 15 years... try some shorter time horizon like 1 year as I recommended. You usually do not see a 15 years stock graph, that's probably the reason why you don't feel it looks like a stock process.

Chemist_MZ 发表于7楼  查看完整内容

No I don't see there is problem in your code. Choose some reasonable parameters such as sigma=0.3, Lt=1; step=1/252, mu=0.15. It should looks good.

本帖被以下文库推荐

沙发
fabregasmu 学生认证  发表于 2014-10-23 18:10:10 |只看作者 |坛友微信交流群
第二个问题,第一张图片里的dw=0+0.1*rand(1,1),不是应该写成dw=0+sqrt(0.1)*normrnd(0,1)吗???

使用道具

藤椅
fabregasmu 学生认证  发表于 2014-10-23 18:14:42 |只看作者 |坛友微信交流群
12321321.JPG 12113.JPG
按照第一不是应该这样吗??

使用道具

板凳
Chemist_MZ 在职认证  发表于 2014-10-24 08:34:54 |只看作者 |坛友微信交流群
fabregasmu 发表于 2014-10-23 18:10
第二个问题,第一张图片里的dw=0+0.1*rand(1,1),不是应该写成dw=0+sqrt(0.1)*normrnd(0,1)吗???
rand肯定是错的,可以用randn,或者你说的noramrnd

使用道具

报纸
Chemist_MZ 在职认证  发表于 2014-10-24 08:36:45 |只看作者 |坛友微信交流群
fabregasmu 发表于 2014-10-23 18:10
第二个问题,第一张图片里的dw=0+0.1*rand(1,1),不是应该写成dw=0+sqrt(0.1)*normrnd(0,1)吗???
correct

使用道具

地板
Chemist_MZ 在职认证  发表于 2014-10-24 09:25:22 |只看作者 |坛友微信交流群
No I don't see there is problem in your code. Choose some reasonable parameters such as sigma=0.3, Lt=1; step=1/252, mu=0.15. It should looks good.
已有 1 人评分经验 论坛币 收起 理由
见路不走 + 5 + 5 热心帮助其他会员

总评分: 经验 + 5  论坛币 + 5   查看全部评分

使用道具

7
fabregasmu 学生认证  发表于 2014-10-24 12:18:11 |只看作者 |坛友微信交流群
感谢大神!刚才在Matlab上试过了,感觉图像有点像股票走势了,但是为什么用rand()来做效果更好呢?更像股票数据呢?

使用道具

8
fabregasmu 学生认证  发表于 2014-10-24 12:18:45 |只看作者 |坛友微信交流群
Chemist_MZ 发表于 2014-10-24 09:25
No I don't see there is problem in your code. Choose some reasonable parameters such as sigma=0.3, L ...
感谢大神!刚才在Matlab上试过了,感觉图像有点像股票走势了,但是为什么用rand()来做效果更好呢?更像股票数据呢?

使用道具

9
fabregasmu 学生认证  发表于 2014-10-24 12:25:51 |只看作者 |坛友微信交流群
Chemist_MZ 发表于 2014-10-24 09:25
No I don't see there is problem in your code. Choose some reasonable parameters such as sigma=0.3, L ...
然而.JPG
大神,这是用调整后 mu=0.15  sigma=0.3 lt=15之后Matlab做出来的数据,感觉为啥有点不像股票数据走势图呢?谢大神!!

使用道具

10
Chemist_MZ 在职认证  发表于 2014-10-24 20:00:08 |只看作者 |坛友微信交流群
fabregasmu 发表于 2014-10-24 12:25
大神,这是用调整后 mu=0.15  sigma=0.3 lt=15之后Matlab做出来的数据,感觉为啥有点不像股票数据走势图 ...
That's it. This is correct. If you want to make it better, choose a smaller time interval, as small as possible (as long as you do not run out of memory). Another thing is your time horizon is 15 years... try some shorter time horizon like 1 year as I recommended. You usually do not see a 15 years stock graph, that's probably the reason why you don't feel it looks like a stock process.

使用道具

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

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

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

GMT+8, 2024-4-27 21:36