Click or drag to resize
Stats Class
The `Stats` type contains functions for fast calculation of statistics over series and frames as well as over a moving and an expanding window in a series. The resulting series has the same keys as the input series. When there are no values, or missing values, different functions behave in different ways. Statistics (e.g. mean) return missing value when any value is missing, while min/max functions return the minimal/maximal element (skipping over missing values). ## Series statistics Functions such as `count`, `mean`, `kurt` etc. return the statistics calculated over all values of a series. The calculation skips over missing values (or `nan` values), so for example `mean` returns the average of all _present_ values. ## Frame statistics The standard functions are exposed as static members and are overloaded. This means that they can be applied to both `Series<'K, float>` and to `Frame<'R, 'C>`. When applied to data frame, the functions apply the statistical calculation to all numerical columns of the frame. ## Moving windows Moving window means that the window has a fixed size and moves over the series. In this case, the result of the statisitcs is always attached to the last key of the window. The function names are prefixed with `moving`. ## Expanding windows Expanding window means that the window starts as a single-element sized window and expands as it moves over the series. In this case, statistics is calculated for all values up to the current key. This means that the result is attached to the key at the end of the window. The function names are prefixed with `expanding`. ## Multi-level statistics For a series with multi-level (hierarchical) index, the functions prefixed with `level` provide a way to apply statistical operation on a single level of the index. (For example you can sum values along the `'K1` keys in a series `Series<'K1 * 'K2, float>` and get `Series<'K1, float>` as the result.) ## Remarks The windowing functions in the `Stats` type support calculations over a fixed-size windows specified by the size of the window. If you need more complex windowing behavior (such as window based on the distance between keys), different handling of boundary, or chunking (calculation over adjacent chunks), you can use chunking and windowing functions from the `Series` module such as `Series.windowSizeInto` or `Series.chunkSizeInto`. [category:Frame and series operations]
Inheritance Hierarchy
SystemObject
  DeedleStats

Namespace:  Deedle
Assembly:  Deedle (in Deedle.dll) Version: 1.2
Syntax
C#
[SerializableAttribute]
public class Stats

The Stats type exposes the following members.

Methods
  NameDescription
Public methodStatic membercountR, C(FrameR, C)
For each column, returns the number of the values in the column. This excludes missing values and values created from `Double.NaN` etc. [category:Frame statistics]
Public methodStatic membercountK, V(SeriesK, V)
Returns the number of the values in a series. This excludes missing values and values created from `Double.NaN` etc. [category:Series statistics]
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodStatic memberexpandingCountK
Returns a series that contains counts over expanding windows (the value for a given key is calculated from all elements with smaller keys). [category:Expanding windows]
Public methodStatic memberexpandingKurtK
Returns a series that contains kurtosis over expanding windows (the value for a given key is calculated from all elements with smaller keys); If the entire window contains fewer than 4 values, the result is missing. [category:Expanding windows]
Public methodStatic memberexpandingMaxK
Returns a series that contains maximum over an expanding window. The value for a key _k_ in the returned series is the maximum from all elements with smaller keys. [category:Expanding windows]
Public methodStatic memberexpandingMeanK
Returns a series that contains means over expanding windows (the value for a given key is calculated from all elements with smaller keys); If the entire window contains no values, the result is missing. [category:Expanding windows]
Public methodStatic memberexpandingMinK
Returns a series that contains minimum over an expanding window. The value for a key _k_ in the returned series is the minimum from all elements with smaller keys. [category:Expanding windows]
Public methodStatic memberexpandingSkewK
Returns a series that contains skewness over expanding windows (the value for a given key is calculated from all elements with smaller keys); If the entire window contains fewer than 3 values, the result is missing. [category:Expanding windows]
Public methodStatic memberexpandingStdDevK
Returns a series that contains standard deviation over expanding windows (the value for a given key is calculated from all elements with smaller keys); If the entire window contains fewer than 2 values, the result is missing. [category:Expanding windows]
Public methodStatic memberexpandingSumK
Returns a series that contains sums over expanding windows (the value for a given key is calculated from all elements with smaller keys); If the entire window contains no values, the result is 0. [category:Expanding windows]
Public methodStatic memberexpandingVarianceK
Returns a series that contains variance over expanding windows (the value for a given key is calculated from all elements with smaller keys); If the entire window contains fewer than 2 values, the result is missing. [category:Expanding windows]
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberinterpolateK, T
Interpolates an ordered series given a new sequence of keys. The function iterates through each new key, and invokes a function on the current key, the nearest smaller and larger valid observations from the series argument. The function must return a new valid float. ## Parameters - `keys` - Sequence of new keys that forms the index of interpolated results - `f` - Function to do the interpolating [category:Series interoploation]
Public methodStatic memberinterpolateLinearK
Linearly interpolates an ordered series given a new sequence of keys. ## Parameters - `keys` - Sequence of new keys that forms the index of interpolated results - `keyDiff` - A function representing "subtraction" between two keys [category:Series interoploation]
Public methodStatic memberkurtK(SeriesK, Double)
Returns the kurtosis of the values in a series. The function skips over missing values and `NaN` values. When there are less than 4 values, the result is NaN. [category:Series statistics]
Public methodStatic memberkurtR, C(FrameR, C)
For each numerical column, returns the kurtosis of the values in a series. The function skips over missing values and `NaN` values. When there are less than 4 values, the result is NaN. [category:Frame statistics]
Public methodStatic memberlevelCountK, L, V
For each group with equal keys at the level specified by `level`, returns the number of the values in the group. This excludes missing values and values created from `Double.NaN` etc. [category:Multi-level statistics]
Public methodStatic memberlevelKurtK, L
For each group with equal keys at the level specified by `level`, returns the kurtosis of the values in a series. The function skips over missing values and `NaN` values. When there are less than 4 values, the result is NaN. [category:Multi-level statistics]
Public methodStatic memberlevelMeanK, L
For each group with equal keys at the level specified by `level`, returns the mean of the values in the group. The function skips over missing values and `NaN` values. When there are no available values, the result is NaN. [category:Multi-level statistics]
Public methodStatic memberlevelMedianK, L
For each group with equal keys at the level specified by `level`, returns the median of the values in the group. [category:Multi-level statistics]
Public methodStatic memberlevelSkewK, L
For each group with equal keys at the level specified by `level`, returns the skewness of the values in a series. The function skips over missing values and `NaN` values. When there are less than 3 values, the result is NaN. [category:Multi-level statistics]
Public methodStatic memberlevelStdDevK, L
For each group with equal keys at the level specified by `level`, returns the standard deviation of the values in the group. The function skips over missing values and `NaN` values. When there are less than 2 values, the result is NaN. [category:Multi-level statistics]
Public methodStatic memberlevelSumK, L
For each group with equal keys at the level specified by `level`, returns the sum of the values in the group. The function skips over missing values and `NaN` values. When there are no available values, the result is 0. [category:Multi-level statistics]
Public methodStatic memberlevelVarianceK, L
For each group with equal keys at the level specified by `level`, returns the variance of the values in the group. The function skips over missing values and `NaN` values. When there are less than 2 values, the result is NaN. [category:Multi-level statistics]
Public methodStatic membermaxR, C(FrameR, C)
For each numerical column, returns the maximal values as a series. The function skips over missing and `NaN` values. When there are no values, the result is `NaN`. [category:Frame statistics]
Public methodStatic membermaxK, V(SeriesK, V)
Returns the maximum of the values in a series. The result is an option value. When the series contains no values, the result is `None`. [category:Series statistics]
Public methodStatic membermaxByT, a, K
Returns the key and value of the greatest element in the series. The result is an optional value. When the series contains no values, the result is `None`. [category:Series statistics]
Public methodStatic membermeanK(SeriesK, Double)
Returns the mean of the values in a series. The function skips over missing values and `NaN` values. When there are no available values, the result is NaN. [category:Series statistics]
Public methodStatic membermeanR, C(FrameR, C)
For each numerical column, returns the mean of the values in the column. The function skips over missing values and `NaN` values. When there are no available values, the result is NaN. [category:Frame statistics]
Public methodStatic membermedianK(SeriesK, Double)
Returns the median of the elements of the series. [category:Series statistics]
Public methodStatic membermedianR, C(FrameR, C)
For each numerical column, returns the median of the values in the column. [category:Frame statistics]
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberminR, C(FrameR, C)
For each numerical column, returns the minimal values as a series. The function skips over missing and `NaN` values. When there are no values, the result is `NaN`. [category:Frame statistics]
Public methodStatic memberminK, V(SeriesK, V)
Returns the minimum of the values in a series. The result is an option value. When the series contains no values, the result is `None`. [category:Series statistics]
Public methodStatic memberminByT, a, K
Returns the key and value of the least element in the series. The result is an optional value. When the series contains no values, the result is `None`. [category:Series statistics]
Public methodStatic membermovingCountK
Returns a series that contains counts over a moving window of the specified size. The first `size-1` elements of the returned series are always missing; if the entire window contains missing values, the result is 0. [category:Moving windows]
Public methodStatic membermovingKurtK
Returns a series that contains kurtosis over a moving window of the specified size. The first `size-1` elements of the returned series are always missing; if the entire window contains missing values, the result is also missing. [category:Moving windows]
Public methodStatic membermovingMaxK
Returns a series that contains maximum over a moving window of the specified size. The first `size-1` elements are calculated using smaller windows spanning over `1 .. size-1` values. If the entire window contains missing values, the result is missing. [category:Moving windows]
Public methodStatic membermovingMeanK
Returns a series that contains means over a moving window of the specified size. The first `size-1` elements of the returned series are always missing; if the entire window contains missing values, the result is also missing. [category:Moving windows]
Public methodStatic membermovingMinK
Returns a series that contains minimum over a moving window of the specified size. The first `size-1` elements are calculated using smaller windows spanning over `1 .. size-1` values. If the entire window contains missing values, the result is missing. [category:Moving windows]
Public methodStatic membermovingSkewK
Returns a series that contains skewness over a moving window of the specified size. The first `size-1` elements of the returned series are always missing; if the entire window contains missing values, the result is also missing. [category:Moving windows]
Public methodStatic membermovingStdDevK
Returns a series that contains standard deviations over a moving window of the specified size. The first `size-1` elements of the returned series are always missing; if the entire window contains missing values, the result is also missing. [category:Moving windows]
Public methodStatic membermovingSumK
Returns a series that contains sums over a moving window of the specified size. The first `size-1` elements of the returned series are always missing; if the entire window contains missing values, the result is 0. [category:Moving windows]
Public methodStatic membermovingVarianceK
Returns a series that contains variance over a moving window of the specified size. The first `size-1` elements of the returned series are always missing; if the entire window contains missing values, the result is also missing. [category:Moving windows]
Public methodStatic membernumSumK, V
Sum that operates only any appropriate numeric type. When there are no available values, the result is zero of the approriate numeric type. [category:Series statistics]
Public methodStatic memberskewK(SeriesK, Double)
Returns the skewness of the values in a series. The function skips over missing values and `NaN` values. When there are less than 3 values, the result is NaN. [category:Series statistics]
Public methodStatic memberskewR, C(FrameR, C)
For each numerical column, returns the skewness of the values in a series. The function skips over missing values and `NaN` values. When there are less than 3 values, the result is NaN. [category:Frame statistics]
Public methodStatic memberstdDevK(SeriesK, Double)
Returns the standard deviation of the values in a series. The function skips over missing values and `NaN` values. When there are less than 2 values, the result is NaN. [category:Series statistics]
Public methodStatic memberstdDevR, C(FrameR, C)
For each numerical column, returns the standard deviation of the values in the column. The function skips over missing values and `NaN` values. When there are less than 2 values, the result is NaN. [category:Frame statistics]
Public methodStatic membersumK(SeriesK, Double)
Returns the sum of the values in a series. The function skips over missing values and `NaN` values. When there are no available values, the result is NaN. [category:Series statistics]
Public methodStatic membersumR, C(FrameR, C)
For each numerical column, returns the sum of the values in the column. The function skips over missing values and `NaN` values. When there are no [category:Frame statistics]
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic membervarianceK(SeriesK, Double)
Returns the variance of the values in a series. The function skips over missing values and `NaN` values. When there are less than 2 values, the result is NaN. [category:Series statistics]
Public methodStatic membervarianceR, C(FrameR, C)
For each numerical column, returns the variance of the values in the column. The function skips over missing values and `NaN` values. When there are less than 2 values, the result is NaN. [category:Frame statistics]
Top
See Also