How to fix sigma in PumasEMmodel (using SAEM)

Hi!

I am running a full random effect model by pumasEMmodel, and I have to fix the sigma of every covariate to a very small value, in this case, sigma2 and 3, I tried costantcoeff() but it failed: this is the error message:

and this is my code:

  dt;
  id           = :ID,
  time         = :TIME,
  observations = [:DV, :WT, :HT],
  evid         = :EVID,
  amt          = :AMT,
  rate         = :RATE,
  cmt          = :CMT,
  ii           = :II,
  ss           = :SS
)

inti_para = (;
CL=7, Vc=140, mat=2.5, tvd1=0.4, tvWT=92, tvHT=169
)

run4 = @emmodel begin

        @metadata begin
            desc = "saem, 2 cov, correlation"
            timeu = u"hr" # time unit is hour
        end

        @param begin
            tvd1 ~ 1 | LogitNormal          
        end

        @random begin
            CL ~ 1 | LogNormal
            Vc ~ 1 | LogNormal
            mat ~ 1 | LogNormal
            tvWT ~ 1 | LogNormal
            tvHT ~ 1 | LogNormal
        end

        @covariance 5

        @pre begin
            d1 = mat * (1 - tvd1)
            Ka = 1 / (mat - d1)
        end

        @dosecontrol begin
            duration = (; Depot = mat * (1 - tvd1))
        end

        @dynamics Depots1Central1

        @post begin
            cp = @. 1_000 * Central / Vc
            F = @. log(cp + 0.00001)
        end

        @error begin
            DV ~ Normal(F)
            WT ~ Normal(tvWT)
            HT ~ Normal(tvHT)
        end
    end

model4 = fit(run4, population, inti_para, Pumas.SAEM(), constantcoef=(σ = (0.1, 0.000000001,0.00000001)))```

is that because it is impossible to fix parameters in @emmodel?

Thanks in advance!

That is correct. Currently, fixing paramaters in an @emmodel is done by rewriting the model but that is not possible in this case. One possible workaround here that you could try is to set the initial values to σ = (0.1, 1e-12, 1e-12). I’d be interested in hearing what happens with the small values. If they stay small or not. If this doesn’t work then, for the time being, there would be no other option that using @model and something like FOCE for implementing FREM.

Thank you!
It works, the sigma values of WT and HT are around 3e-10, but the sigma of DV(sigma1=2.65) is much larger than previous value(0.12), and the Log-likelihood value is -Inf, does that indicate the run is failed?

Also, compared with NONMEM output, the variance and covariance values are far from the correct ones.

I then tried σ = (0.1, 1e-6, 1e-6), it still can’t get right variance, covariance and Log-likelihood

$OMEGA  BLOCK(5)
 0.204491  ; 1. IIV on CL
 0.116871 0.206603  ; 2. IIV on V
 -0.00851338 0.00860313 0.0380475  ; 3. IIV on MAT
 1.46562 2.38964 0.622568 350.672  ;     BSV_WT
 0.618614 0.405985 -0.0366506 82.236 111.206  ;     BSV_HT

Is this a simulated data set? What is the data generating process?

Yes, it was generated using conditional distribution modelling, if you are interested in it, you can found it in the supplementary material of this paper:

Full random effects models (FREM): A practical usage guide

https://ascpt.onlinelibrary.wiley.com/doi/full/10.1002/psp4.13190

I can see your model is named run4. Are you using Runs/dataset3.csv? Also, which version of Pumas are you using for testing?

Yes, I am using dataset3.csv ( study7), and pumas 2.5.1.
Since SAEM doesn’t work well I am now turning into FOCEI.

I am able to mostly reproduce your findings although I have to exclude two subjects. One because it has two observations at the same time point (which Pumas doesn’t allow) and one where there is a steady state dose at the same time as a normal dose (which we also don’t allow).

Since SAEM doesn’t provide the log-likelihood directly, we compute the the log-likelihood in the result table based on the (first order) Laplace approximation. I’m not completely sure why it gives Inf yet, though.

One thing I’d like to ask you is if it is intended that you use LogNormal for the covariates? As I read run6.mod from the supplemental material then I would have expected Normal.

Sorry, LogNormal for the covariates was a careless mistake