# Link to this section Summary

## Functions

A number that gives you an idea of how random an outcome will be based on the `probability_values` of each of the possible outcomes in a situation

A measure of difference between two continuous variables

The probability of event A occurring given that event B has occurred

The ratio of same values between `vector_a` and `vector_b`

# Link to this section Functions

Link to this function entropy(probability_values) View Source

A number that gives you an idea of how random an outcome will be based on the `probability_values` of each of the possible outcomes in a situation.

## Examples

``````iex> Emel.Math.Statistics.entropy([0.5, 0.5])
1.0

iex> Emel.Math.Statistics.entropy([0.999, 0.001])
0.011407757737461138

iex> Emel.Math.Statistics.entropy([0.25, 0.25, 0.25, 0.25])
1.0

iex> Emel.Math.Statistics.entropy([0.8, 0.05, 0.05, 0.1])
0.5109640474436812``````
Link to this function mean_absolute_error(predictions, observations) View Source

A measure of difference between two continuous variables.

## Examples

``````iex> Emel.Math.Statistics.mean_absolute_error([0.0, 1.0], [0.0, 1.0])
0.0

iex> Emel.Math.Statistics.mean_absolute_error([5.0, 1.0, 0.0, 0.5], [0.0, 1.0, -3.0, 0.5])
2.0``````
Link to this function posterior_probability(prior_probability_B, prior_probability_A, probability_B_given_A) View Source

The probability of event A occurring given that event B has occurred.

## Examples

``````iex> Emel.Math.Statistics.posterior_probability(0.8, 0.4, 0.5)
0.25

iex> Emel.Math.Statistics.posterior_probability(0.4, 0.5, 0.1)
0.125``````
Link to this function similarity(vector_a, vector_b) View Source

The ratio of same values between `vector_a` and `vector_b`.

## Examples

``````iex> Emel.Math.Statistics.similarity(["a", "b", "b", "a"], ["a", "b", "b", "b"])
0.75

iex> Emel.Math.Statistics.similarity(["d", "b", "d", "a"], ["a", "b", "c", "d"])
0.25``````