def ppcc_max(x, brack=(0.0, 1.0), dist='tukeylambda'):
 dist = _parse_dist_kw(dist)
 osm_uniform = _calc_uniform_order_statistic_medians(len(x))
 osr = sort(x)
 def tempfunc(shape, mi, yvals, func):
  xvals = func(mi, shape)
  (r, prob) = stats.pearsonr(xvals, yvals)
  return (1 - r)
 return optimize.brent(tempfunc, brack=brack, args=(osm_uniform, osr, dist.ppf))

def ppcc_max ( x , brack = ( 0.0 , 1.0 ) , dist = 'tukeylambda' ) : dist = _parse_dist_kw ( dist ) osm_uniform = _calc_uniform_order_statistic_medians ( len ( x ) ) osr = sort ( x ) def tempfunc ( shape , mi , yvals , func ) : xvals = func ( mi , shape ) ( r , prob ) = stats . pearsonr ( xvals , yvals ) return ( 1 - r ) return optimize . brent ( tempfunc , brack = brack , args = ( osm_uniform , osr , dist . ppf ) )
calculate the shape parameter that maximizes the ppcc the probability plot correlation coefficient plot can be used to determine the optimal shape parameter for a one-parameter family of distributions .