% LMcs050801_4th.m
% Bayesian analysis of the expected number of hurricanes:
% Written by Eugene.Gallagher@umb.edu, 3/5/11
% for EEOS601, UMASS/Boston
% See also AP2Week8_Su11.m
theta=1:0.001:2.6;
% Use the gamma distribution to model the prior;
% Note that Matlab's b is 1 / {L & M's mu}
mu=50;s=88;
Prior=gampdf(theta,s,1/mu);
plot(theta,Prior,'--','LineWidth',3)
xlabel('theta, Number of Hurricanes per Year','FontSize',20)
ylabel('Density','FontSize',20);
title('Case Study 5.8.1','FontSize',22)
hold on
postmu=50+100;posts=88+164;
Posterior=gampdf(theta,posts,1/postmu);
plot(theta,Posterior,'m','LineWidth',3)
legend('Prior (1851-1900)','Posterior (1901-2000)')
figure(gcf);pause
hold off