Chapter 6: create penalty plot
Chapter 6: create penalty plot
The penalized-maximum-likelihood form of the model likelihoods allows us to see when we should expect each model to perform well, and when it has a large penalty.
N=20; Lmax=nan(N+1,1); L1=nan(N+1,1); theta=.5;
for k=0:1:20,
L1(k+1)=bpdf(k,20,theta);
Lmax(k+1)=bpdf(k,20,k/20); end
rMaxLike=1-L1./Lmax; c=1-1./[Lmax*(N+1)];
figure; box off; hold on
plot([0:N],rMaxLike,'ko','MarkerFaceColor',.5*[1 1 1],'MarkerSize',11)
plot([0:N],c,'ko','MarkerFaceColor',.25*[1 1 1],'MarkerSize',11)
axis([-.5 20.5 0 1])