全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
4169 9
2015-01-08
M/M/1队列问题:
顾客访问银行按照 Poisson process at an average rate of 12 per hour;
平均每个顾客的服务时间为2 minutes, Exponential 分布如下:


%let n=100;
data have;
  call streaminit(1234567);
  do i =1 to &n;
    arriveT=60/12*rand('EXPONENTIAL');
    serviceT =2*rand('EXPONENTIAL');
    clockT ++arriveT;
    output;
  end;
  format arriveT serviceT clockT f10.3;
run;

问题是:某个顾客访问时发现不得不等候的概率是多大?理论上p =2/(60/12)=0.4.
如何利用SAS模拟这一过程,并估算以上概率?
It should contain clock time on each arrival time, leaving time, number of people in queue, etc.
M/M/1的1代表只有一个服务台。服务的方式是先来先得。可以利用以上的程序模拟出100个顾客的到达时间间隔和占有服务的时间。
JingJu


二维码

扫码加我 拉你入群

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

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

全部回复
2015-1-8 13:17:44
请教一下:do id =100;  这句是干什么用的?
二维码

扫码加我 拉你入群

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

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

2015-1-8 21:53:52
teqel 发表于 2015-1-8 13:17
请教一下:do id =100;  这句是干什么用的?
Sorry. It was a typo. JingJu
复制代码
二维码

扫码加我 拉你入群

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

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

2015-1-8 23:05:07
jingju11 发表于 2015-1-8 21:53
Sorry. It was a typo. JingJu
复制代码
最终没有得到想要的结果,感觉很奇怪,思路似乎并没有错误,但是计算出来的wait都是1。
二维码

扫码加我 拉你入群

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

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

2015-1-8 23:11:26
第一次看jingju提问
二维码

扫码加我 拉你入群

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

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

2015-1-8 23:17:00
mingfeng07 发表于 2015-1-8 23:05
最终没有得到想要的结果,感觉很奇怪,思路似乎并没有错误,但是计算出来的wait都是1。
here the arrivetime is time interval between incoming clients.
you may know Poisson Process in which the time interval between two arrived customers is followed by exponential dist.
for example:
Arrivetime ={1.35, 3.44, 0.6, 1.9...} mean
set clock =0 first.
the first one comes at 1.35
the second comes at 1.35+3.44=4.79
the third comes at 4.79+0.6=5.39
...
JingJu
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群