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

Add changes to initial conditions to draw functions #95

Merged
merged 9 commits into from
Sep 18, 2024

Conversation

twallema
Copy link
Owner

  • I have checked to ensure there aren't other open Pull Requests for the same update/change
  • I have updated the documentation accordingly.

Describe your fixes/additions/changes

Previously draw_functions could only be used to update model parameters between consecutive runs, they always needed to have parameters as the first argument,

def draw_function(parameters):
    parameters['gamma'] = np.random.uniform(low=0, high=5)
    return parameters

I've extended draw_functions to be able to alter the initial condition between consecutive runs,

def draw_function(parameters, initial_states):
    parameters['gamma'] = np.random.uniform(low=0, high=5)
    initial_states['S'] = np.zeros([5, 11])
    return parameters, initial_states

You must now always provide parameters and initial_states to the draw function as mandatory arguments. For initial states, the size of the states is checked.

The goal of this change is to build towards the ability to optimisedraw_function_kwargs using pySODMs optimization module. This could be interesting to calibrate the initial condition of epidemic models.

@twallema twallema merged commit 8c3b36d into master Sep 18, 2024
2 checks passed
@twallema twallema deleted the initial-condition-functions branch September 18, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant