# View Source Descisionex.PaymentMatrix(Descisionex v0.1.8)

https://en.wikipedia.org/wiki/Decision-matrix_method

# Link to this section Summary

## Functions

Calculates all criteria for payment matrix.

Calculates generalized criterion for payment matrix.

Calculates Hurwitz criterion for payment matrix.

Calculates Laplace criterion for payment matrix (variants must be set).

Calculates Savage criterion for payment matrix.

Calculates Wald criterion for payment matrix.

Set Generalized additional value for payment matrix (range from 0.1 to 0.9), defaults to 0.5.

Set Hurwitz additional value for payment matrix (range from 0.1 to 0.9), defaults to 0.5.

Set steps for payment matrix.

Set variants for payment matrix.

# calculate_criteria(data)

View Source

Calculates all criteria for payment matrix.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{matrix: [[1, 2], [3,4]]} |> Descisionex.PaymentMatrix.set_variants(["some", "variants"]) |> Descisionex.PaymentMatrix.calculate_criteria()
%Descisionex.PaymentMatrix{
generalized_criterion: %{criterion: 1.5, strategy_index: 0},
hurwitz_criterion: %{criterion: 3.5, strategy_index: 1},
laplace_criterion: %{criterion: 3.5, strategy_index: 1},
matrix: [[1, 2], [3, 4]],
possible_steps: [],
possible_steps_num: 0,
savage_criterion: %{criterion: 0, strategy_index: 1},
variants: ["some", "variants"],
variants_num: 2,
wald_criterion: %{criterion: 4, strategy_index: 1}
}``````

# calculate_generalized_criterion(data)

View Source

Calculates generalized criterion for payment matrix.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{matrix: [[1, 2], [3,4]]} |> Descisionex.PaymentMatrix.calculate_generalized_criterion()
%Descisionex.PaymentMatrix{
generalized_criterion: %{criterion: 1.5, strategy_index: 0},
hurwitz_criterion: %{},
laplace_criterion: %{},
matrix: [[1, 2], [3, 4]],
possible_steps: [],
possible_steps_num: 0,
savage_criterion: %{},
variants: [],
variants_num: 0,
wald_criterion: %{}
}``````

# calculate_hurwitz_criterion(data)

View Source

Calculates Hurwitz criterion for payment matrix.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{matrix: [[1, 2], [3, 4]]} |> Descisionex.PaymentMatrix.calculate_hurwitz_criterion()
%Descisionex.PaymentMatrix{
generalized_criterion: %{},
hurwitz_criterion: %{criterion: 3.5, strategy_index: 1},
laplace_criterion: %{},
matrix: [[1, 2], [3, 4]],
possible_steps: [],
possible_steps_num: 0,
savage_criterion: %{},
variants: [],
variants_num: 0,
wald_criterion: %{}
}``````

# calculate_laplace_criterion(data)

View Source

Calculates Laplace criterion for payment matrix (variants must be set).

## examples Examples

``````iex> %Descisionex.PaymentMatrix{matrix: [[1, 2], [3, 4]]} |> Descisionex.PaymentMatrix.calculate_laplace_criterion()
** (ArgumentError) For Laplace criterion variants must be set!
iex> %Descisionex.PaymentMatrix{matrix: [[1, 2], [3, 4]]} |> Descisionex.PaymentMatrix.set_variants(["some", "variants"]) |> Descisionex.PaymentMatrix.calculate_laplace_criterion()
%Descisionex.PaymentMatrix{
generalized_criterion: %{},
hurwitz_criterion: %{},
laplace_criterion: %{criterion: 3.5, strategy_index: 1},
matrix: [[1, 2], [3, 4]],
possible_steps: [],
possible_steps_num: 0,
savage_criterion: %{},
variants: ["some", "variants"],
variants_num: 2,
wald_criterion: %{}
}``````

# calculate_savage_criterion(data)

View Source

Calculates Savage criterion for payment matrix.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{matrix: [[1, 2], [3, 4]]} |> Descisionex.PaymentMatrix.calculate_savage_criterion()
%Descisionex.PaymentMatrix{
generalized_criterion: %{},
hurwitz_criterion: %{},
laplace_criterion: %{},
matrix: [[1, 2], [3, 4]],
possible_steps: [],
possible_steps_num: 0,
savage_criterion: %{criterion: 0, strategy_index: 1},
variants: [],
variants_num: 0,
wald_criterion: %{}
}``````

# calculate_wald_criterion(data)

View Source

Calculates Wald criterion for payment matrix.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{matrix: [[1, 2], [3, 4]]} |> Descisionex.PaymentMatrix.calculate_wald_criterion()
%Descisionex.PaymentMatrix{
generalized_criterion: %{},
hurwitz_criterion: %{},
laplace_criterion: %{},
matrix: [[1, 2], [3, 4]],
possible_steps: [],
possible_steps_num: 0,
savage_criterion: %{},
variants: [],
variants_num: 0,
wald_criterion: %{criterion: 4, strategy_index: 1}
}``````

View Source

Set Generalized additional value for payment matrix (range from 0.1 to 0.9), defaults to 0.5.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{} |> Descisionex.PaymentMatrix.set_generalized_additional_value(0.3)
%Descisionex.PaymentMatrix{
generalized_criterion: %{},
hurwitz_criterion: %{},
laplace_criterion: %{},
matrix: [],
possible_steps: [],
possible_steps_num: 0,
savage_criterion: %{},
variants: [],
variants_num: 0,
wald_criterion: %{}
}

** (ArgumentError) Generalized additional value incorrect (number range must be from 0.1 to 0.9)``````

View Source

Set Hurwitz additional value for payment matrix (range from 0.1 to 0.9), defaults to 0.5.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{} |> Descisionex.PaymentMatrix.set_hurwitz_additional_value(0.3)
%Descisionex.PaymentMatrix{
generalized_criterion: %{},
hurwitz_criterion: %{},
laplace_criterion: %{},
matrix: [],
possible_steps: [],
possible_steps_num: 0,
savage_criterion: %{},
variants: [],
variants_num: 0,
wald_criterion: %{}
}

** (ArgumentError) Hurwitz additional value incorrect (number range must be from 0.1 to 0.9)``````

# set_steps(data, steps)

View Source

Set steps for payment matrix.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{} |> Descisionex.PaymentMatrix.set_steps(["some", "steps"])
%Descisionex.PaymentMatrix{
generalized_criterion: %{},
hurwitz_criterion: %{},
laplace_criterion: %{},
matrix: [],
possible_steps: ["some", "steps"],
possible_steps_num: 2,
savage_criterion: %{},
variants: [],
variants_num: 0,
wald_criterion: %{}
}``````

# set_variants(data, variants)

View Source

Set variants for payment matrix.

## examples Examples

``````iex> %Descisionex.PaymentMatrix{} |> Descisionex.PaymentMatrix.set_variants(["some", "variants"])
%Descisionex.PaymentMatrix{