Error fitting a lags absorption model

Hello,
I am trying to fit a lag absorption model, but I encountered an error. Since I have successfully implemented lag absorption in the past, I revisited a previous lag model that had run successfully and found that the same error occurs. Below is a snapshot of my dose control block and the stack trace of the error.

Could you please look into this or suggest a solution if this issue has been resolved before?
` @dosecontrol begin
lags = (; Oral = tvlag_or * exp(η[6])
end

@dynamics begin
    Oral'           = -Ka_or*Oral
    Central'        =  Ka_or*Oral - (CL/Vc)*Central
end

`

image

Welcome to the community, @shenkoyababajide !

Can you try removing the variability on the lag parameter and run the model. It is well documented that having BSV on lag parameters result in unstable models that provide different results each time.

Thank you @vijay

Yes, I did. I also tried initializing the Oral compartment to zero as well.
Both did not work, and the errors are exactly the same.

Would you be able to share the complete model with us here?

Yes.

pkmodel = @model begin
    @param begin
        tvcl            ∈ RealDomain(; lower = 0)
        tvvc            ∈ RealDomain(; lower = 0)
        tvq1            ∈ RealDomain(; lower = 0)
        tvvp1           ∈ RealDomain(; lower = 0)
        tvka_or         ∈ RealDomain(; lower = 0)
        tvlag_or        ∈ RealDomain(; lower = 0)
        σ²_prop         ∈ RealDomain(; lower = 0)
        σ²_add          ∈ RealDomain(; lower = 0)
        Ω               ∈ PDiagDomain(5)
    end

    @random begin
        η               ~ MvNormal(Ω)
    end

    @pre begin
        CL      = tvcl * exp(η[1])
        Vc      = tvvc * exp(η[2])
        Q1      = tvq1 * exp(η[3])
        Vp1     = tvvp1 * exp(η[4])
        Ka_or   = tvka_or * exp(η[5])
    end

    @dosecontrol begin
        lags        = (; Oral = tvlag_or,)
    end

    @dynamics begin
        Oral'           = -Ka_or*Oral
        Central'        =  Ka_or*Oral - (CL/Vc)*Central - (Q1/Vc)*Central + (Q1/Vp1)*Peripheral1
        Peripheral1'    =                                 (Q1/Vc)*Central - (Q1/Vp1)*Peripheral1
    end

    @derived begin
        cp = @. Central/Vc
        DV_D8THC ~ @. Normal(cp, sqrt((abs(cp)^2 * σ²_prop) + σ²_add))
    end
end

I think I found the issue, or at least what I think may be causing this error.

When I explicitly define the random effects (e.g., ωcl ∈ RealDomain(lower = 0.0001),…) rather than the PDiagDomain(x) set up, the lag absorption model ran fine.

I know I have tried both ways in the past and it worked. Perhaps this is a bug because random effect was not even included on the tvlag, or the new Pumas update does not allow this anymore.