Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a major bug in the stepwise logic.
Consider the model space table
Let the current model in a backward search be in
M1
, withk1=1, k2=estimate
.Valid backward moves are
k1=1 and k2=1
inM2
, andk1=1 and k2=1
inM2
.M2
will never returnk1=1 and k2=1
. The current logic first checks the largest possible model in the space, then all combinations involving at least one "optionally fixed" parameter.k1
is not "optionally fixed" -- it must be fixed based on the current model. Hence, no model is returned fromM2
.This PR changes the logic so that the first check is now "largest possible model in the space, but fix the parameters that were fixed in the other model subspace", and the corresponding fix for the forward moves.
An alternative fix would be to remove these lines from the backward method:
petab_select/petab_select/model_subspace.py
Lines 435 to 439 in 316b437