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.

  • loc: location of the EV distribution

  • scale: scale of the EV distribution

  • update: updates parameters of the distribution

  • draw: draws a value from distribution

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

Draws values from the class distirbution

Parameters:

n_draws (-) –

Return type:

Single draw or list of draws

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

Updates parameters of the distribution

  • loc: new location of the EV distribution

  • scale: new scale of the EV distribution

class error_terms.ErrorTerms(distribution: Optional[Union[List, rv_frozen]] = None)[source]

Bases: object

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

  • 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)

  • draw: draws a value from distribution

draw(n_draws: int = 1) Union[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.

  • mean: mean of the normal distribution

  • std: mean of the normal distribution

  • update: updates parameters of the distribution

  • draw: draws a value from distribution

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

Draws values from the class distirbution

Parameters:

n_draws (-) –

Return type:

Single draw or list of draws

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

Updates parameters of the distribution

  • 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.

  • distribution: list of pseudorandom terms

  • update: updates parameters of the distribution

  • draw: draws a value from distribution

draw(index_draw: Optional[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.

  • distribution: new list of pseudorandom terms