Skip to content

Commit

Permalink
"Fixed parameter estimation for MP GaussI and MP GammaI
Browse files Browse the repository at this point in the history
self distances are not included in mean/var calculations anymore

not fixed for MP Gauss yet"
  • Loading branch information
VarIr committed Aug 19, 2016
1 parent 2e41033 commit ea004cd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions mutual_proximity.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
elseif (strcmp(type, 'gauss') == 1)
mp_func = @mp_gauss;
elseif (strcmp(type, 'gaussi') == 1)
% (c) 2013, Dominik Schnitzer <[email protected]>
% (c) 2016, Roman Feldbauer <[email protected]> mp_func = @mp_gaussi;
mp_func = @mp_gaussi;
elseif (strcmp(type, 'gammai') == 1)
mp_func = @mp_gammai;
else
Expand Down Expand Up @@ -85,8 +84,10 @@

function Dmp = mp_gaussi(D)

mu = mean(D);
sd = std(D);
D(1:length(D)+1:numel(D)) = nan;
mu = nanmean(D);
sd = nanstd(D);
D(1:length(D)+1:numel(D)) = 0;

Dmp = zeros(size(D), class(D));
n = length(D);
Expand Down Expand Up @@ -159,10 +160,12 @@

function Dmp = mp_gammai(D)

mu = mean(D);
va = var(D);
D(1:length(D)+1:numel(D)) = nan;
mu = nanmean(D);
va = nanvar(D);
A = (mu.^2)./va;
B = va ./ mu;
D(1:length(D)+1:numel(D)) = 0;

Dmp = zeros(size(D), class(D));
n = size(D, 1);
Expand Down

0 comments on commit ea004cd

Please sign in to comment.