Skip to content

Commit

Permalink
minor modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Reshad Hosseini authored and Reshad Hosseini committed Aug 25, 2016
1 parent d6ee83e commit e9aa15b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion mixest/distributions/mixture/mixture_mergeinit.m
Expand Up @@ -62,10 +62,17 @@
if strcmp(method, 'default')
if true
options.verbosity = 0;
DidxM = D.component(idx1);
% penalizer_theta
if options.penalize
if isempty(options.penalizertheta)
options.penalizertheta = DidxM.penalizerparam(data);
end
end
data = mxe_readdata(data);
h = D.weighting(theta, data);
data.weight = sum(h([idx1 idx2],:),1);
DidxM = D.component(idx1);
options.theta0 = theta.D{idx1};
theta.D{idx1} = DidxM.estimate(data, options);
else
w1 = theta.p(idx1);
Expand Down
9 changes: 8 additions & 1 deletion mixest/distributions/mixture/mixture_splitinit.m
Expand Up @@ -69,11 +69,18 @@
if strcmp(method, 'default')
if true
options.verbosity = 0;
DidxM = D.component(idx);
% penalizer_theta
if options.penalize
if isempty(options.penalizertheta)
options.penalizertheta = DidxM.penalizerparam(data);
end
end
data = mxe_readdata(data);
h = D.weighting(theta, data);
w = rand(1, data.size);
DidxM = D.component(idx);
data.weight = w.*(h(idx,:)+0.1);
options.theta0 = theta.D{idx};
theta.D{end} = DidxM.estimate(data, options);
data.weight = (1-w).*(h(idx,:)+0.1);
theta.D{idx} = DidxM.estimate(data, options);
Expand Down

0 comments on commit e9aa15b

Please sign in to comment.