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

   n=length(data);
   x=data;
   
   if lambda==0
       x_box=log(x);
   else 
       x_box=(x.^lambda-1)/lambda;
   end 
   
   x_bar=mean(x_box);
   
   lik=-n/2*log(sum((x_box-x_bar).^2)/n)+(lambda-1)*sum(log(x));
   
    