Header menu logo FSharp.Stats

Array Module

Functions and values

Function or value Description

Array.cityblock a1 a2

Full Usage: Array.cityblock a1 a2

Parameters:
    a1 : ^a array -
    a2 : ^a array -

Returns: float
Modifiers: inline
Type parameters: ^a, ^a

Cityblock distance of two coordinate arrays

a1 : ^a array

a2 : ^a array

Returns: float

Example

Array.cityblockNaN a1 a2

Full Usage: Array.cityblockNaN a1 a2

Parameters:
    a1 : float array -
    a2 : float array -

Returns: float

Cityblock distance of two coordinate float arrays (ignores nan)

a1 : float array

a2 : float array

Returns: float

Example

Array.euclidean a1 a2

Full Usage: Array.euclidean a1 a2

Parameters:
    a1 : ^a array -
    a2 : ^a array -

Returns: float
Modifiers: inline
Type parameters: ^a, ^a, ^b

Euclidean distance of two coordinate arrays

a1 : ^a array

a2 : ^a array

Returns: float

Example

Array.euclideanNaN a1 a2

Full Usage: Array.euclideanNaN a1 a2

Parameters:
    a1 : float array -
    a2 : float array -

Returns: float

Euclidean distance of two coordinate float arrays (ignores nan)

a1 : float array

a2 : float array

Returns: float

Example

Array.euclideanNaNSquared a1 a2

Full Usage: Array.euclideanNaNSquared a1 a2

Parameters:
    a1 : float array -
    a2 : float array -

Returns: float

Squared Euclidean distance of two coordinate float arrays (ignores nan)

a1 : float array

a2 : float array

Returns: float

Example

Array.hamming a1 a2

Full Usage: Array.hamming a1 a2

Parameters:
    a1 : 'a array - first array
    a2 : 'a array - second array

Returns: int Hamming distance between elements of given arrays
Modifiers: inline
Type parameters: 'a

Calculates Hamming distance of two coordinate arrays

Note, distance between Nan and Nan is equal to 1

a1 : 'a array

first array

a2 : 'a array

second array

Returns: int

Hamming distance between elements of given arrays

Example

 
 // e.g. a1 and a2 initialization
 let a1 = [|1; 2; 3|]
 let a2 = [|9; 2; 3|]
 
 // Apply the hamming to a1 and a2
 Array.hamming a1 a2
val a1: int array
val a2: int array
module Array from Microsoft.FSharp.Collections

Array.minkowski a1 a2 p

Full Usage: Array.minkowski a1 a2 p

Parameters:
    a1 : ^a array - first array
    a2 : ^a array - second array
    p : float - float constrained to `p > 0`

Returns: float option Minkowski distance between elements of given arrays. Returns NaN if arrays contain NaN.
Modifiers: inline
Type parameters: ^a

The [Minkowski distance](https://en.wikipedia.org/wiki/Minkowski_distance) between two arrays of order `p`.

The two arrays need not have equal lengths: when one array is exhausted any remaining elements in the other array are ignored.

a1 : ^a array

first array

a2 : ^a array

second array

p : float

float constrained to `p > 0`

Returns: float option

Minkowski distance between elements of given arrays. Returns NaN if arrays contain NaN.

Example

 
 // e.g. a1 and a2 initialization
 let a1 = [|3.14; 2.0; 3.1|]
 let a2 = [|9.1; 2.5; 3.7|]
 
 // Apply the minkowski distance to a1 and a2
 Array.minkowski a1 a2 3
val a1: float array
val a2: float array
module Array from Microsoft.FSharp.Collections

Array.minkowskiNaN a1 a2 p

Full Usage: Array.minkowskiNaN a1 a2 p

Parameters:
    a1 : float array - first array
    a2 : float array - second array
    p : float - float constrained to `p > 0`

Returns: float option Minkowski distance between elements of given arrays.
Modifiers: inline

The [Minkowski distance](https://en.wikipedia.org/wiki/Minkowski_distance) between two arrays (ignores NaN) of order `p`.

Non-regular differences between the sequences are ignored. The two arrays need not have equal lengths: when one array is exhausted any remaining elements in the other array are ignored.

a1 : float array

first array

a2 : float array

second array

p : float

float constrained to `p > 0`

Returns: float option

Minkowski distance between elements of given arrays.

Example

 
 // e.g. a1 and a2 initialization
 let a1 = [|3.14; 2.0; 3.1|]
 let a2 = [|9.1; 2.5; 3.7|]
 
 // Apply the minkowski distance to a1 and a2
 Array.minkowskiNaN a1 a2 3
val a1: float array
val a2: float array
module Array from Microsoft.FSharp.Collections

Type something to start searching.