# 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

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 point

The following quantities are calculated:

1. total frequency,

2. mean,

3. standard deviation,

4. coefficient of skewness,

5. 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:

1. for ,

2. for ,