Model Class

The Model holds all of the SmoothGrids that define priors on rates, random effects, and covariates. It also has a few other properties necessary to define a complete model.

  • Which of the rates are nonzero. This is a list of, for instance, [“iota”, “omega”, “chi”].

  • The parent location as an integer ID. These correspond to the IDs supplied to the Dismod-AT session.

  • A list of child locations. Not children and grandchildren, but the direct child locations as integer IDs.

  • A list of covariates, supplied as Covariate objects.

  • Weight functions, that are used to compute integrands. Each weight function is a Var.

  • A scaling function, which sets the scale for every model variable. If this isn’t set, it will be calculated by Dismod-AT from the mean of value priors. It is used to ensure different terms in the likelihood have similar importance.

class cascade_at.model.model.Model(nonzero_rates, parent_location, child_location=None, covariates=None, weights=None)[source]
>>> from cascade_at.inputs.locations import LocationDAG
>>> locations = LocationDAG(location_set_version_id=429)
>>> m = Model(["chi", "omega", "iota"], 6, locations.dag.successors(6))
Parameters
  • nonzero_rates (List[str]) – A list of rates, using the Dismod-AT terms for the rates, so they are “iota”, “chi”, “omega”, “rho”, and “pini”.

  • parent_location (int) – The location ID for the parent.

  • child_location (Optional[List[int]]) – List of the children.

  • A list of covariate objects. This supplies the reference values and max differences, (covariates) – used to exclude data by covariate value.

  • weights (Optional[Dict[str, Var]]) – There are four kinds of weights: “constant”, “susceptible”, “with_condition”, and “total”. No other weights are used.