function [lik, x_box]=Box_Cox_lik2(lambda,data)

  [n,p]=size(data);
  
  x=data;
  
  for i=1:p
      
      if lambda(i)==0
          x_box(:,i)=log(x(:,i));
      else
          x_box(:,i)=(x(:,i).^lambda(i)-1)/lambda(i);
      end
     
  end;
  
  S=cov(x_box);
  
  lik=-n/2*log(abs(det(S)));
  
  for i=1:p
      
      lik=lik+(lambda(i)-1)*sum(log(x(:,i)));

  end 
  
  
  
      
   