astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v0.3 »
- Astrostatistics Tools (`astropy.stats`) »
- biweight_location

# biweight_location

`astropy.stats.funcs.``biweight_location`(a, c=6.0, M=None)

  Compute the biweight location for an array

  Returns the biweight location for the array elements. The biweight is a robust statistic for determining the central location of a distribution.

  The biweight location is given by the follow equation

  C_{bl}= M+\frac{\Sigma_{\|u_i\|<1} (x_i-M)(1-u_i^2)^2} {\Sigma_{\|u_i\|<1} (1-u_i^2)^2}

  where M is the sample mean or if run iterative the initial guess, and u_i is given by

  u_{i} = \frac{(x_i-M)}{cMAD}

  where MAD is the median absolute deviation.

  For more details, see Beers, Flynn, and Gebhardt, 1990, AJ, 100, 32B

  Parameters:

  a : array_like

  > Input array or object that can be converted to an array.

  c : float

  > Tuning constant for the biweight estimator. Default value is 6.0.

  M : float, optional

  > Initial gues for the biweight location.

  Returns:

  biweight_location: float :

  > Returns the biweight location for the array elements.

  See also

  `median`, `biweight_midvariance`

  Examples

  This will generate random variates from a Gaussian distribution and return the median absolute deviation for that distribution:

      >>> from astropy.stats.funcs import biweight_location
      >>> from numpy.random import randn
      >>> randvar = randn(10000)
      >>> cbl = biweight_location(randvar)