Closed karthikl6 closed 5 years ago
Hi @karthikl6,
SAEM does not calculate the objective function during optimization. At the last release we were working with SAEM logLik based on adaptive Gaussian quadrature, so the idea was you could choose what method you wanted when calculating likelihood.
The github version is more explicit about this and accepts things like AIC(fit)
and calculates the likelihood as needed. However, you can still get the FOCEi objective function.
In this case no options are added, and the objective function calculation is calculated on demand.
fit <- nlmixr(one.compartment.saem,theo_sd,"saem",control=saemControl(print=500));
This is simply by adding the table options:
fit <- nlmixr(one.compartment.saem,theo_sd,"saem",control=saemControl(print=500),
table=tableControl(cwres=TRUE));
Also note you can add npde
residuals by this option too.
In this case, you have a fit without an objective function, but want to add the FOCEi objective function to it; It can be added with the addCwres()
function
fit <- nlmixr(one.compartment.saem,theo_sd,"saem",control=saemControl(print=500));
fit <- addCwres(fit) # Add CWRES & FOCEi objective function
Note you can also add npdes to a fit with addNpde(fit)
Hi @mattfidler ,
Thank you very much for the detailed explanation. This helps a lot.
I have another question: Is there a way that we can do change point models like using MTIME in NONMEM?
There is a new (undocumented) feature that allows change-point models but it is only available on the github release. But I haven't tested it in a model yet. The MTIME
is not the same as what NONMEM had either;
The syntax for mtime can be found here:
https://github.com/nlmixrdevelopment/RxODE/blob/master/tests/testthat/test-mtime.R
This is also different than how NONMEM handles mtimes.
Hi @mattfidler ,
Great!! I will give it a try. Thank you very much!!
Great; Let me know if it works for you.
Hi @mattfidler ,
Another quick question: Can we use an explicit equation (Eg: Eff = baseline - slope*Cp) for PD modeling without ODE? I want to do only PD modeling
You can
Hi,
When I run the example from here, the output of fit does not show any OBJF using SAEM estimation method. But says OBJF not calculated. In the example, it shows OBJF calculated from FOCEi approximation.
Am I missing anything?
Thanks