Header menu logo FSharp.Stats

Seq Module

Module to compute common statistical measures.

Nested modules

Modules Description

UtilityFunctions

A module which implements helper functions to provide special statistical measures

Functions and values

Function or value Description

Seq.cov seq1 seq2

Full Usage: Seq.cov seq1 seq2

Parameters:
    seq1 : ^T seq - The first input sequence.
    seq2 : ^T seq - The second input sequence.

Returns: ^U The sample covariance estimator (Bessel's correction by N-1) of the two input sequences.
Modifiers: inline
Type parameters: ^T, ^a, ^U

Computes the sample covariance of two random variables.

Returns NaN if data is empty or if any entry is NaN.

seq1 : ^T seq

The first input sequence.

seq2 : ^T seq

The second input sequence.

Returns: ^U

The sample covariance estimator (Bessel's correction by N-1) of the two input sequences.

ArgumentException Thrown when the input sequences have different lengths.
Example

 let x = [1.0; 2.0; 3.0; 4.0; 5.0]
 let y = [2.0; 4.0; 6.0; 8.0; 10.0]
 let cov = Seq.cov x y // returns 5.0
val x: float list
val y: float list
val cov: obj
module Seq from Microsoft.FSharp.Collections

Seq.covBy f seq

Full Usage: Seq.covBy f seq

Parameters:
    f : 'T -> ^a * ^a - A function applied to transform each element of the input sequence into a tuple of paired observations.
    seq : 'T seq - The input sequence.

Returns: ^U The sample covariance estimator (Bessel's correction by N-1) of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^b, ^U

Computes the sample covariance of two random variables generated by applying a function to the input sequence.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a * ^a

A function applied to transform each element of the input sequence into a tuple of paired observations.

seq : 'T seq

The input sequence.

Returns: ^U

The sample covariance estimator (Bessel's correction by N-1) of the transformed input sequence.

Example

 // To get the sample covariance between x and y observations:
 let xy = [ {| x = 5.; y = 2. |}
            {| x = 12.; y = 8. |}
            {| x = 18.; y = 18. |}
            {| x = -23.; y = -20. |} 
            {| x = 45.; y = 28. |} ]
 
 xy |> Seq.covBy (fun x -> x.x, x.y) // evaluates to 434.90
val xy: {| x: float; y: float |} list
anonymous record field x: float
anonymous record field y: float
module Seq from Microsoft.FSharp.Collections

Seq.covOfPairs seq

Full Usage: Seq.covOfPairs seq

Parameters:
    seq : (^T * ^T) seq - The input sequence.

Returns: ^U The sample covariance estimator (Bessel's correction by N-1) of the paired observations.
Modifiers: inline
Type parameters: ^T, ^a, ^U

Computes the sample covariance of two random variables. The covariance will be calculated between the paired observations.

Returns NaN if data is empty or if any entry is NaN.

seq : (^T * ^T) seq

The input sequence.

Returns: ^U

The sample covariance estimator (Bessel's correction by N-1) of the paired observations.

Example

 // Consider a sequence of paired x and y values:
 // [(x1, y1); (x2, y2); (x3, y3); (x4, y4); ... ]
 let xy = [(5., 2.); (12., 8.); (18., 18.); (-23., -20.); (45., 28.)]
 
 // To get the sample covariance between x and y:
 xy |> Seq.covOfPairs // evaluates to 434.9
val xy: (float * float) list
module Seq from Microsoft.FSharp.Collections

Seq.covPopulation seq1 seq2

Full Usage: Seq.covPopulation seq1 seq2

Parameters:
    seq1 : ^T seq - The first input sequence.
    seq2 : ^T seq - The second input sequence.

Returns: ^U The population covariance estimator (denominator N) of the two input sequences.
Modifiers: inline
Type parameters: ^T, ^a, ^U

Computes the population covariance of two random variables.

Returns NaN if data is empty or if any entry is NaN.

seq1 : ^T seq

The first input sequence.

seq2 : ^T seq

The second input sequence.

Returns: ^U

The population covariance estimator (denominator N) of the two input sequences.

ArgumentException Thrown when the input sequences have different lengths.
Example

 let x = [1.0; 2.0; 3.0; 4.0; 5.0]
 let y = [2.0; 4.0; 6.0; 8.0; 10.0]
 let cov = Seq.covPopulation x y // returns 4.0
val x: float list
val y: float list
val cov: obj
module Seq from Microsoft.FSharp.Collections

Seq.covPopulationBy f seq

Full Usage: Seq.covPopulationBy f seq

Parameters:
    f : 'T -> ^a * ^a - A function applied to transform each element of the input sequence into a tuple of paired observations.
    seq : 'T seq - The input sequence.

Returns: ^U The population covariance estimator (denominator N) of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^b, ^U

Computes the population covariance of two random variables generated by applying a function to the input sequence.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a * ^a

A function applied to transform each element of the input sequence into a tuple of paired observations.

seq : 'T seq

The input sequence.

Returns: ^U

The population covariance estimator (denominator N) of the transformed input sequence.

Example

 let data = [{| X = 1.0; Y = 2.0 |}; {| X = 2.0; Y = 4.0 |}; {| X = 3.0; Y = 6.0 |}; {| X = 4.0; Y = 8.0 |}; {| X = 5.0; Y = 10.0 |}]
 let cov = data |> Seq.covPopulationBy (fun d -> d.X, d.Y) // returns 4.0
val data: {| X: float; Y: float |} list
anonymous record field X: float
anonymous record field Y: float
val cov: obj
module Seq from Microsoft.FSharp.Collections

Seq.covPopulationOfPairs seq

Full Usage: Seq.covPopulationOfPairs seq

Parameters:
    seq : (^T * ^T) seq - The input sequence.

Returns: ^U The population covariance estimator (denominator N) of the paired observations.
Modifiers: inline
Type parameters: ^T, ^a, ^U

Computes the population covariance of two random variables. The covariance will be calculated between the paired observations.

Returns NaN if data is empty or if any entry is NaN.

seq : (^T * ^T) seq

The input sequence.

Returns: ^U

The population covariance estimator (denominator N) of the paired observations.

Example

 let xy = [(1.0, 2.0); (2.0, 4.0); (3.0, 6.0); (4.0, 8.0); (5.0, 10.0)]
 let cov = Seq.covPopulationOfPairs xy // returns 4.0
val xy: (float * float) list
val cov: obj
module Seq from Microsoft.FSharp.Collections

Seq.cv items

Full Usage: Seq.cv items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^U The Coefficient of Variation of a sample (Bessel's correction by N-1) of the input sequence.
Modifiers: inline
Type parameters: ^T, ^U, ^a, ^b

Computes the Coefficient of Variation of a sample (Bessel's correction by N-1).

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: ^U

The Coefficient of Variation of a sample (Bessel's correction by N-1) of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let cv = Seq.cv values // returns approximately 0.52705
val values: float list
val cv: obj
module Seq from Microsoft.FSharp.Collections

Seq.cvBy f items

Full Usage: Seq.cvBy f items

Parameters:
    f : 'T -> ^a - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: ^U The Coefficient of Variation of a sample (Bessel's correction by N-1) of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^U, ^b, ^c

Computes the Coefficient of Variation of a sample (Bessel's correction by N-1) by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: ^U

The Coefficient of Variation of a sample (Bessel's correction by N-1) of the transformed input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let cv = Seq.cvBy (fun x -> x * 2.0) values // returns approximately 0.52705
val values: float list
val cv: obj
module Seq from Microsoft.FSharp.Collections

Seq.cvPopulation items

Full Usage: Seq.cvPopulation items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^U The Coefficient of Variation of the population of the input sequence.
Modifiers: inline
Type parameters: ^T, ^U, ^a, ^b

Computes the Coefficient of Variation of the population (population standard deviation).

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: ^U

The Coefficient of Variation of the population of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let cv = Seq.cvPopulation values // returns approximately 0.47140
val values: float list
val cv: obj
module Seq from Microsoft.FSharp.Collections

Seq.cvPopulationBy f items

Full Usage: Seq.cvPopulationBy f items

Parameters:
    f : 'T -> ^a - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: ^U The Coefficient of Variation of the population of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^U, ^b, ^c

Computes the Coefficient of Variation of the population (population standard deviation) by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: ^U

The Coefficient of Variation of the population of the transformed input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let cv = Seq.cvPopulationBy (fun x -> x * 2.0) values // returns approximately 0.47140
val values: float list
val cv: obj
module Seq from Microsoft.FSharp.Collections

Seq.getCvOfReplicates rep data

Full Usage: Seq.getCvOfReplicates rep data

Parameters:
    rep : int - The number of replicates.
    data : ^a seq - The input sequence.

Returns: ^a0 seq A sequence of coefficients of variation for each replicate group.
Modifiers: inline
Type parameters: ^a, ^a, ^b, ^c

Calculates the coefficient of variation based on the sample standard deviations with a given number of replicates present in the sequence.

rep : int

The number of replicates.

data : ^a seq

The input sequence.

Returns: ^a0 seq

A sequence of coefficients of variation for each replicate group.

ArgumentException Thrown when the sequence length is not a multiple of the replicate number.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0; 6.0]
 let cvs = Seq.getCvOfReplicates 2 values // returns seq [0.4714045208; 0.2020305089; 0.1285648693]
val values: float list
val cvs: obj
module Seq from Microsoft.FSharp.Collections

Seq.getMeanOfReplicates rep data

Full Usage: Seq.getMeanOfReplicates rep data

Parameters:
    rep : int - The number of replicates.
    data : ^a seq - The input sequence.

Returns: ^a0 seq A sequence of sample means for each replicate group.
Modifiers: inline
Type parameters: ^a, ^a

Calculates the sample means with a given number of replicates present in the sequence.

rep : int

The number of replicates.

data : ^a seq

The input sequence.

Returns: ^a0 seq

A sequence of sample means for each replicate group.

ArgumentException Thrown when the sequence length is not a multiple of the replicate number.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0; 6.0]
 let means = Seq.getMeanOfReplicates 2 values // returns seq [1.5; 3.5; 5.5]
val values: float list
val means: obj
module Seq from Microsoft.FSharp.Collections

Seq.getStDevOfReplicates rep data

Full Usage: Seq.getStDevOfReplicates rep data

Parameters:
    rep : int - The number of replicates.
    data : ^a seq - The input sequence.

Returns: 'c seq A sequence of sample standard deviations for each replicate group.
Modifiers: inline
Type parameters: ^a, ^a, ^b, 'c

Calculates the sample standard deviations with a given number of replicates present in the sequence.

rep : int

The number of replicates.

data : ^a seq

The input sequence.

Returns: 'c seq

A sequence of sample standard deviations for each replicate group.

ArgumentException Thrown when the sequence length is not a multiple of the replicate number.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0; 6.0]
 let stDevs = Seq.getStDevOfReplicates 2 values // returns seq [0.7071067812; 0.7071067812; 0.7071067812]
val values: float list
val stDevs: obj
module Seq from Microsoft.FSharp.Collections

Seq.mean items

Full Usage: Seq.mean items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^U The population mean (Normalized by N).
Modifiers: inline
Type parameters: ^T, ^U

Computes the population mean (Normalized by N).

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: ^U

The population mean (Normalized by N).

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.mean values // returns 3.0
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanBy f items

Full Usage: Seq.meanBy f items

Parameters:
    f : 'T -> ^U - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: ^U The population mean (Normalized by N) of the transformed sequence.
Modifiers: inline
Type parameters: 'T, ^U

Computes the population mean (Normalized by N) by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^U

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: ^U

The population mean (Normalized by N) of the transformed sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.meanBy (fun x -> x * 2.0) values // returns 6.0
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanGeometric items

Full Usage: Seq.meanGeometric items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^U The geometric mean of the input sequence.
Modifiers: inline
Type parameters: ^T, ^U

Computes the geometric mean.

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: ^U

The geometric mean of the input sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.meanGeometric values // returns approximately 2.60517
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanGeometricBy f items

Full Usage: Seq.meanGeometricBy f items

Parameters:
    f : 'T -> ^a - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: ^U The geometric mean of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^U

Computes the geometric mean by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: ^U

The geometric mean of the transformed input sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.meanGeometricBy (fun x -> x * 2.0) values // returns approximately 5.21034
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanHarmonic items

Full Usage: Seq.meanHarmonic items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^T The harmonic mean of the input sequence.
Modifiers: inline
Type parameters: ^T

Computes the harmonic mean.

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: ^T

The harmonic mean of the input sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.meanHarmonic values // returns approximately 2.18978
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanHarmonicBy f items

Full Usage: Seq.meanHarmonicBy f items

Parameters:
    f : 'T -> ^U - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: ^U The harmonic mean of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^U

Computes the harmonic mean by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^U

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: ^U

The harmonic mean of the transformed input sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.meanHarmonicBy (fun x -> x * 2.0) values // returns approximately 4.37956
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanQuadratic items

Full Usage: Seq.meanQuadratic items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^U The quadratic mean of the input sequence.
Modifiers: inline
Type parameters: ^T, ^a, ^U

Computes the quadratic mean.

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: ^U

The quadratic mean of the input sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.meanQuadratic values // returns approximately 3.31662
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanQuadraticBy f items

Full Usage: Seq.meanQuadraticBy f items

Parameters:
    f : 'a -> ^b - A function applied to transform each element of the sequence.
    items : ^T seq - The input sequence.

Returns: ^U The quadratic mean of the transformed input sequence.
Modifiers: inline
Type parameters: 'a, ^T, ^b, ^U

Computes the quadratic mean by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'a -> ^b

A function applied to transform each element of the sequence.

items : ^T seq

The input sequence.

Returns: ^U

The quadratic mean of the transformed input sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.meanQuadraticBy (fun x -> x * 2.0) values // returns approximately 4.69041576
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanTruncated proportion data

Full Usage: Seq.meanTruncated proportion data

Parameters:
    proportion : float - The proportion of values to discard from each end.
    data : ^T seq - The input sequence.

Returns: ^T The truncated (trimmed) mean of the input sequence.
Modifiers: inline
Type parameters: ^T

Computes the truncated (trimmed) mean where x*count of the highest, and x*count of the lowest values are discarded (total 2x).

Returns NaN if data is empty or if any entry is NaN.

proportion : float

The proportion of values to discard from each end.

data : ^T seq

The input sequence.

Returns: ^T

The truncated (trimmed) mean of the input sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = {1.0 .. 10.0}
 let m = Seq.meanTruncated 0.2 values // returns mean of {3.0 .. 8.0} or 5.5
val values: float seq
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.meanTruncatedBy f proportion data

Full Usage: Seq.meanTruncatedBy f proportion data

Parameters:
    f : 'T -> ^U - A function applied to transform each element of the sequence.
    proportion : float - The proportion of values to discard from each end.
    data : 'T seq - The input sequence.

Returns: ^U The truncated (trimmed) mean of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^U

Computes the truncated (trimmed) mean by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^U

A function applied to transform each element of the sequence.

proportion : float

The proportion of values to discard from each end.

data : 'T seq

The input sequence.

Returns: ^U

The truncated (trimmed) mean of the transformed input sequence.

DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let m = Seq.meanTruncatedBy (fun x -> x * 2.0) 0.2 values // returns 7.0
val values: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.median items

Full Usage: Seq.median items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^T The sample median of the input sequence.
Modifiers: inline
Type parameters: ^T, ^a

Computes the sample median.

items : ^T seq

The input sequence.

Returns: ^T

The sample median of the input sequence.

Example

 let values = [1; 2; 3; 4; 5]
 let m = Seq.median values // returns 3
val values: int list
val m: obj
module Seq from Microsoft.FSharp.Collections

Seq.medianAbsoluteDev data

Full Usage: Seq.medianAbsoluteDev data

Parameters:
    data : float seq - The input sequence.

Returns: float The median absolute deviation (MAD) of the input sequence.

Computes the median absolute deviation (MAD).

data : float seq

The input sequence.

Returns: float

The median absolute deviation (MAD) of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let mad = Seq.medianAbsoluteDev values // returns 1.0
val values: float list
val mad: obj
module Seq from Microsoft.FSharp.Collections

Seq.range items

Full Usage: Seq.range items

Parameters:
    items : 'a seq - The input sequence.

Returns: Interval<'a> The range of the input sequence as an Interval{T}.
Modifiers: inline
Type parameters: 'a

Computes the range of the input sequence.

items : 'a seq

The input sequence.

Returns: Interval<'a>

The range of the input sequence as an Interval{T}.

Example

 let values = [1; 2; 3; 4; 5]
 let r = Seq.range values // returns Interval.Closed(1, 5)
val values: int list
val r: obj
module Seq from Microsoft.FSharp.Collections

Seq.rangeBy f items

Full Usage: Seq.rangeBy f items

Parameters:
    f : 'a -> 'a0 - A function applied to transform each element of the sequence.
    items : 'a seq - The input sequence.

Returns: Interval<'a> The range of the transformed input sequence as an Interval{T}.
Modifiers: inline
Type parameters: 'a, 'a

Computes the range of the input sequence by applying a function to each element.

f : 'a -> 'a0

A function applied to transform each element of the sequence.

items : 'a seq

The input sequence.

Returns: Interval<'a>

The range of the transformed input sequence as an Interval{T}.

Example

 let values = [1; 2; 3; 4; 5]
 let r = Seq.rangeBy (fun x -> x * 2) values // returns Interval.Closed(1, 5)
val values: int list
val r: obj
module Seq from Microsoft.FSharp.Collections

Seq.sem items

Full Usage: Seq.sem items

Parameters:
    items : ^T seq - The input sequence.

Returns: float The standard error of the mean (SEM) of the input sequence.
Modifiers: inline
Type parameters: ^T, ^a, ^b

Computes the standard error of the mean (SEM) with Bessel corrected sample standard deviation.

items : ^T seq

The input sequence.

Returns: float

The standard error of the mean (SEM) of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let sem = Seq.sem values // returns approximately 0.70711
val values: float list
val sem: obj
module Seq from Microsoft.FSharp.Collections

Seq.stDev items

Full Usage: Seq.stDev items

Parameters:
    items : ^T seq - The input sequence.

Returns: 'U The sample standard deviation (Bessel's correction by N-1) of the input sequence.
Modifiers: inline
Type parameters: ^T, ^a, ^b, 'U

Computes the sample standard deviation.

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: 'U

The sample standard deviation (Bessel's correction by N-1) of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let sd = Seq.stDev values // returns approximately 1.58114
val values: float list
val sd: obj
module Seq from Microsoft.FSharp.Collections

Seq.stDevBy f items

Full Usage: Seq.stDevBy f items

Parameters:
    f : 'T -> ^a - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: 'U The sample standard deviation (Bessel's correction by N-1) of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^b, ^c, 'U

Computes the sample standard deviation by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: 'U

The sample standard deviation (Bessel's correction by N-1) of the transformed input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let sd = Seq.stDevBy (fun x -> x * 2.0) values // returns approximately 3.16228
val values: float list
val sd: obj
module Seq from Microsoft.FSharp.Collections

Seq.stDevPopulation items

Full Usage: Seq.stDevPopulation items

Parameters:
    items : ^T seq - The input sequence.

Returns: 'U The population standard deviation (denominator = N) of the input sequence.
Modifiers: inline
Type parameters: ^T, ^a, ^b, 'U

Computes the population standard deviation (denominator = N).

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: 'U

The population standard deviation (denominator = N) of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let sd = Seq.stDevPopulation values // returns approximately 1.41421
val values: float list
val sd: obj
module Seq from Microsoft.FSharp.Collections

Seq.stDevPopulationBy f items

Full Usage: Seq.stDevPopulationBy f items

Parameters:
    f : 'T -> ^a - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: 'U The population standard deviation (denominator = N) of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^b, ^c, 'U

Computes the population standard deviation (denominator = N) by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: 'U

The population standard deviation (denominator = N) of the transformed input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let sd = Seq.stDevPopulationBy (fun x -> x * 2.0) values // returns approximately 2.82843
val values: float list
val sd: obj
module Seq from Microsoft.FSharp.Collections

Seq.stats items

Full Usage: Seq.stats items

Parameters:
    items : ^T seq - The input sequence.

Returns: SummaryStats<^T> The SummaryStats of the input sequence.
Modifiers: inline
Type parameters: ^T, ^a, ^b, ^c

Returns SummaryStats of the input sequence with N, mean, sum-of-squares, minimum and maximum.

Welford�s online algorithm

items : ^T seq

The input sequence.

Returns: SummaryStats<^T>

The SummaryStats of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let stats = Seq.stats values
 // returns SummaryStats with:
 //   N = 5
 //   Mean = 3.0
 //   SumOfSquares = 5.0
 //   Minimum = 1.0
 //   Maximum = 5.0
val values: float list
val stats: obj
module Seq from Microsoft.FSharp.Collections

Seq.var items

Full Usage: Seq.var items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^U The sample variance (Bessel's correction by N-1) of the input sequence.
Modifiers: inline
Type parameters: ^T, ^U, ^a

Computes the sample variance (Bessel's correction by N-1).

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: ^U

The sample variance (Bessel's correction by N-1) of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let v = Seq.var values // returns 2.5
val values: float list
val v: obj
module Seq from Microsoft.FSharp.Collections

Seq.varBy f items

Full Usage: Seq.varBy f items

Parameters:
    f : 'T -> ^a - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: ^U The sample variance (Bessel's correction by N-1) of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^U, ^b

Computes the sample variance (Bessel's correction by N-1) by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: ^U

The sample variance (Bessel's correction by N-1) of the transformed input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let v = Seq.varBy (fun x -> x * 2.0) values // returns 10.0
val values: float list
val v: obj
module Seq from Microsoft.FSharp.Collections

Seq.varPopulation items

Full Usage: Seq.varPopulation items

Parameters:
    items : ^T seq - The input sequence.

Returns: ^U The population variance estimator (denominator N) of the input sequence.
Modifiers: inline
Type parameters: ^T, ^U, ^a

Computes the population variance estimator (denominator N).

Returns NaN if data is empty or if any entry is NaN.

items : ^T seq

The input sequence.

Returns: ^U

The population variance estimator (denominator N) of the input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let v = Seq.varPopulation values // returns 2.0
val values: float list
val v: obj
module Seq from Microsoft.FSharp.Collections

Seq.varPopulationBy f items

Full Usage: Seq.varPopulationBy f items

Parameters:
    f : 'T -> ^a - A function applied to transform each element of the sequence.
    items : 'T seq - The input sequence.

Returns: ^U The population variance estimator (denominator N) of the transformed input sequence.
Modifiers: inline
Type parameters: 'T, ^a, ^U, ^b

Computes the population variance estimator (denominator N) by applying a function to each element.

Returns NaN if data is empty or if any entry is NaN.

f : 'T -> ^a

A function applied to transform each element of the sequence.

items : 'T seq

The input sequence.

Returns: ^U

The population variance estimator (denominator N) of the transformed input sequence.

Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let v = Seq.varPopulationBy (fun x -> x * 2.0) values // returns 8.0
val values: float list
val v: obj
module Seq from Microsoft.FSharp.Collections

Seq.weightedMean weights items

Full Usage: Seq.weightedMean weights items

Parameters:
    weights : ^T seq - The sequence of weights.
    items : ^T seq - The input sequence.

Returns: 'b The weighted mean of the input sequence.
Modifiers: inline
Type parameters: ^T, ^a, ^U, 'b

Computes the Weighted Mean of the given values.

weights : ^T seq

The sequence of weights.

items : ^T seq

The input sequence.

Returns: 'b

The weighted mean of the input sequence.

ArgumentException Thrown when the items and weights sequences have different lengths.
DivideByZeroException Thrown if the sequence is empty and type cannot divide by zero.
Example

 let values = [1.0; 2.0; 3.0; 4.0; 5.0]
 let weights = [0.1; 0.2; 0.3; 0.2; 0.2]
 let m = Seq.weightedMean weights values // returns 3.2
val values: float list
val weights: float list
val m: obj
module Seq from Microsoft.FSharp.Collections

Type something to start searching.