Skip to content

Commit

Permalink
show also result without "outliers"
Browse files Browse the repository at this point in the history
  • Loading branch information
avehtari committed Oct 3, 2016
1 parent 69f0e64 commit 7e96fc9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion demos_ch6/demo6_4.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,26 @@
my=mean(y);

% tail area probabilities of marginal predictive distributions
subplot(2,1,1)
Ty=t_cdf(y,n-1,my,sqrt(1+1/n).*s);
hist(Ty,0.05:.05:.95)
hist(Ty,0.05:.1:.95)
title({'Light speed example','distribution of marginal posterior p-values'})
% Histogram should look uniformish, if the posterior predictive
% distributions are well calibrated (this test is more reliable with
% cross-validation predictive distributions).

pause

% Let's remove two "outliers"
y([6 10])=[];
n=length(y);
s2=var(y);
s=sqrt(s2);
my=mean(y);

% tail area probabilities of marginal predictive distributions
subplot(2,1,2)
Ty=t_cdf(y,n-1,my,sqrt(1+1/n).*s);
hist(Ty,0.05:.1:.95)
title({'After removing "outliers"','distribution of marginal posterior p-values'})
% Histogram looks more uniformish after removing two "outliers"

0 comments on commit 7e96fc9

Please sign in to comment.