function [lambda,lik, x_box]=Box_Cox2(a,b,data)
 
   [n,p]=size(data);
   
   lambda_series=zeros(length(a:0.01:b),p);
   for i=1:p
     lambda_series(:,i)=a:0.01:b;
   end
     
   Lik=zeros(1,length(lambda_series));
   for i=1:length(lambda_series)
       for j=1:length(lambda_series)
         l1=lambda_series(i,1);
         l2=lambda_series(j,2);
          [Lik(i,j),x_box]=Box_Cox_lik2([l1 l2], data);
       end
   end
   [Lik_max,index1]=max(Lik);
   [Lik_max,index2]=max(Lik_max);
   lambda=[lambda_series(index2,1) lambda_series(index1(index2),2)]; 
   [lik,x_box]=Box_Cox_lik2(lambda, data);