matlab实现,出生模型T取不同值时,求指数分布和泊松分布的概率密度函数
时间: 2024-06-04 21:12:32 浏览: 109
下面分别给出T取不同值时指数分布和泊松分布的概率密度函数的MATLAB实:
指数分布:
当T=1时,指数分布的概率密度函数为:
f(x) = exp(-x), x >= 0
MATLAB代码实现:
x = 0:0.01:10;
f = exp(-x);
plot(x,f);
xlabel('x');
ylabel('f(x)');
title('Exponential Distribution (T=1)');
当T=2时,指数分布的概率密度函数为:
f(x) = (1/2)*exp(-x/2), x >= 0
MATLAB代码实现:
x = 0:0.01:10;
f = (1/2)*exp(-x/2);
plot(x,f);
xlabel('x');
ylabel('f(x)');
title('Exponential Distribution (T=2)');
当T=3时,指数分布的概率密度函数为:
f(x) = (1/3)*exp(-x/3), x >= 0
MATLAB代码实现:
x = 0:0.01:10;
f = (1/3)*exp(-x/3);
plot(x,f);
xlabel('x');
ylabel('f(x)');
title('Exponential Distribution (T=3)');
泊松分布:
当T=1时,泊松分布的概率密度函数为:
f(k) = exp(-1)*(1^k)/k!, k = 0,1,2,...
MATLAB代码实现:
k = 0:10;
f = exp(-1)*((1.^k)./factorial(k));
stem(k,f);
xlabel('k');
ylabel('f(k)');
title('Poisson Distribution (T=1)');
当T=2时,泊松分布的概率密度函数为:
f(k) = exp(-2)*(2^k)/k!, k = 0,1,2,...
MATLAB代码实现:
k = 0:10;
f = exp(-2)*((2.^k)./factorial(k));
stem(k,f);
xlabel('k');
ylabel('f(k)');
title('Poisson Distribution (T=2)');
当T=3时,泊松分布的概率密度函数为:
f(k) = exp(-3)*(3^k)/k!, k = 0,1,2,...
MATLAB代码实现:
k = 0:10;
f = exp(-3)*((3.^k)./factorial(k));
stem(k,f);
xlabel('k');
ylabel('f(k)');
title('Poisson Distribution (T=3)');
阅读全文