-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmpCouts.m
More file actions
29 lines (28 loc) · 704 Bytes
/
Copy pathSmpCouts.m
File metadata and controls
29 lines (28 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function [MAP]=SmpCouts(Seq,samples,Mle,N)
labels={'μ','K','Alpha','c','p'};
minA=min(samples);
maxA=max(samples);
if nargin < 4
N=50;
end
dM=(maxA-minA)/N;
bin=minA:dM:maxA+dM;
nbin=length(bin);
for i=1:nbin
num=histcounts(samples,bin);
end
plot(bin(1:end-1),num,'LineWidth',1.7,'Color','k');
hold on
ind=find(num==max(num),1);
MAP=bin(ind);
fprintf('The Mostlikely Value of parameter %d is %.4f \n',Seq,MAP)
xline(MAP,'LineWidth',2,'Color','r','LineStyle','-.');
if ~isempty(Mle)
hold on
Mle=Mle(Seq);
xline(Mle,'LineWidth',2,'Color',[0.5020 0.5020 0.5020],'LineStyle','--');
end
Fun_defaultAxes; box on;
title((labels(Seq)));
xlim('tight');
end