hidden-markov-music.stats

General statistical functions.

log-row-stochastic-map?

(log-row-stochastic-map? m & {:keys [decimal], :or {decimal 10}})

Returns true if the map is logarithmically stochastic to the given precision.

log-stochastic-map?

(log-stochastic-map? m & {:keys [decimal], :or {decimal 10}})

Returns true if the map is logarithmically stochastic to the given precision.

normalize

(normalize sequence)

Normalizes a sequence.

random-row-stochastic-map

(random-row-stochastic-map row-keys col-keys)

Returns a nested hash-map representing a row-stochastic matrix. The outer key corresponds to a row, and the nested key corresponds to a column.

For example, take the matrix X given by:

    0 1 2
  +-------+
0 | a b c |
1 | d e f |
2 | g h i |
  +-------+

To obtain the element d, one could use (get-in X [1 0]), or to obtain the element h, one could use (get-in X [2 1]).

random-stochastic-map

(random-stochastic-map keys)

Returns a hash-map representing a randomly distributed stochastic vector.

random-stochastic-vector

(random-stochastic-vector size)

Returns a randomly generated stochastic vector of the given size.

row-stochastic-map?

(row-stochastic-map? m & {:keys [decimal], :or {decimal 10}})

Returns true if the map is row stochastic to the given precision.

stochastic-map?

(stochastic-map? m & {:keys [decimal], :or {decimal 10}})

Returns true if the map is stochastic to the given precision.

uniform-row-stochastic-map

(uniform-row-stochastic-map row-keys col-keys)

Returns a nested hash-map representing a row-stochastic matrix. The outer key corresponds to a row, and the nested key corresponds to a column.

For example, take the matrix X given by:

    0 1 2
  +-------+
0 | a b c |
1 | d e f |
2 | g h i |
  +-------+

To obtain the element d, one could use (get-in X [1 0]), or to obtain the element h, one could use (get-in X [2 1]).

uniform-stochastic-map

(uniform-stochastic-map keys)

Returns a hash-map representing a uniformly distributed stochastic vector.

uniform-stochastic-vector

(uniform-stochastic-vector size)

Returns a uniformly distributed stochastic vector of the given size.