Skip to content

Constraint differences from the base class #89

@willGraham01

Description

@willGraham01

Constraints differ from CausalEstimands because they will also come with an associated tolerance, as well as "data value".

Their general structure can be thought of as:

$$ \mathrm{norm}\left( g(\theta) - g_{data} \right) - \epsilon \leq 0. $$

  • $g(\theta)$ is the quantity as estimated from the model, which is a function provided by the user.
  • $g_{data}$ will be the data provided by the user. This may change between runs using the same model structure.
  • Constraints are all scalar valued, so even though $g$ and $g_{data}$ are vectors, $\mathrm{norm}(\cdot)$ is needed to take a suitable norm.
  • $\epsilon$ is a tolerance provided by the user. Again, this may change between runs.

As such, Constraints are better defined in stages:

  • The user provides $g(\theta)$ at initialization. This is a hidden attribute and isn't meant to be changed.
  • The user also provides the norm function at initialization. Again, the intention is that this does not change. It should default to the L^2 norm (which is the absolute value in 1D).
  • $g_{data}$ and $\epsilon$ are public attributes that can be changed, but also set at initialization.
  • Constraint.__call__ needs to be overwritten to return the appropriate composition of these attributes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions