
clear all
close all


disp('Amanita Muscaria')
  lw = 2; 
  set(0, 'DefaultAxesFontSize', 16);
  fs = 15;
  msize = 10;
% end of preabmle--------------------------------------



amuscaria = [10,11,12,9,10,11,13,12,10,11,11,13,9,10,9,10,8 ...
 12,10,11,9,10,7,11,8,9,11,11,10,12,10,8,7,11,12,10,9,10,11,...
 10,8,10,10,8,9,10,13,9,12,9,9];

n = length(amuscaria)
xbar = mean(amuscaria)
s2 = var(amuscaria)


alpha = 0.05;
conf = 1 - alpha;
t=tinv(1-alpha/2, n-1)
ch1=chi2inv(1-alpha/2, n-1)
ch2=chi2inv(alpha/2, n-1)
s = sqrt(s2)

LBm = xbar - tinv(1-alpha/2, n-1) * s/sqrt(n);
UBm = xbar + tinv(1-alpha/2, n-1) * s/sqrt(n);
CImean = [LBm UBm]


%%
ch1=chi2inv(1-alpha/2, n-1)
ch2=chi2inv(alpha/2, n-1)
LBs = (n-1)*s2/chi2inv(1-alpha/2, n-1);
UBs = (n-1)*s2/chi2inv(alpha/2, n-1);
CIvar = [LBs UBs]
CIstd = sqrt(CIvar)

%[phat,pci] = mle(amuscaria,'distribution','normal',...
%                'alpha',.05)
