error_terms module

class error_terms.EVError(loc: float = 0, scale: float = 1)[source]

Bases: ErrorTerms

This class creates an EV distributed error term. The default is a type 1 gumbel distribution.

Attributes:

  • loc: location of the EV distribution

  • scale: scale of the EV distribution

Methods:

  • update: updates parameters of the distribution

  • draw: draws a value from distribution

draw(n_draws: int = 1) float | array | List[source]

Draws values from the class distirbution

Parameters:

n_draws (-) –

Return type:

Single draw or list of draws

update(loc: float | None = None, scale: float | None = None) None[source]

Updates parameters of the distribution

Parameters:

  • loc: new location of the EV distribution

  • scale: new scale of the EV distribution

class error_terms.ErrorTerms(distribution: List | rv_continuous_frozen | None = None)[source]

Bases: object

This class creates error terms to be used in the utility function

Attributes:

  • distribution: either a valid scipy frozen distribution, or a list of values

  • value: current value of the error terms, which is a draw from distribution

  • dist_type: type of distribution (scipy object, list, or other)

Methods:

  • draw: draws a value from distribution

draw(n_draws: int = 1) float | array | List[source]

Draws values from the class distirbution

Parameters:

n_draws (-) –

Return type:

Single draw or list of draws

class error_terms.GaussianError(mean: float = 0, std: float = 1)[source]

Bases: ErrorTerms

This class creates a normally distributed error term. The default is a standard normal distribution.

Attributes:

  • mean: mean of the normal distribution

  • std: mean of the normal distribution

Methods:

  • update: updates parameters of the distribution

  • draw: draws a value from distribution

draw(n_draws: int = 1) float | array | List[source]

Draws values from the class distirbution

Parameters:

n_draws (-) –

Return type:

Single draw or list of draws

update(mean: float | None = None, std: float | None = None) None[source]

Updates parameters of the distribution

Parameters:

  • mean: new mean of the normal distribution

  • std: new standard deviation of the normal distribution

class error_terms.PseudoRandomError(distribution: List)[source]

Bases: ErrorTerms

This class creates pseudorandom error terms.

Attributes:

  • distribution: list of pseudorandom terms

Methods:

  • update: updates parameters of the distribution

  • draw: draws a value from distribution

draw(index_draw: int = None, n_draws: int = 1) float[source]

Draws values from the class distirbution

Parameters:
  • index_draw (-) –

  • n_draws (-) –

Return type:

Single draw or list of draws

update(distribution: List) None[source]

Updates pseudorandom terms.

Parameters:

  • distribution: new list of pseudorandom terms