#NEWLINE# def plotting_positions( data , alpha = 0.4 , beta = 0.4 ) : #NEWLINE# #INDENT# "\n    Returns plotting positions (or empirical percentile points) for the data.\n\n    Plotting positions are defined as ``(i-alpha)/(n+1-alpha-beta)``, where:\n        - i is the rank order statistics\n        - n is the number of unmasked values along the given axis\n        - `alpha` and `beta` are two parameters.\n\n    Typical values for `alpha` and `beta` are:\n        - (0,1)    : ``p(k) = k/n``, linear interpolation of cdf (R, type 4)\n        - (.5,.5)  : ``p(k) = (k-1/2.)/n``, piecewise linear function\n          (R, type 5)\n        - (0,0)    : ``p(k) = k/(n+1)``, Weibull (R type 6)\n        - (1,1)    : ``p(k) = (k-1)/(n-1)``, in this case,\n          ``p(k) = mode[F(x[k])]``. That's R default (R type 7)\n        - (1/3,1/3): ``p(k) = (k-1/3)/(n+1/3)``, then\n          ``p(k) ~ median[F(x[k])]``.\n          The resulting quantile estimates are approximately median-unbiased\n          regardless of the distribution of x. (R type 8)\n        - (3/8,3/8): ``p(k) = (k-3/8)/(n+1/4)``, Blom.\n          The resulting quantile estimates are approximately unbiased\n          if x is normally distributed (R type 9)\n        - (.4,.4)  : approximately quantile unbiased (Cunnane)\n        - (.35,.35): APL, used with PWM\n        - (.3175, .3175): used in scipy.stats.probplot\n\n    Parameters\n    ----------\n    data : array_like\n        Input data, as a sequence or array of dimension at most 2.\n    alpha : float, optional\n        Plotting positions parameter. Default is 0.4.\n    beta : float, optional\n        Plotting positions parameter. Default is 0.4.\n\n    Returns\n    -------\n    positions : MaskedArray\n        The calculated plotting positions.\n\n    " #NEWLINE# data = ma . array ( data , copy = False ) . reshape ( 1 , ( - 1 ) ) #NEWLINE# n = data . count ( ) #NEWLINE# plpos = np . empty ( data . size , dtype = float ) #NEWLINE# plpos [ n : ] = 0 #NEWLINE# plpos [ data . argsort ( ) [ : n ] ] = ( ( np . arange ( 1 , ( n + 1 ) ) - alpha ) / ( ( ( n + 1.0 ) - alpha ) - beta ) ) #NEWLINE# return ma . array ( plpos , mask = data . _mask )