楼主: qyj8888
1507 2

[原创博文] pro iml 求高手指教 [推广有奖]

  • 0关注
  • 0粉丝

博士生

67%

还不是VIP/贵宾

-

威望
0
论坛币
999 个
通用积分
0.0600
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1168 点
帖子
182
精华
0
在线时间
406 小时
注册时间
2008-10-20
最后登录
2022-6-8

楼主
qyj8888 发表于 2009-12-29 20:49:20 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
1. Suppose the stock price
follows a geometric brownian motion of


,

where
is the drift rate,

is the variance rate, and

is the standard Wiener process with
~ . Assume that , , and . Simulate the stock price movement for one year 1000 times.


(1)
Plot the distributions of the stock price and of the logarithm of the stock price at the end of each quarter.


(2)
Compute the means and standard deviations of the stock price and the logarithm of the stock price
at the end of each quarter. Compare them to their theorectical values.


data a;
do i=1 to 252;
do roll=1 to 10;
observation = i;
e=rannor(0);
pribeg=. ;
priend=. ;
end;
output;
end;
run;

%let mu=0.15 sigma=0.20 s0=50 t=252;

proc iml;
use a;
read all var {observation e pribeg priend} into x;
if i=1 then do;
x[i,3]=50;
x[i,4]=x[i,3]+mu*(1/t)*s0+sigma*sqrt(1/t)*x[i,2]*s0;
end;
        do i = 2 to nrow(x);
     x[i,3] = x[i-1,4];
        x[i,4] = x[i,3]+mu*(1/t)*s0+sigma*(1/t)**(1/2)*x[i,2]*s0;
  end;
  create final from x;
  append from x;
quit;
run;

拟模拟股票价格走势,但iml出现问题,求高手帮忙看看~~
二维码

扫码加我 拉你入群

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

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

关键词:求高手 distribution observation deviations GEOMETRIC standard process quarter price where

回帖推荐

bayga0002 发表于2楼  查看完整内容

1# qyj8888 data a; do i=1 to 252; do roll=1 to 10; observation = i; e=rannor(0); pribeg=. ; priend=. ; output; end; end; run; %let mu=0.15 ; %let sigma=0.20; %let s0=50 ; %let t=252; proc iml; use a; read all var {observation e pribeg priend} into x; x[1,3]=50; x[1,4]=x[1,3]+&mu*(1/&t)*&s0+&sigma*sqrt(1/&t)*x[1,2]*&s0; do i = 2 to nrow(x); x = x; x = x+& ...

本帖被以下文库推荐

沙发
bayga0002 发表于 2009-12-29 21:43:56
1# qyj8888
data a;
do i=1 to 252;
do roll=1 to 10;
observation = i;
e=rannor(0);
pribeg=. ;
priend=. ;
output;
end;
end;
run;

%let mu=0.15 ;
%let sigma=0.20;
%let s0=50 ;
%let t=252;

proc iml;
use a;
read all var {observation e pribeg priend} into x;
x[1,3]=50;
x[1,4]=x[1,3]+&mu*(1/&t)*&s0+&sigma*sqrt(1/&t)*x[1,2]*&s0;
  do i = 2 to nrow(x);
     x[i,3] = x[i-1,4];
        x[i,4] = x[i,3]+&mu*(1/&t)*&s0+&sigma*(1/&t)**(1/2)*x[i,2]*&s0;
  end;
  create final from x;
  append from x;
quit;
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

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

藤椅
qyj8888 发表于 2009-12-29 23:00:38
谢谢LS的~~~~

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-9 03:15