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

pypesto.profile.profile_next_guess.get_reg_polynomial correct? #1224

Closed
dweindl opened this issue Nov 29, 2023 · 1 comment · Fixed by #1226
Closed

pypesto.profile.profile_next_guess.get_reg_polynomial correct? #1224

dweindl opened this issue Nov 29, 2023 · 1 comment · Fixed by #1226
Labels
fixed but not released profiling Related to profiling question Further information is requested

Comments

@dweindl
Copy link
Member

dweindl commented Nov 29, 2023

Hi, can somebody comment on whether the following code makes sense?

This is polynomial regression to extrapolate parameter values for parameter profiles in the adaptive stepsize case.

# Do polynomial interpolation of profile path
# Determine rank of polynomial interpolation
regression_tmp = np.polyfit(
current_profile.x_path[par_index, -1:-reg_points:-1],
current_profile.x_path[i_par, -1:-reg_points:-1],
reg_order,
full=True,
)
# Decrease rank if interpolation problem is ill-conditioned
if regression_tmp[2] < reg_order:
reg_order = regression_tmp[2]
regression_tmp = np.polyfit(
current_profile.x_path[par_index, -reg_points:-1],
current_profile.x_path[i_par, -reg_points:-1],
int(reg_order),
full=True,
)

In the ill-conditioned case, different parameter vectors are used than in the initial attempt. They don't include the most recent parameters. This seems wrong to me, but maybe somebody knows better.

EDIT: Well, actually both cases seem to be wrong. Both use only reg_points - 1 points instead of the presumably intended reg_points. In the first case, the oldest one is omitted, in the second case the most recent one is omitted.

What I think it should look like: #1226

@dweindl dweindl added question Further information is requested profiling Related to profiling labels Nov 29, 2023
dweindl added a commit to dweindl/pyPESTO that referenced this issue Nov 30, 2023
…_polynomial`

There seems to be an indexing error in `pypesto.profile.profile_next_guess.get_reg_polynomial`, resulting in too few points being used for extrapolating parameter trajectories.
In the second case, not only too few, but also not the most recent parameter values are used.

Closes ICB-DCM#1224
@PaulJonasJost
Copy link
Collaborator

agreed, this should be changed 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed but not released profiling Related to profiling question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants