nlmixr2 / rxode2

rxode2
https://nlmixr2.github.io/rxode2/
GNU General Public License v3.0
24 stars 6 forks source link

`unhandled error message: EE:[lsoda] tout too close to t to start integration` causes integration to zero #667

Open billdenney opened 3 months ago

billdenney commented 3 months ago

When running a model with the following code:

d_sim <- nlmixr(object = model, data = my_data, est = "rxSolve")

I get this error:

unhandled error message: EE:[lsoda] tout too close to t to start integration
 @(lsoda.c:647

In the simulation, I then get one ID with a mix of NA and 0 values for the concentration, and all subsequent IDs have all zero concentrations.

I can't share the data/model. And, I'm trying to find the specific ID that is causing the issue (it seems to vary when I run the model with different sets of individuals). What can I do to help track this down and resolve the integration issues?

mattfidler commented 3 months ago

To fix this probably you would need to figure out:

This added complexity is needed because this is run in parallel and printing is not thread safe (especially to R). Otherwise you are likely to get gabage output.

Needless to say, it is not a trivial task.

At the same time, if this comes from a model you can use vpcSim() instead, which simulates (with replacement) to make sure all IDs do not have simulation issues.

While this does not alleviate the concern there are places that are difficult to solve that are not included in the simulation, it is a pragmatic way to overcome such issues.

mattfidler commented 3 months ago

Another option is to adapt what is in vpcSim() to a generalized ignore statement in rxode2 simulations.

billdenney commented 3 months ago

My current state is that I ran the simulation once per ID, and I have 3 IDs that have the issue repeatably. An important detail is that the model object I'm simulating from is an nlmixr2est fit (and not a function). I don't yet see the difference between these individuals and others. They aren't outliers in terms of between-subject variability. The data are setup identically between the individuals for the simulation.

mattfidler commented 3 months ago

The only thing I can suggest is the vpcSim() given it seems that you have tight timelines. Otherwise, I don't know.