def boxcox_normplot(x, la, lb, plot=None, N=80):
 x = np.asarray(x)
 if (x.size == 0):
  return x
 if (lb <= la):
  raise ValueError('`lb` has to be larger than `la`.')
 lmbdas = np.linspace(la, lb, num=N)
 ppcc = (lmbdas * 0.0)
 for (i, val) in enumerate(lmbdas):
  z = boxcox(x, lmbda=val)
  (_, r2) = probplot(z, dist='norm', fit=True)
  ppcc[i] = r2[(-1)]
 if (plot is not None):
  plot.plot(lmbdas, ppcc, 'x')
  _add_axis_labels_title(plot, xlabel='$\\lambda$', ylabel='Prob Plot Corr. Coef.', title='Box-Cox Normality Plot')
 return (lmbdas, ppcc)

def boxcox_normplot ( x , la , lb , plot = None , N = 80 ) : x = np . asarray ( x ) if ( x . size == 0 ) : return x if ( lb <= la ) : raise ValueError ( '`lb` has to be larger than `la`.' ) lmbdas = np . linspace ( la , lb , num = N ) ppcc = ( lmbdas * 0.0 ) for ( i , val ) in enumerate ( lmbdas ) : z = boxcox ( x , lmbda = val ) ( _ , r2 ) = probplot ( z , dist = 'norm' , fit = True ) ppcc [ i ] = r2 [ ( - 1 ) ] if ( plot is not None ) : plot . plot ( lmbdas , ppcc , 'x' ) _add_axis_labels_title ( plot , xlabel = '$\\lambda$' , ylabel = 'Prob Plot Corr. Coef.' , title = 'Box-Cox Normality Plot' ) return ( lmbdas , ppcc )
compute parameters for a box-cox normality plot .