clear all
close all
% ---------------------------------------------------
 disp('Likelihood and LogLikelihood')
  lw = 3; 
  set(0, 'DefaultAxesFontSize', 16);
  fs = 15;
  msize = 10;
%  
X = [0.4  0.3  0.1 0.5 ];
Lik=[]; 
thetas = 1 : 0.01 : 5;
for  theta = thetas
L =  prod( theta * exp(- theta .* X) );
Lik=[Lik L];
end
LLik = log(Lik);
thetahat = 1/mean(X);
figure(1)
plot(thetas, Lik, 'k-','LineWidth',2)
hold on
plot(thetas, LLik,'LineWidth',2)
plot( [thetahat, thetahat],[-2, 2],'r:','LineWidth',2)
text(4,0,'log L','FontSize',16)
text(4,1.5,' L','FontSize',16)
plot(3.077, -2,'o','MarkerEdgeColor','k',...
    'MarkerFaceColor','g',...
    'MarkerSize',10)
plot(3.077, 0.5,'o','MarkerEdgeColor','k',...
    'MarkerFaceColor','g',...
    'MarkerSize',10)
plot(3.077, 1.635,'o','MarkerEdgeColor','k',...
    'MarkerFaceColor','g',...
    'MarkerSize',10)
axis image
xlabel('\theta')
hold off
% print -depsc 'C:\Springer\Estim\Estimeps\plotlike.eps'
            