LL statement for user-defined log-likelihood models

PML provides an LL statement for user-defined log-likelihood models. It is useful in situations where there is no built-in statement to describe/model the given phenomena. In this sense, it is similar to the -2LL/LIKE option in NONMEM.

    LL(observedVariable, expression
[, type=observedVariableType][, simulate={simulationCode}]
[, actionCode])

This statement specifies there is an observed variable, and when it is observed, its log-likelihood is the given expression. Optional action code is executed before or after the observation. The “type” is used in predictive check to specify the type of the observed variable. The available choices are cont, cat, count, and event. If the “simulate” keyword is present, then during simulation or predictive check, the simulation code can assign a value to the observed variable.

The following is an example illustrating how simulate can work on the LL statement.

   covariate(DOSETOT,cycledays,uni01,timeforhistograms)
deriv(E=Kin*DOSETOT/cycledays-Kout*E)
sequence{E=E0}
real(u, i, prob)
LL(EObs
,-E+EObs*log(E)-lgamm(EObs+1)
, simulate={
u=unif()
prob=0
i=0
prob=prob+exp(-E+i*log(E)-lgamm(i+1))
while(u >= prob){
prob=prob+exp(-E+i*log(E)-lgamm(i+1))
i=i+1
}
EObs=i
}
)

In the example above, EObs is the observed variable and -E+EObs*log(E) -lgamm(EObs+1) is log-likelihood. The optional action follows the simulate keyword. It is separate from the last action code [, action code] (e.g. [,doafter={E=0}]).

For more examples, see “Count statement for Count models”, “Event statement for Time-to-event models”, or “Multi statement for Categorical models”.


Legal Notice | Contact Certara
© Certara USA, Inc. All rights reserved.