tracts.demography.parameter.DependentParameter#

class DependentParameter(name, expression, param_type, bounds, index=None)#

Bases: Parameter, Callable

A class representing a parameter in a demographic model that is dependent on other parameters.

name#

The name of the parameter.

Type:

str

type#

The type of the parameter, which determines its bounds.

Type:

ParamType

bounds#

The lower and upper bounds of the parameter, determined by its type.

Type:

tuple[float, float]

expression#

A function that computes the value of the parameter given a demography and a list of its dependent parameter values.

Type:

Callable[[BaseParametrizedDemography, list[float]], float]

index#

The index of the parameter in the list of parameters to optimize, or None if the parameter is fixed by value or ancestry proportion.

Type:

int | None

__init__(name, expression, param_type, bounds, index=None)#

Initializes a DependentParameter object.

Parameters:
  • name (str) – The name of the parameter.

  • expression (Callable) – A function that computes the value of the parameter given a demography and a list of its dependent parameter values.

  • param_type (ParamType) – The type of the parameter, which determines its bounds.

  • bounds (tuple[float, float]) – The lower and upper bounds of the parameter, determined by its type.

  • index (int | None) – The index of the parameter in the list of parameters to optimize, or None if the parameter is fixed by value or ancestry proportion. Default is None.