Chapter 3: binomial stem plots
Chapter 3: binomial stem plots
symb=['oods'];
fll=['kwkw'];
theta=[.1 .95 .7 .5];
MS=[11 11 11.5 11.5];
N=40;
S=0:N;
Sinterp=0:.1:N;
M=gamma(N+1)./(gamma(S+1).*gamma(N-S+1));
Minterp=gamma(N+1)./(gamma(Sinterp+1).*gamma(N-Sinterp+1));
figure; clf; hold on
for L=1:length(theta),
b=theta(L).^S.*(1-theta(L)).^(N-S);
binterp=theta(L).^Sinterp.*(1-theta(L)).^(N-Sinterp);
plot(Sinterp,Minterp.*binterp,'k--')
stem(S,M.*b,['k' symb(L)],'MarkerFaceColor',fll(L),'MarkerSize',MS(L)), end