Expecting time to be greater than 0

There seem to be two separate issues: that there are repeated values in the array of time points and that t0 is the same as that of the first observation – if the second doesn’t raise an error I suspect it will once the first is fixed.

If I understand correctly you have repeated times in your array of times because there are multiple observations at the same time (for instance for different individuals assumed to produce observations under the same model). Still, the ODE solution appears to require a range of unique, increasing time points; instead, what you can do is to compute this solution once for a range containing all time points for which you have observations, and afterwards just pick out the solution values at the time you need and compute the likelihood.

As for the choice of t0, it doesn’t seem to be causing this issue, but you should simply choose a value smaller than your first observation. If you are estimating the initial conditions this will affect the actual values you obtain, but is not supposed affect the other parameters in any meaningful way. If instead you are using fixed initial conditions, you should use values that match your choice of initial time (see this thread for some discussion on that).

1 Like