% LMcs050802_4th.m
DATA=[repmat(0,82,1);repmat(1,57,1);repmat(2,46,1)
      repmat(3,39,1);repmat(4,33,1);repmat(5,28,1)
      repmat(6,25,1);repmat(7,22,1);repmat(8,19,1)
      repmat(9,17,1);repmat(10,15,1);repmat(11,13,1)
      repmat(12,12,1);repmat(13,10,1);repmat(14,9,1)
      repmat(15,8,1);repmat(16,7,1);repmat(17,6,1)
      repmat(18,6,1);repmat(19,5,1);repmat(20,5,1)
      repmat(21,4,1);repmat(22,4,1);repmat(23,3,1)
      repmat(24,3,1);repmat(25,3,1);repmat(26,2,1)
      repmat(27,2,1);repmat(28,2,1);repmat(29,2,1)
      repmat(30,2,1);repmat(31,13,1)];
  [parmhat,parmci] = nbinfit(DATA,0.05)
  X=0:50;
  Total=504
  Errors = Total*[nbinpdf(X,parmhat(1),parmhat(2))]'
  
  