Skip to content

[FEAT]: Stratification could apply to observables too #447

@liunelson

Description

@liunelson

I find myself using observables quite heavily to implement non-ODE parts of a model.

For example, I start with a base model with some state variables and parameters. I also have the parameter PPI (unused in any rate law but necessary part of the model) and the observable ASI = 1 - PPI / 100.

I stratified it as such:

model_country = stratify(
    template_model = model,
    key = 'country',
    strata = ['US', 'CD', 'CN', 'NO', 'AU'],
    structure = [],
    directed = False,
    cartesian_control = False,
    params_to_stratify = ['DeltaS', 'PP', 'SP', 'g'], # all parameters used in the rate laws
    concepts_to_stratify = ['GDP', 'R', 'OS', 'S'], # all state variables
    param_renaming_uses_strata_names = True
)

As of now, I cannot go straight to this model.json (representing the supply chain of cobalt) where I have the parameters and observables of the form:

PPI_c # stratified unused-in-rate-laws-but-used-in-observable parameters

ASI_c = 1 - PPI_c / 100 # stratified observable

(c = AU, CD, CN, NO, US).

What do you think of having either a observables_to_stratify key? I may be abusing the term "stratification" by applying its logic to things unrelated to the transitions and rate laws!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions