blob: 274ea86a48dd656e2a5f805bc523f96bc0dcf56b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
clc
b=[0 1 2 3 4 5 6];..........................//breakdown/day
f=[340 121 53 30 12 4 0];...................//frequency
Den=sum(f);
ans=0;
for i=1:7
ans=ans+[f(i) * b(i)];
end
Mean=ans/Den;...............................//calculation of expectance
disp(Mean,"mean");
k=0:1:6;
y=(exp(-Mean)*(Mean^k)). /factorial(k);
disp(y);
plot2d(k,y);......................//Poisson distribution
title("Poisson Distribution",k,y);
xlabel("Breakdown/day");
ylabel("Probability");
|