scipy.stats.mstats.mquantiles

scipy.stats.mstats.mquantiles(data, prob=[, 0.25, 0.5, 0.75], alphap=0.40000000000000002, betap=0.40000000000000002, axis=None, limit=())

Computes empirical quantiles for a 1xN data array. Samples quantile are defined by: Q(p) = (1-g).x[i] +g.x[i+1] where x[j] is the jth order statistic, with i = (floor(n*p+m)), m=alpha+p*(1-alpha-beta) and g = n*p + m - i).

Typical values of (alpha,beta) are:

  • (0,1) : p(k) = k/n : linear interpolation of cdf (R, type 4)
  • (.5,.5) : p(k) = (k+1/2.)/n : piecewise linear function (R, type 5)
  • (0,0) : p(k) = k/(n+1) : (R type 6)
  • (1,1) : p(k) = (k-1)/(n-1). In this case, p(k) = mode[F(x[k])]. That’s R default (R type 7)
  • (1/3,1/3): p(k) = (k-1/3)/(n+1/3). Then p(k) ~ median[F(x[k])]. The resulting quantile estimates are approximately median-unbiased regardless of the distribution of x. (R type 8)
  • (3/8,3/8): p(k) = (k-3/8)/(n+1/4). Blom. The resulting quantile estimates are approximately unbiased if x is normally distributed (R type 9)
  • (.4,.4) : approximately quantile unbiased (Cunnane)
  • (.35,.35): APL, used with PWM
Parameters:

x : sequence

Input data, as a sequence or array of dimension at most 2.

prob : sequence

List of quantiles to compute.

alpha : {0.4, float} optional

Plotting positions parameter.

beta : {0.4, float} optional

Plotting positions parameter.

axis : {None, int} optional

Axis along which to perform the trimming. If None, the input array is first flattened.

limit : tuple

Tuple of (lower, upper) values. Values of a outside this closed interval are ignored.

Previous topic

scipy.stats.mstats.moment

Next topic

scipy.stats.mstats.msign

This Page

Quick search