第一题用matlab该怎么做啊,就是如何求二项分布的泊松近似的近似值
展开全部
n= 100;
p= 0.01;
lamda = n*p;
possion = zeros(1,21);
accurate = zeros(1,21)
for k = 0:20;
possion(k+1) = lamda^k/gamma(k+1)*exp(-lamda);
accurate(k+1) = gamma(n+1)/gamma(k+1)/gamma(n-k+1)*p^k*(1-p)^(n-k);
end
plot([0:20],possion,'co-',[0:20],accurate,'b*')
p= 0.01;
lamda = n*p;
possion = zeros(1,21);
accurate = zeros(1,21)
for k = 0:20;
possion(k+1) = lamda^k/gamma(k+1)*exp(-lamda);
accurate(k+1) = gamma(n+1)/gamma(k+1)/gamma(n-k+1)*p^k*(1-p)^(n-k);
end
plot([0:20],possion,'co-',[0:20],accurate,'b*')
追问
有点看不懂呢,可以在后面用文字说明一下么?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询