Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies of stochastic next functions can only be discrete states #35

Open
timmens opened this issue Sep 29, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@timmens
Copy link
Member

timmens commented Sep 29, 2023

Currently, dependencies of stochastic next functions can only be discrete states. In principle, we want to allow for arbitrary arguments. There are a few things that need to be tackled. The current implementation (create_params.py) does:

dependencies = list(
    inspect.signature(model["functions"][f"next_{var}"]).parameters,
)

_check_variables_are_all_discrete_states(
    variables=dependencies,
    variable_info=variable_info,
    msg_suffix=(
        f"The function next_{var} can only depend on discrete state variables."
    ),
)

What we probably should do:

We don't need the list of arguments here, but the root nodes in a dag that contains the next function and all auxiliary functions the user might have provided. Another workaround would be to build a next function that only depends on states and choices via dags and inspects its signature.

What remains to be done:

Extend the logic to continuous variables.

@timmens timmens added bug Something isn't working enhancement New feature or request labels Sep 29, 2023
@hmgaudecker
Copy link
Member

Extend the logic to continuous variables.

Not sure this is first order. First thing to check would be whether there is anything in the literature doing this.

Another thing might be variables that are choices today, which become states next period (say, employment status). Would that work already?

@timmens timmens removed the bug Something isn't working label Oct 9, 2023
@hmgaudecker
Copy link
Member

Another thing might be variables that are choices today, which become states next period (say, employment status). Would that work already?

Just to have an answer should we come back to it: This does work since #53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants