复合泊松过程的实现.doc

上传人:w****2 文档编号:6554507 上传时间:2020-02-28 格式:DOC 页数:11 大小:103.50KB
返回 下载 相关 举报
复合泊松过程的实现.doc_第1页
第1页 / 共11页
复合泊松过程的实现.doc_第2页
第2页 / 共11页
复合泊松过程的实现.doc_第3页
第3页 / 共11页
点击查看更多>>
资源描述
电子信息与通信工程学院实验报告实验名称非其次泊松过程课程名称随机信号分析姓名顾康学号U201413323日期6.13地点南一楼成绩教师董燕1. 题目 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 to generate N(8) and then the arrival times in the interval(0,8,draw the respective histograms showing hour5y arrival counts.(a)由定理 设(),其中为一常数,而,为参数的齐次泊松过程的事件发生的时刻,对每个,以概率()进行保留,以概率()舍弃,由此得到的序列(),(),(),是强度为()的非齐次泊松过程事件发生的时刻。 证明显然,(),(),(),是,的稀疏。 设 非齐次泊松过程()在(,中有一个事件发生, 齐次泊松过程()在(,中有一个事件发生, 则有 ()()()()()/ = ()(), 由此可知从,中选出的序列(),(),(),满足非其次泊松过程的性质。根据定理,先产生齐次泊松过程事件发生的时刻,再按概率稀疏就得到非齐次泊松过程事件发生时刻,步骤如下() 产生参数的齐次泊松过程的前事件发生的时刻,( 2 )产生(,)上的随机数,若(),保留,否则舍弃()将保留的,分别记为(),(),()并输出即可(a) . CODE syms t namdanamda=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:size x=rand(1); y(i)=-log(x)./mu;%产生send for i=1:1:times for j=1:1:size x=rand(1); temp=subs(namda,t,8+y(j); if x temp/mu%筛选过程 z(i)=y(j); Break; end endend T(1)=0; for k=1:1:times for i=2:k T(i)=T(i-1)+z(i); endend plot(T)X=1:1:80;(b) 关于产生N(8),只需应用公式: PN(t)=n=exp(-t)* (t)n/n! 而关于在(0,8内的到达次数,原理与(a)相同,只需修改代码的边界条件。(b).code part times=8; z=zeros(1,100); for j=1:1:80; mu=int(namda,0,j/10); z(j)=exp(-mu)*(mu)times/factorial(times); end plot(z) set(handles,xtick,0:0.1:10); (b).code part syms t namdanamda=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=300;%更改到达次数y=zeros(1,size);z=zeros(1,times);T=zeros(1,times); mu=20; for i=1:1:size x=rand(1); y(i)=-log(x)./mu;%产生send for i=1:1:times for j=1:1:size x=rand(1); temp=subs(namda,t,8+y(j); if x temp/mu%筛选过程 z(i)=y(j); break end endend T(1)=0; for k=1:1:times for i=2:k T(i)=T(i-1)+z(i); endend plot(T)axis(0 200 0 8);%限制时间0,82. 题目 Consider the problem described 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 3 waiting spaces.A waiting 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)的隐式方程组。注意到该题条件的特殊性在于有两台处理器同时工作。例2.3.6的推导过程可以借鉴:Po(t+h)=PX(t+h)=0=PX(t)=k,X(t+h)=0. .1随后将右式展开Po(t+h)=Po(t)1-(t)+o(h)+P1(t)h+o(h)+o(h) =Po(t)1-(t)+P1(t)h+o(h)随后等式两端同减Po(t),并除以h得Po(t)=- (t)Po(t)+ P1(t).2注意到这里S=2,将1式推广至n:当1nS, Pn(t+h)=PX(t+h)=n=PX(t)=k,X(t+h)=n.3展开3式 Pn(t+h)=Pn-1(t)(t)h+o(h)+Pn(t) 1-(t)h-nh+o(h)+Pn+1(t) (n+1)h+o(h)+o(h). 再应用2式相同的方法Pn(t+h)=(t)Pn-1(t)+(n+1)hPn+1(t)- (t)+nPn(t) 1S最终得到了我需要的用以构建隐式方程组的递推公式基于以上结论,我以矩阵形式构造了方程组,并利用matlab ode45 解出了P.2.2CODEfunction y=random3()%主函数y0=1,0,0,0,0,0; t,y=ode45(odefun,0,8,y0);%四阶-五阶Runge-Kutta算法plot(t,y(:,6);%从矩阵中取得我关心的P5xlabel(t);ylabel(loss probability);title(P5); Endfunction 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.293*cos(pi*t/6.04); mu=3.5;%exponetial rate B= 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;%复杂的方程组简化为矩阵运算end 8am 4pm 8pm 4pm 对比(t) 与 P5,峰值同样在相近的时间达到参考文献:1.非齐次泊松过程的仿真方法-宁如云
展开阅读全文
相关资源
相关搜索

当前位置:首页 > 临时分类 > 人文社科


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!