naginterfaces.library.stat.summary_freq¶
- naginterfaces.library.stat.summary_freq(x, ifreq)[source]¶
summary_freq
calculates the mean, standard deviation and coefficients of skewness and kurtosis for data grouped in a frequency distribution.For full information please refer to the NAG Library document for g01ad
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g01/g01adf.html
- Parameters
- xfloat, array-like, shape
The elements of must contain the boundary values of the classes in ascending order, so that class is bounded by the values in and , for .
- ifreqint, array-like, shape
The th element of must contain the frequency associated with the th class, for . is not used by the function.
- Returns
- xmeanfloat
The mean value, .
- s2float
The standard deviation, .
- s3float
The coefficient of skewness, .
- s4float
The coefficient of kurtosis, .
- nint
The total frequency, .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, , and .
Constraint: .
- (errno )
Either for some , or the sum of frequencies is zero.
- Warns
- NagAlgorithmicWarning
- (errno )
The total frequency, , is less than , hence the quantities , and cannot be calculated.
- Notes
The input data consist of a univariate frequency distribution, denoted by , for , and the boundary values of the classes , for . Thus the frequency associated with the interval is , and
summary_freq
assumes that all the values in this interval are concentrated at the pointThe following quantities are calculated:
total frequency,
mean,
standard deviation,
coefficient of skewness,
coefficient of kurtosis,
The function has been developed primarily for groupings of a continuous variable. If, however, the function is to be used on the frequency distribution of a discrete variable, taking the values , then the boundary values for the classes may be defined as follows:
for ,
for ,