Frequency Module

Represents a histogram (map from values to integer frequencies).

Functions and values

Function or value Description

add equalBandwidthOrNominal histA histB

Full Usage: add equalBandwidthOrNominal histA histB

Parameters:
    equalBandwidthOrNominal : bool - Is the binwidth equal for both frequencies? For nominal data set to true.
    histA : Map<'a, ^value> - Frequency map A
    histB : Map<'a, ^value> - Frequency map B

Returns: Map<'a, ^value> New frequency map that results from merged maps histA and histB. Values from keys that are present in both maps are handled by f
Modifiers: inline

Merges two histograms into a single histogram. If a key exists in both histograms, the value from histA is added to the value of histB.

When applied to continuous data the bandwidths must be equal!

equalBandwidthOrNominal : bool

Is the binwidth equal for both frequencies? For nominal data set to true.

histA : Map<'a, ^value>

Frequency map A

histB : Map<'a, ^value>

Frequency map B

Returns: Map<'a, ^value>

New frequency map that results from merged maps histA and histB. Values from keys that are present in both maps are handled by f

average hist

Full Usage: average hist

Parameters:
    hist : Map<'a, int> -

Returns: float

Returns the average of the frequencies in the map

hist : Map<'a, int>

Returns: float

Example

create bandwidth data

Full Usage: create bandwidth data

Parameters:
    bandwidth : float -
    data : seq<float> -

Returns: Map<float, int>

Creates probability mass function (histogram)

bandwidth : float

data : seq<float>

Returns: Map<float, int>

Example

createGeneric list

Full Usage: createGeneric list

Parameters:
    list : 'a list -

Returns: Map<'a, int>

Given the list [a,b,a,c,b,b], produce a map {a:2, b:3, c:1} which contains the count of each unique item in the list

list : 'a list

Returns: Map<'a, int>

Example

frequencies hist

Full Usage: frequencies hist

Parameters:
    hist : Map<'a, int> -

Returns: seq<int>

Gets an unsorted sequence of frequencies

hist : Map<'a, int>

Returns: seq<int>

Example

frequencyAt hist x

Full Usage: frequencyAt hist x

Parameters:
    hist : Map<'a, int> -
    x : 'a -

Returns: int

Gets the frequency associated with the value x

hist : Map<'a, int>

x : 'a

Returns: int

Example

getZip hist

Full Usage: getZip hist

Parameters:
    hist : Map<'a, int> -

Returns: seq<'a * int>

Returns tuple of (sorted value sequence, frequence sequence)

hist : Map<'a, int>

Returns: seq<'a * int>

Example

isSubset histA histB

Full Usage: isSubset histA histB

Parameters:
    histA : Map<float, int> -
    histB : Map<float, int> -

Returns: bool

Checks whether the values in this histogram A are a subset of the values in the histogram B

histA : Map<float, int>

histB : Map<float, int>

Returns: bool

Example

maxLike hist

Full Usage: maxLike hist

Parameters:
    hist : Map<'a, int> -

Returns: int

Gets the largest frequency in the map.

hist : Map<'a, int>

Returns: int

Example

merge equalBandwidthOrNominal histA histB

Full Usage: merge equalBandwidthOrNominal histA histB

Parameters:
    equalBandwidthOrNominal : bool - Is the binwidth equal for both frequencies? For nominal data set to true.
    histA : Map<'a, 'value> - Frequency map A
    histB : Map<'a, 'value> - Frequency map B

Returns: Map<'a, 'value> New frequency map that results from merged maps histA and histB.

Merges two histograms into a single histogram. If a key exists in both histograms, the value in histA is superseded by the value in histB.

When applied to continuous data the bandwidths must be equal!This function is not commutative! (merge a b) is not equal to (merge b a)

equalBandwidthOrNominal : bool

Is the binwidth equal for both frequencies? For nominal data set to true.

histA : Map<'a, 'value>

Frequency map A

histB : Map<'a, 'value>

Frequency map B

Returns: Map<'a, 'value>

New frequency map that results from merged maps histA and histB.

mergeBy equalBandwidthOrNominal f histA histB

Full Usage: mergeBy equalBandwidthOrNominal f histA histB

Parameters:
    equalBandwidthOrNominal : bool - Is the binwidth equal for both frequencies? For nominal data set to true.
    f : 'value -> 'value -> 'value - Function to transform values if key is present in both histograms. `mapA-value → mapB-value → newValue`
    histA : Map<'a, 'value>
    histB : Map<'a, 'value>

Returns: Map<'a, 'value> New frequency map that results from merged maps mapA and mapB. Values from keys that are present in both maps are handled by f

Merges two histograms into a single histogram. If a key exists in both maps, the value is determined by f with the first value being from mapA and the second originating from mapB.

When applied to continuous data the bandwidths must be equal!This function is not commutative! (mergeBy f a b) is not equal to (mergeBy f b a)

equalBandwidthOrNominal : bool

Is the binwidth equal for both frequencies? For nominal data set to true.

f : 'value -> 'value -> 'value

Function to transform values if key is present in both histograms. `mapA-value → mapB-value → newValue`

histA : Map<'a, 'value>
histB : Map<'a, 'value>
Returns: Map<'a, 'value>

New frequency map that results from merged maps mapA and mapB. Values from keys that are present in both maps are handled by f

subtract equalBandwidthOrNominal histA histB

Full Usage: subtract equalBandwidthOrNominal histA histB

Parameters:
    equalBandwidthOrNominal : bool - Is the binwidth equal for both frequencies? For nominal data set to true.
    histA : Map<'a, ^value> - Frequency map A
    histB : Map<'a, ^value> - Frequency map B

Returns: Map<'a, ^value>
Modifiers: inline

Merges two histograms into a single histogram. If a key exists in both histograms, the value from histB is subtracted from the value of histA.

When applied to continuous data the bandwidths must be equal!This function is not commutative! (subtract a b) is not equal to (subtract b a)

equalBandwidthOrNominal : bool

Is the binwidth equal for both frequencies? For nominal data set to true.

histA : Map<'a, ^value>

Frequency map A

histB : Map<'a, ^value>

Frequency map B

Returns: Map<'a, ^value>

sum hist

Full Usage: sum hist

Parameters:
    hist : Map<'a, int> -

Returns: int

Returns the total of the frequencies in the map

hist : Map<'a, int>

Returns: int

Example