Package Scientific :: Package Statistics
[frames] | no frames]

Package Statistics

Basic monovariate statistics

Submodules

Functions
number
average(data)
Mean (average value, first moment)
number
correlation(data1, data2)
Calculates the correlation coefficient between two data sequences
number
kurtosis(data)
Kurtosis (fourth normalized moment)
number
mean(data)
Mean (average value, first moment)
number
median(data)
Median
 
mode(data)
number
moment(data, order, about=None, theoretical=1)
Calculate the moments of the distribution corresponding to a set of data
number
normalizedMoment(data, order)
Calculate the normalized moments of the distribution corresponding to a set of data.
number
skewness(data)
Skewness (third normalized moment)
number
standardDeviation(data)
Standard deviation
number
variance(data)
Variance (second moment)
tuple of two elements
weightedMean(data, sigma)
Weighted mean of a sequence of numbers with given standard deviations
Function Details

average(data)

 

Mean (average value, first moment)

Parameters:
  • data (list or Numeric.array) - a sequence of numbers
Returns: number
the mean of the number sequence

correlation(data1, data2)

 

Calculates the correlation coefficient between two data sequences

Parameters:
  • data1 (Numeric.array or list) - first data sequence
  • data2 (Numeric.array or list) - second data sequence of length identical to data1
Returns: number
the correlation coefficient between data1 and data2
Raises:
  • ValueError - if data1 and data2 have different lengths

kurtosis(data)

 

Kurtosis (fourth normalized moment)

Parameters:
  • data (list or Numeric.array) - a sequence of numbers
Returns: number
the kurtosis of the number sequence

mean(data)

 

Mean (average value, first moment)

Parameters:
  • data (list or Numeric.array) - a sequence of numbers
Returns: number
the mean of the number sequence

median(data)

 

Median

Parameters:
  • data (list or Numeric.array) - a sequence of numbers
Returns: number
the median of the number sequence

moment(data, order, about=None, theoretical=1)

 

Calculate the moments of the distribution corresponding to a set of data

Parameters:
  • data (Numeric.array of numbers) - a sequence of data points
  • order (int) - the order of the moment to be calculated
  • about (number) - the center of the distribution. If None, use the mean value as the center.
  • theoretical - for internal use
Returns: number
the moment of the given order about the specified center

normalizedMoment(data, order)

 

Calculate the normalized moments of the distribution corresponding to a set of data. Normalization means division by the n-th power of the standard deviation.

Parameters:
  • data (Numeric.array of numbers) - a sequence of data points
  • order (int) - the order of the moment to be calculated
Returns: number
the normalized moment of the given order

skewness(data)

 

Skewness (third normalized moment)

Parameters:
  • data (list or Numeric.array) - a sequence of numbers
Returns: number
the skewness of the number sequence

standardDeviation(data)

 

Standard deviation

Parameters:
  • data (list or Numeric.array) - a sequence of numbers
Returns: number
the standard deviation of the number sequence

variance(data)

 

Variance (second moment)

Parameters:
  • data (list or Numeric.array) - a sequence of numbers
Returns: number
the variance of the number sequence

weightedMean(data, sigma)

 

Weighted mean of a sequence of numbers with given standard deviations

Parameters:
  • data (list or Numeric.array) - a sequence of measurements
  • sigma (list or Numeric.array) - a sequence of corresponding standard deviations
Returns: tuple of two elements
the weighted mean and corresponding standard deviation