Header menu logo FSharp.Stats

SummaryStats Module

Module to compute summary statistics for a collection of numeric values, including the count, mean, M2 (sum of squared deviations), minimum, and maximum.

Types

Type Description

SummaryStats<'T>

Represents summary statistics for a collection of numeric values, including the count, mean, M2 (sum of squared deviations), minimum, and maximum.

Functions and values

Function or value Description

createSummaryStats n mean sos min max

Full Usage: createSummaryStats n mean sos min max

Parameters:
    n : 'a - The number of observed data points.
    mean : 'a - The running mean of the data points.
    sos : 'a - The sum of squared deviations fom the mean
    min : 'a - The minimum observed value.
    max : 'a - The maximum observed value.

Returns: SummaryStats<'a> A new SummaryStats record.

Creates a SummaryStats record from the given fields.

n : 'a

The number of observed data points.

mean : 'a

The running mean of the data points.

sos : 'a

The sum of squared deviations fom the mean

min : 'a

The minimum observed value.

max : 'a

The maximum observed value.

Returns: SummaryStats<'a>

A new SummaryStats record.

mean sStats

Full Usage: mean sStats

Parameters:
Returns: 'a The mean of the observed data.
Modifiers: inline
Type parameters: 'a

Returns the mean (average) value from the specified summary statistics.

sStats : SummaryStats<'a>

A summary statistics record.

Returns: 'a

The mean of the observed data.

ofArray arr

Full Usage: ofArray arr

Parameters:
    arr : ^T[] - An array of numeric data.

Returns: SummaryStats<^T> A SummaryStats record containing the final count, mean, sum of squares, min, and max.
Modifiers: inline
Type parameters: ^T, ^a, ^b, ^c

Computes Welford-based summary statistics (count, mean, sum of squares, min, max) in a single pass for a given array of numeric data.

This function iterates over the array exactly once. It is generic over any numeric type 'T that supports F# inlined arithmetic.

arr : ^T[]

An array of numeric data.

Returns: SummaryStats<^T>

A SummaryStats record containing the final count, mean, sum of squares, min, and max.

ofSeq items

Full Usage: ofSeq items

Parameters:
    items : ^T seq - A sequence of numeric data.

Returns: SummaryStats<^T> A SummaryStats record containing the final count, mean, sum of squares, min, and max.
Modifiers: inline
Type parameters: ^T, ^a, ^b, ^c

Computes Welford-based summary statistics (count, mean, sum of squares, min, max) in a single pass for a given sequence of numeric data.

This function reads the sequence one item at a time (via its enumerator), applying Welford's online update formula. It is generic over any numeric type 'T that supports F# inlined arithmetic.

items : ^T seq

A sequence of numeric data.

Returns: SummaryStats<^T>

A SummaryStats record containing the final count, mean, sum of squares, min, and max.

stDev sStats

Full Usage: stDev sStats

Parameters:
Returns: 'c The sample standard deviation of the observed data.
Modifiers: inline
Type parameters: ^T, ^a, ^b, 'c

Returns the sample standard deviation from the specified summary statistics.

This is the square root of the sample variance.

sStats : SummaryStats<^T>

A summary statistics record.

Returns: 'c

The sample standard deviation of the observed data.

stDevPopulation sStats

Full Usage: stDevPopulation sStats

Parameters:
Returns: 'b The population standard deviation of the observed data.
Modifiers: inline
Type parameters: ^T, ^a, 'b

Returns the population standard deviation from the specified summary statistics.

This is the square root of the population variance.

sStats : SummaryStats<^T>

A summary statistics record.

Returns: 'b

The population standard deviation of the observed data.

var sStats

Full Usage: var sStats

Parameters:
Returns: 'b The sample variance of the observed data.
Modifiers: inline
Type parameters: ^T, ^a, 'b

Returns the sample variance from the specified summary statistics, using N - 1 in the denominator.

The sample variance is computed as SumOfSquares / (N - 1), which is the unbiased estimator when N > 1.

sStats : SummaryStats<^T>

A summary statistics record.

Returns: 'b

The sample variance of the observed data.

varPopulation sStats

Full Usage: varPopulation sStats

Parameters:
Returns: 'b The population variance of the observed data.
Modifiers: inline
Type parameters: ^a, 'b

Returns the population variance from the specified summary statistics.

The population variance is defined as SumOfSquares / N, where SumOfSquares is the sum of squared deviations (M2), and N is the total count.

sStats : SummaryStats<^a>

A summary statistics record.

Returns: 'b

The population variance of the observed data.

Type something to start searching.