概述
%泊松过程的模拟、检验及参数估计
syms Un X S;
n=10;%生成n*n个随机数
r=1;%参数
temp=0;
tem=0;
Un=rand(n,1);%共产生n*n个随机数
for i=1:1:n
X(i)=-log(Un(i))/r;
end
X=subs(X);
for i=1:1:n
for j=1:1:i
temp=temp+X(j);
end
S(i)=temp;
temp=0;
end
S=subs(S);
%检验泊松过程使用第四条
for i=1:1:n
tem=tem+S(i);
end
sigmaN=tem;
T=S(n);
alpha=0.05;%置信水平
p=sigmaN/T;
p1=(1/2)*(n-1.96*(n/3)^(1/2));
p2=(1/2)*(n+1.96*(n/3)^(1/2));
c1=subs(p-p1)
c2=subs(p-p2)
if (c1<=0&c2>=0)|(c1>=0&c2<=0)
disp('这是一个泊松过程!')
%参数估计使用极大似然估计
r_=subs(n/T);
if abs(subs(r_-r))<0.1
disp('参数估计正确!')
disp('参数估计值为:')
r_
end
%绘制轨迹
y=0;
x=0:0.001:subs(S(1));
plot(x,y)
for k=1:1:n
y=k;
x=subs(S(k)):0.001:subs(S(k+1));
hold on
plot(x,y)
end
else
disp('这不是一个泊松过程!')
end
D116
最后
以上就是复杂超短裙为你收集整理的使用matlab模拟、检验和估计泊松过程的全部内容,希望文章能够帮你解决使用matlab模拟、检验和估计泊松过程所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复