forked from TASBE/TASBEFlowAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgmm_pdf.m
More file actions
15 lines (13 loc) · 712 Bytes
/
gmm_pdf.m
File metadata and controls
15 lines (13 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
% Copyright (C) 2010-2017, Raytheon BBN Technologies and contributors listed
% in the AUTHORS file in TASBE analytics package distribution's top directory.
%
% This file is part of the TASBE analytics package, and is distributed
% under the terms of the GNU General Public License, with a linking
% exception, as described in the file LICENSE in the TASBE analytics
% package distribution's top directory.
function p = gmm_pdf(gmm,x)
% Note: "Sigma" in the GMM indicates the *variance* and not the std.dev, as would usually be the case.
p = zeros(size(x));
for i=1:numel(gmm.mu),
p = p + gmm.weight(i) * 1/(sqrt(gmm.Sigma(1,1,i))*sqrt(2*pi)) * exp( -0.5 * (((x-gmm.mu(i))/sqrt(gmm.Sigma(1,1,i))).^2));
end