Vector Module

Types and nested modules

Type/Module Description

Generic

SummaryStats

Module to compute common statistical measure on

range

rangef

Functions and values

Function or value Description

add vector1 vector2

Full Usage: add vector1 vector2

Parameters:
Returns: Vector<float>

Builds a new vector whose elements are the results of adding the corresponding elements of the two vectors pairwise. The two input vectors must have the same lengths, otherwise ArgumentException is raised.

vector1 : Vector<float>

vector2 : Vector<float>

Returns: Vector<float>

Example

copy vector

Full Usage: copy vector

Parameters:
Returns: Vector<float>

Builds a new vector that contains the elements of the given vector.

vector : vector

Returns: Vector<float>

Example

countBy projection vector

Full Usage: countBy projection vector

Parameters:
    projection : 'a -> bool
    vector : Vector<'a>

Returns: (bool * int) list
projection : 'a -> bool
vector : Vector<'a>
Returns: (bool * int) list

countR (arg1, arg2)

Full Usage: countR (arg1, arg2)

Parameters:
    arg0 : int
    arg1 : int

Returns: int
arg0 : int
arg1 : int
Returns: int

countRF (arg1, arg2, arg3)

Full Usage: countRF (arg1, arg2, arg3)

Parameters:
    arg0 : float
    arg1 : float
    arg2 : float

Returns: int
arg0 : float
arg1 : float
arg2 : float
Returns: int

cov v1 v2

Full Usage: cov v1 v2

Parameters:
Returns: float

Returns the sample covariance of two random variables v1 and v2. (Bessel's correction by N-1)

v1 : vector

v2 : vector

Returns: float

Example

covPopulation v1 v2

Full Usage: covPopulation v1 v2

Parameters:
Returns: float

Returns an estimator of the population covariance of two random variables v1 and v2

v1 : vector

v2 : vector

Returns: float

Example

cptMax vector1 vector2

Full Usage: cptMax vector1 vector2

Parameters:
Returns: Vector<float>
vector1 : vector
vector2 : vector
Returns: Vector<float>

cptMin vector1 vector2

Full Usage: cptMin vector1 vector2

Parameters:
Returns: Vector<float>
vector1 : vector
vector2 : vector
Returns: Vector<float>

cptMul vector1 vector2

Full Usage: cptMul vector1 vector2

Parameters:
Returns: Vector<float>

Builds a new vector whose elements are the results of multiplying the corresponding elements of the given vectors. The two input vectors must have the same lengths, otherwise ArgumentException is raised.

vector1 : Vector<float>

vector2 : Vector<float>

Returns: Vector<float>

Example

create count value

Full Usage: create count value

Parameters:
    count : int
    value : float

Returns: Vector<float>

Creates vector of length count and fills it with value

count : int
value : float
Returns: Vector<float>

dot vector1 vector2

Full Usage: dot vector1 vector2

Parameters:
Returns: float

Dot product of the two vectors

vector1 : Vector<float>

vector2 : Vector<float>

Returns: float

Example

exists predicate vector

Full Usage: exists predicate vector

Parameters:
    predicate : float -> bool
    vector : vector

Returns: bool
predicate : float -> bool
vector : vector
Returns: bool

existsi predicate vector

Full Usage: existsi predicate vector

Parameters:
    predicate : int -> float -> bool
    vector : vector

Returns: bool
predicate : int -> float -> bool
vector : vector
Returns: bool

fold folder state vector

Full Usage: fold folder state vector

Parameters:
    folder : 'State -> float -> 'State -
    state : 'State -
    vector : vector -

Returns: 'State

Applies a function to each element of the vector, threading an accumulator argument through the computation.

folder : 'State -> float -> 'State

state : 'State

vector : vector

Returns: 'State

Example

foldi folder state vector

Full Usage: foldi folder state vector

Parameters:
    folder : int -> 'State -> float -> 'State -
    state : 'State -
    vector : vector -

Returns: 'State

Applies a function to each element of the vector and their corresponding index, threading an accumulator argument through the computation.

folder : int -> 'State -> float -> 'State

state : 'State

vector : vector

Returns: 'State

Example

forall predicate vector

Full Usage: forall predicate vector

Parameters:
    predicate : float -> bool
    vector : vector

Returns: bool
predicate : float -> bool
vector : vector
Returns: bool

foralli predicate vector

Full Usage: foralli predicate vector

Parameters:
    predicate : int -> float -> bool
    vector : vector

Returns: bool
predicate : int -> float -> bool
vector : vector
Returns: bool

get vector index

Full Usage: get vector index

Parameters:
    vector : vector -
    index : int -

Returns: float

Returns the value of the vector at the given index

vector : vector

index : int

Returns: float

Example

getCvOfReplicates rep data

Full Usage: getCvOfReplicates rep data

Parameters:
Returns: Vector<float>

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

rep : int

data : vector

Returns: Vector<float>

Example

getMeanOfReplicates rep data

Full Usage: getMeanOfReplicates rep data

Parameters:
Returns: Vector<float>

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

rep : int

data : vector

Returns: Vector<float>

Example

getStDevOfReplicates rep data

Full Usage: getStDevOfReplicates rep data

Parameters:
Returns: Vector<float>

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

rep : int

data : vector

Returns: Vector<float>

Example

idxR (arg1, arg2) i

Full Usage: idxR (arg1, arg2) i

Parameters:
    arg0 : int
    arg1 : int
    i : int

Returns: int
arg0 : int
arg1 : int
i : int
Returns: int

idxRF (arg1, arg2, arg3) i

Full Usage: idxRF (arg1, arg2, arg3) i

Parameters:
    arg0 : float
    arg1 : float
    arg2 : float
    i : int

Returns: float
arg0 : float
arg1 : float
arg2 : float
i : int
Returns: float

init count initializer

Full Usage: init count initializer

Parameters:
    count : int -
    initializer : int -> float -

Returns: Vector<float>

Initiates vector of length count and fills it by applying initializer function on indices

count : int

initializer : int -> float

Returns: Vector<float>

Example

inplaceAdd vector1 vector2

Full Usage: inplaceAdd vector1 vector2

Parameters:

Add values of vector2 to values of vector1. Vector2 stays unchanged.

vector1 : Vector<float>

vector2 : Vector<float>

Example

inplaceAssign f vector

Full Usage: inplaceAssign f vector

Parameters:
    f : int -> float -
    vector : vector -

Applies the given function to each of the indexes of the vector. No new vector is created.

f : int -> float

vector : vector

Example

inplaceCptMul vector1 vector2

Full Usage: inplaceCptMul vector1 vector2

Parameters:

Multiply values of vector1 with values of vector2. Vector2 stays unchanged.

vector1 : Vector<float>

vector2 : Vector<float>

Example

inplaceMap f vector

Full Usage: inplaceMap f vector

Parameters:
    f : float -> float -
    vector : vector -

Applies the given function to each of the elements of the vector. No new vector is created.

f : float -> float

vector : vector

Example

inplaceMapi f vector

Full Usage: inplaceMapi f vector

Parameters:
    f : int -> float -> float -
    vector : vector -

Applies the given function to each of the elements of the vector and their corresponding index. No new vector is created.

f : int -> float -> float

vector : vector

Example

inplaceScale scalar vector

Full Usage: inplaceScale scalar vector

Parameters:
    scalar : float -
    vector : Vector<float> -

Multiply values of vector with scalar.

scalar : float

vector : Vector<float>

Example

inplaceSub vector1 vector2

Full Usage: inplaceSub vector1 vector2

Parameters:

Substract values of vector2 from values of vector1. Vector2 stays unchanged.

vector1 : Vector<float>

vector2 : Vector<float>

Example

interval items

Full Usage: interval items

Parameters:
Returns: Interval<'T>
items : Vector<'T>
Returns: Interval<'T>

length vector

Full Usage: length vector

Parameters:
Returns: int

Returns length of vector

vector : vector

Returns: int

Example

map mapping vector

Full Usage: map mapping vector

Parameters:
    mapping : float -> float -
    vector : vector -

Returns: Vector<float>

Builds a new vector whose elements are the results of applying the given function to each of the elements of the vector.

mapping : float -> float

vector : vector

Returns: Vector<float>

Example

map2 mapping vector1 vector2

Full Usage: map2 mapping vector1 vector2

Parameters:
    mapping : float -> float -> float -
    vector1 : vector -
    vector2 : vector -

Returns: Vector<float>

Builds a new vector whose elements are the results of applying the given function to the corresponding elements of the two vectors pairwise. The two input vectors must have the same lengths, otherwise ArgumentException is raised.

mapping : float -> float -> float

vector1 : vector

vector2 : vector

Returns: Vector<float>

Example

map3 mapping vector1 vector2 vector3

Full Usage: map3 mapping vector1 vector2 vector3

Parameters:
    mapping : float -> float -> float -> float -
    vector1 : vector -
    vector2 : vector -
    vector3 : vector -

Returns: Vector<float>

Builds a new vector whose elements are the results of applying the given function to the corresponding elements of the two vectors pairwise. The two input vectors must have the same lengths, otherwise ArgumentException is raised.

mapping : float -> float -> float -> float

vector1 : vector

vector2 : vector

vector3 : vector

Returns: Vector<float>

Example

mapi mapping vector

Full Usage: mapi mapping vector

Parameters:
    mapping : int -> float -> float -
    vector : vector -

Returns: vector

Builds a new vector whose elements are the results of applying the given function to each of the elements of the vector and their corresponding index.

mapping : int -> float -> float

vector : vector

Returns: vector

Example

mean items

Full Usage: mean items

Parameters:
Returns: ^a
Modifiers: inline

Computes the population mean (Normalized by N)

items : Vector<^T>

Returns: ^a

Example

median items

Full Usage: median items

Parameters:
Returns: ^T
Modifiers: inline
Type parameters: ^T, ^a

Computes the sample median

items : Vector<^T>

Returns: ^T

Example

medianAbsoluteDev items

Full Usage: medianAbsoluteDev items

Parameters:
Returns: float

Median absolute deviation (MAD)

items : vector

Returns: float

Example

mulRVV vector1 vector2

Full Usage: mulRVV vector1 vector2

Parameters:
Returns: float
vector1 : rowvec
vector2 : vector
Returns: float

mulVRV vector1 vector2

Full Usage: mulVRV vector1 vector2

Parameters:
Returns: DenseMatrix<float>
vector1 : vector
vector2 : rowvec
Returns: DenseMatrix<float>

nRows vector

Full Usage: nRows vector

Parameters:
Returns: int

Returns length of vector

vector : vector

Returns: int

Example

neg vector

Full Usage: neg vector

Parameters:
Returns: Vector<float>

Builds a new vector whose elements are the results of multiplying -1 with each of the elements of the vector.

vector : Vector<float>

Returns: Vector<float>

Example

norm vector

Full Usage: norm vector

Parameters:
Returns: float

Euklidian norm of the vector

vector : vector

Returns: float

Example

ofArray array

Full Usage: ofArray array

Parameters:
    array : float[] -

Returns: vector

Creates vector with values of array

array : float[]

Returns: vector

Example

ofList list

Full Usage: ofList list

Parameters:
    list : float list -

Returns: Vector<float>

Creates vector with values of list

list : float list

Returns: Vector<float>

Example

ofScalar value

Full Usage: ofScalar value

Parameters:
    value : float -

Returns: Vector<float>

Creates one dimensional vector of value

value : float

Returns: Vector<float>

Example

ofSeq source

Full Usage: ofSeq source

Parameters:
    source : seq<float> -

Returns: Vector<float>

Creates vector with values of sequence

source : seq<float>

Returns: Vector<float>

Example

oneCreate count

Full Usage: oneCreate count

Parameters:
    count : int -

Returns: Vector<float>

Creates a vector of length count and fills it with ones

count : int

Returns: Vector<float>

Example

prod vector

Full Usage: prod vector

Parameters:
Returns: float

Product of all elements of the vector

vector : vector

Returns: float

Example

range n1 n2

Full Usage: range n1 n2

Parameters:
    n1 : int
    n2 : int

Returns: Vector<float>
n1 : int
n2 : int
Returns: Vector<float>

rangef a b c

Full Usage: rangef a b c

Parameters:
    a : float
    b : float
    c : float

Returns: Vector<float>
a : float
b : float
c : float
Returns: Vector<float>

raw vector

Full Usage: raw vector

Parameters:
Returns: 'T array

Returns the raw data array without copy

vector : Vector<'T>

Returns: 'T array

Example

scale scalar vector

Full Usage: scale scalar vector

Parameters:
    scalar : float -
    vector : Vector<float> -

Returns: Vector<float>

Builds a new vector whose elements are the results of multiplying the given scalar with each of the elements of the vector.

scalar : float

vector : Vector<float>

Returns: Vector<float>

Example

set vector index value

Full Usage: set vector index value

Parameters:
    vector : vector -
    index : int -
    value : float -

Sets the value to the vector at the given index

vector : vector

index : int

value : float

Example

singleton x

Full Usage: singleton x

Parameters:
    x : float

Returns: Vector<float>

Applies the given function to each of the indexes of the vector.

Builds vector of Length 1 from value x

x : float
Returns: Vector<float>

splitVector indices v

Full Usage: splitVector indices v

Parameters:
    indices : int[] -
    v : Vector<'a> -

Returns: Vector<'a> * Vector<'a>

Splits a vector according to given indices. Returns (vector including values according to indices, rest)

indices : int[]

v : Vector<'a>

Returns: Vector<'a> * Vector<'a>

Example

stats items

Full Usage: stats items

Parameters:
Returns: SummaryStats<^T>
Modifiers: inline
Type parameters: ^T, ^a, ^b

Returns SummaryStats of vector with N, mean, sum-of-squares, minimum and maximum

items : Vector<^T>

Returns: SummaryStats<^T>

Example

sub vector1 vector2

Full Usage: sub vector1 vector2

Parameters:
Returns: Vector<float>

Builds a new vector whose elements are the results of substracting the corresponding elements of vector2 from vector1. The two input vectors must have the same lengths, otherwise ArgumentException is raised.

vector1 : Vector<float>

vector2 : Vector<float>

Returns: Vector<float>

Example

sum vector

Full Usage: sum vector

Parameters:
Returns: float

Sum of all elements of the vector

vector : Vector<float>

Returns: float

Example

toArray vector

Full Usage: toArray vector

Parameters:
Returns: float[]

Creates array with values of vector

vector : vector

Returns: float[]

Example

toThePower n vector

Full Usage: toThePower n vector

Parameters:
    n : float -
    vector : vector -

Returns: Vector<float>

Builds a new vector whose elements are the results of exponentiating each of the elements of the vector with n.

n : float

vector : vector

Returns: Vector<float>

Example

transpose vector

Full Usage: transpose vector

Parameters:
Returns: RowVector<float>
vector : vector
Returns: RowVector<float>

zeroCreate count

Full Usage: zeroCreate count

Parameters:
    count : int -

Returns: Vector<float>

Creates a vector of length count and fills it with zeros

count : int

Returns: Vector<float>

Example