def boxcox_llf(lmb, data):
 data = np.asarray(data)
 N = data.shape[0]
 if (N == 0):
  return np.nan
 y = boxcox(data, lmb)
 y_mean = np.mean(y, axis=0)
 llf = ((lmb - 1) * np.sum(np.log(data), axis=0))
 llf -= ((N / 2.0) * np.log(np.sum((((y - y_mean) ** 2.0) / N), axis=0)))
 return llf

def boxcox_llf ( lmb , data ) : data = np . asarray ( data ) N = data . shape [ 0 ] if ( N == 0 ) : return np . nan y = boxcox ( data , lmb ) y_mean = np . mean ( y , axis = 0 ) llf = ( ( lmb - 1 ) * np . sum ( np . log ( data ) , axis = 0 ) ) llf -= ( ( N / 2.0 ) * np . log ( np . sum ( ( ( ( y - y_mean ) ** 2.0 ) / N ) , axis = 0 ) ) ) return llf
the boxcox log-likelihood function .