 disp('Rutherford')
 lw = 3; 
 set(0, 'DefaultAxesFontSize', 16);
 fs = 15;
 msize = 10;

%Rutherford.m
X=[ 0  1  2  3  4  5  6  7  8  9  10  11  12 ];
fr=[ 57 203  383  525  532  408  273  139  45  27  10  4  2];
n = sum(fr);       %number of time intervals %n=2608
rfr = fr./n;          %relative frequencies %
xbar = X * rfr' ;  %lambdahat = xbar =  3.8704
tc = X * fr';         %total number of counts  tc = 10094
 %Recentered VarStabilizing 
[xbar + (norminv(0.975))^2/(4*n) - ...
                          norminv(0.975) * sqrt(( xbar + 3/8)/n )...
     xbar + (norminv(0.975))^2/(4*n)  + ...
                          norminv(0.975) * sqrt( (xbar+ 3/8)/n )]
                   %   3.7917    3.9498 
 % Poisson/Chi2 link
[1/(2 *n) * chi2inv(0.025, 2 * tc)  ...
       1/(2 * n) * chi2inv(0.975, 2*(tc + 1))] %  3.7953    3.9467
