复合泊松过程的实现

上传人:新** 文档编号:498098983 上传时间:2023-01-03 格式:DOCX 页数:11 大小:87.96KB
返回 下载 相关 举报
复合泊松过程的实现_第1页
第1页 / 共11页
复合泊松过程的实现_第2页
第2页 / 共11页
复合泊松过程的实现_第3页
第3页 / 共11页
复合泊松过程的实现_第4页
第4页 / 共11页
复合泊松过程的实现_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《复合泊松过程的实现》由会员分享,可在线阅读,更多相关《复合泊松过程的实现(11页珍藏版)》请在金锄头文库上搜索。

1、茅电子信息与通信工程学院实验报告实验名称 非其次泊松过程课程名称随机信号分析姓名顾康学号U日期6.13地点南一楼成绩教师董燕1 / 111.题目Consider the nonhomogeneous Poisson process with its intensity function spectified in Example2.3.6. (a) Write a MATLAB program to generate (stimulate) the first eighty arrival times. (b) Given t=8(hours),write a Matlab program t

2、o generate N(8) and then the arrival times in the interval(0,8,draw the respective histograms showing hour5y arrival counts.(a)由定理 设入(t)W入,其中入为一常数,而sl,s2,sn,为 参数入的齐次泊松过程的事件发生的时刻,对每个si,以概率入(si)/入 进行保留,以概率l 入(si)/入舍弃,由此得到的序列s (l), s(2),, s(n),是强度为入(t)的非齐次泊松过程事件发生的时刻。证明显然,s(l),s(2),,s(n),是 sl,s2,,sn, 的

3、稀疏。设 A= 非齐次泊松过程N (t)在(t, t + h中有一个事件发生,B=齐次泊松过程N(t)在(t,t+h中有一个事件发生,则有 P(AB)=P(B)P(A|B) = (入 h + o(h)入(七) /入二 入(t )h + o(h),由此可知从sl, s2,,sn,中选出的序列s (l) , s(2),, s(n),.满足非其次泊松过程的性质。根据定理,先产生齐次泊松过程事 件发生的时刻,再按概率稀疏就得到非齐次泊松过程事件发生时刻,步骤如下(1)产生参数入的齐次泊松过程的T前事件发生的时刻sl,s2,,sn .(2 )产生(0,l)上的随机数xi,若xiW入(si)/入,保留si

4、 , 否则舍弃si(3)将保留的si,分别记为s(l),s(2),,s(k )并输 出即可(a). CODEsyms t namda namda=8.924-1.584*cos(pi*t/1.51)+7.897*sin(pi*t/3.02)-10.434*cos(pi*t/4.53)+4.293*cos(pi*t/6 .04);size=1000;%产生s的多少times=80; %到达次数y=zeros(1,size);z=zeros(1,times);T=zeros(1,times);mu=34;for i=1:1:sizex=rand(1);y(i)=-log(x)./mu;% 产生se

5、ndfor i=1:1:timesfor j=1:1:sizex=rand(1);temp=subs(namda,t,8+y(j);if x temp/mu%筛选过程z(i)=y(j);Break;endendendT(1)=0;for k=1:1:timesfor i=2:kT(i)=T(i-1)+z(i);end endplot(T)X=1:1:80;(b)关于产生N(8),只需应用公式:PN(t)=n=exp (-入t)* (入t厂n/n!而关于在(0,8 内的到达次数,原理与(a)相同,只需修改代码的边界条件。(b) code part Itimes=8;z=zeros(1,100);

6、for j=1:1:80;mu=int(namda,0,j/10);z(j)二exp(-mu)*(mu) ti mes/fac to rial (ti mes);endplot(z)set(handles,xtick,0:01:10);(b) code part IIsyms t namdanamda=8924-1584*cos(pi*t/151)+7897*sin(pi*t/302)-10434*cos(pi*t/453)+42 93*cos(pi*t/604);size=1000;%产生s的多少times=300;%更改到达次数y=zeros(1,size);z=zeros(1,times

7、);T=zeros(1,times);mu=20;for i=1:1:sizex=rand(1);y(i)=log(x)./mu;% 产生s endfor i=1:1:timesfor j=1:1:sizex=rand(1); temp=subs(namda,t,8+y(j);f x temp/mu%筛选过程 z(i)=y(j);breakendendendT(1)=0;for k=1:1:timesfor i=2:kT(i)=T(i-1)+z(i);endendplot(T)axis(0 200 0 8);%限制时间0,82.题目Consider the problem described

8、in Example 2.3.9.Suppose mow that we have two identical HP computers to handle the incoming traffic.Assume that the service time of each computer is exponential with a rate of 3.5 per hour(so the aggregate total service rate is still 7 per hour ).Again we assume that there are 3waiting spaces.A wait

9、ing customer will be served ny the first computer that becomes free on a first-come-first-served basis.Compute the loss probabilities as a function of time t over the interval (0,8.Plot your result s and compsre them agianst those shown in Figure 2.7.2.1基于之前的例题,可以确定解题思路是构造关于Pn(t)的隐式方程组。注意 到该题条件的特殊性在

10、于有两台处理器同时工作。例2.3.6的推导过程可以借鉴:Po( t+h)=PX( t+h)=0 = EPX( t)=k,X( t+h)=01随后将右式展开Po(t+h)=Po(t)1-入(t)+o(h)+Pl(t) 口 h+o(h)+o(h) =Po(t)1-入(t)+P1(t) 口 h+o(h)随后等式两端同减Po(t),并除以h得Po (t)=-入(t)Po(t)+ 口Pl(t).2 注意到这里S=2,将1式推广至n:当lnWS,Pn (t +h)=PX( t+h)=n = EPX( t)=k,X( t+h)=n3展开3式Pn(t+h)=Pn-1 (t)入(t)h+o(h)+Pn (t)

11、1-入(t)h-n 口 h+o(h)+Pn+l(t) (n+1) 口 h+o(h)+o(h).再应用2式相同的方法P n(t+h)=入(t)Pn-1 (t) + (n+1) U hPn+1 (t)-入(t)+nuPn(t)1S最终得到了我需要的用以构建隐式方程组的递推公式基于以上结论,我以矩阵形式构造了方程组,并利用matlabode45解出了 P.2.2CODEfunc tion y二random3()% 主函数 y0=1,0,0,0,0,0;t,y=ode45(odefun,0,8,y0);%四阶-五阶 Runge-Kutta 算法 plot(t,y(:,6);%从矩阵中取得我关心的P5

12、xlabel(t);ylabel(loss probability); title(P5);Endfunc tion dx=odefun( t,x)%构造隐式方程组,子函数namda=8.924-1.584*cos(pi*t/1.51)+7.897*sin(pi*t/3.02)-10.434*cos(pi*t/4.53)+4.2 93*cos(pi*t/6.04);mu=3.5;%exponetial rateB= x(1),x(2),x(3),x(4), x(5),x(6);C=-namda, mu , 0 , 0 , 0 ,0 ;namda,-(namda+mu),2*mu,0,0,0;0,namda,-(namda+2*mu),2*mu,0,0;0,0,namda,-(namda+2*mu),2*mu,0;0,0, 0, namda,-(namda+2*mu),2*mu;0,0, 0,0, namda, -2*mu ;dx=C*B;%复杂的方程组简化为矩阵运算end8am4pm芒三qmqojd 550-对比入(t)与P5,峰值同样在相近的时间达到参考文献:1.非齐次泊松过程的仿真方法-宁如云精心整理,希望对您有所帮助!

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号