This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / stats / _circstats / _circmeandev

function

scipy.stats._circstats:_circmeandev

source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_circstats.py:13

Signature

def _circmeandev(sample, alpha, *, high = 6.283185307179586, low = 0)

Summary

Compute the circular mean (absolute) deviation of an angular sample.

Extended Summary

Given angle observations measured in radians, the circular mean (absolute) deviation about a given angle is defined by ([1], Eq. 2.3.14)

For greater generality, this function computes:

where and is the period of a full revolution (e.g. when working in degrees).

Parameters

sample : array_like

Input array of angle observations.

alpha : array_like

The reference angle with respect to which the mean deviation is computed.

high : float, optional

Upper boundary of the principal value of an angle. Default is 2*pi.

low : float, optional

Lower boundary of the principal value of an angle. Default is 0.

Returns

circmeandev : float

Circular mean (absolute) deviation, restricted to the range [low, high].

Examples

import numpy as np
from scipy.stats._circstats import _circmeandev
import matplotlib.pyplot as plt
sample = np.array([20, 30, 330])
✓
dev = _circmeandev(sample, sample, high=360, low=0)
✗
Among all the observations, the circular mean deviation is minimized about 20 degrees, so 20 degrees is the circular median.

See also

circmean

Circular mean.

circstd

Circular standard deviation.

circvar

Circular variance.

Aliases

  • scipy.stats._circstats._circmeandev