M3 method with SAEM

Hello,

I am wondering if we can use M3 method with SAEM?
I don’t see such option in the error model for EM models here, not sure if there are any examples of manually calculating likelihood

Hi, yes M3 in Censored().

Here’s an example that you can run in Pumas:

using Pumas
using PharmaDatasets

mdl_censored_em = @emmodel begin
    @param begin
        Kraw ~ 1 | LogitNormal
    end
    @random begin
        Ka ~ 1 + SEX | LogNormal
        CLf ~ 1 | LogNormal
    end
    @covariates WT
    @covariance 1 1
    @pre begin
        CL = CLf * WT
        K = Kraw * (0.5 - 0.008) + 0.008
        Vc = CL / K
    end
    @dynamics Depots1Central1
    @post begin
        SC = Vc / WT
        conc = Central / SC
    end
    @error begin
        dv ~ Censored(Normal(conc), 1.0, Inf)
    end
end

df = dataset("pumas/event_data/THEOPP")
df.dv = max.(1.0, df.dv)

param = (
    #Ka MEAN ABSORPTION RATE CONSTANT for SEX = 0(1/HR), and diff for 0
    Ka=(2.77, log(1.5) - log(2.77)),
    Kraw=(0.0781 - 0.008) / (0.5 - 0.008), #K MEAN ELIMINATION RATE CONSTANT (1/HR)
    CLf=0.0363, #SLP  SLOPE OF CLEARANCE VS WEIGHT RELATIONSHIP (LITERS/HR/KG)
)

theopp_censored = read_pumas(df, covariates=[:WT, :SEX])

ft_censored_saem = @time fit(
    mdl_censored_em,
    theopp_censored,
    param,
    SAEM(),
)
2 Likes

just run the loglikelihood function, but with LaplaceI instead of SAEM:

loglikelihood(
    mdl_censored_em,
    theopp_censored,
    param,
    LaplaceI(),
)
1 Like