We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7afd571 commit aed2d7eCopy full SHA for aed2d7e
1 file changed
matlab-seminar/complete/dpoisson.m
@@ -0,0 +1,23 @@
1
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
+%
3
+% Computes the log-PDF of Poisson distribution
4
5
+% Inputs:
6
+% x: Obserations
7
+% par: Parameters of the PDF (location, scale and shape)
8
9
+% Outputs:
10
+% out: Logarithm of the PDF evaluated at each x.
11
12
13
+
14
+function[out] = poisson(x, par)
15
+ part1 = -log( factorial( x ) );
16
+ part2 = x * log( par );
17
+ part3 = -par;
18
+ out = part1 + part2 + part3;
19
+end
20
21
22
+% End of file
23
0 commit comments