-
Notifications
You must be signed in to change notification settings - Fork 12
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
No Noise #555
Comments
Hi, could you please define the objective function that you'd like to use? If least squares is fine, you can simply set the following for all observables: |
Hi again, thanks for your quick response! We're using pyPESTO (& amici) to estimate some parameters of our model that we imported as a petab problem. As objective function we are simply using the pyPESTO create_objective() function which creates an amici objective. We are not entirely sure what exact objective function this will yield (we were a bit confused about the pyPESTO / amici documentations since we are new to optimization). |
There's documentation on the objective function in the PEtab [1] and AMICI [2] docs. As for why the parameters are estimated to be at the lower bound, there could be many reasons, so maybe the best thing to do is have a positive control, i.e. setup a PEtab problem where you know what the parameters should be. pyPESTO has a guide on how to do this [3]. If optimization of the synthetic problem also fails, maybe your scripts have some bug. If the synthetic problem works, maybe your PEtab problem has some issue. [1] https://petab.readthedocs.io/en/stable/documentation_data_format.html#noise-distributions |
Hi, the positive control worked to some extent. Building the amici-model where (only) the 4 varied parameters are being estimated works perfectly (all 4 parameter values are recovered succesfully). However, if we want to estimate more than those 4 parameters, the problem occurs again (all estimated parameters are estimated to their lower bound). Increasing the maxSteps helps in some cases, in others not. Setting 'model.requireSensitivitiesForAllParameters()' also helps sometimes. We use 100 starts for the optimization and tried various parameter combinations and settings. The error message reads: "AMICI forward simulation failed at t = 0: AMICI failed to integrate the forward problem" which seems to be the problem. |
Presumably,
If you are seeing this often, you could try relaxing simulation tolerances. For example, with pyPESTO's AMICI objective pypesto_problem.objective.amici_solver.setAbsoluteTolerance(1e-10)
pypesto_problem.objective.amici_solver.setRelativeTolerance(1e-8)
This might indicate that one sensitivity method is better for you than another. e.g., if you are using the forward method, switch to the adjoint method. e.g.: pypesto_problem.objective.amici_solver.setSensitivityMethod(amici.SensitivityMethod.adjoint)
There could be many causes of this, could you provide the full log? |
Thanks a lot! We'll try what you've described. |
Some of these errors shouldn't be ignored, e.g.
e.g.
says that somehow you supplied a One way to debug this is to get a parameter vector that causes this issue, then see where the start_x0_list = [start.x0 for start in pypesto_result.optimize_result.list] and here's how to simulate one x = start_x0_list[13]
result = pypesto_problem.objective(x[pypesto_problem.x_free_indices], sensi_orders=(0,1), return_dict=True) |
Hello again! When simulating x0 and x(=lowerBound estimation), both return fval=inf and a NaN gradient array: |
Thanks, are you able to share the scripts for optimization and then simulation? Since optimization for one start
by simulating immediately after optimization completes, in the same script. If that doesn't work, we could have a short Zoom call sometime next week, if that suits you, since then it would be easier for me to help debug. |
Hi, we tried simulating directly after optimization but got the same result. Strangely enough, if we simulate directly after optimizing in the working case, the simulation also results in fval=inf (however, if we do load the results from a file this error doesn't appear in the working cases). I'll append our whole model setup for you with the synthetic dataset. (model.tar.gz) |
Could you try optimizing the parameters on |
That seems to resolve the lowerBound error, thanks! The estimation is now able to recover some but not all the true parameter values and the NaN-value error messages still appear in the output. Maybe our parameter space is just too big or we need a lot more starts. |
Nice! Yes, may just be an issue of nonidentifiability due to the data, i.e. if you were to do practical identifiability analysis (e.g. naively with profile likelihoods or MCMC sampling in pyPESTO), you might see that the missing true parameters are covered by the intervals, in which case more starts won't help. |
Hi, we would like to perform parameter estimation for an ODE-model without considering any stochastic effects.
Is it possible to define a PETAB problem without a noise parameter/set the noise to zero in any way?
The text was updated successfully, but these errors were encountered: