Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FYI: ED Laplace doesn't work in current version of PopED #74

Open
mattfidler opened this issue Sep 12, 2024 · 5 comments
Open

FYI: ED Laplace doesn't work in current version of PopED #74

mattfidler opened this issue Sep 12, 2024 · 5 comments
Assignees

Comments

@mattfidler
Copy link
Contributor

See lines:

## ED: E(det(FIM)) using Laplace approximation
## deterministic calculation, relatively fast
## can be more stable for optimization
tic(); evaluate_design(poped.db,d_switch=FALSE,use_laplace=TRUE); toc()
## optimization with Laplace
output_ls <- poped_optim(poped.db, opt_xt=T, parallel=T, method = "LS", d_switch=F, use_laplace=T)

This doesn't work.

I was thinking it was my implementation but it doesn't work in the examples either.

@mattfidler
Copy link
Contributor Author

mattfidler commented Sep 12, 2024

Also an imported nonmem or monolix model has the prior covariance matrix which could be used for this procedure. With that in mind this could be populated by matching rules, but I need to understand the flags:

  • The flags are 1 for normal
  • 4 for lognormal
  • What are 2-3?

And understand differences in parameterization.

Currently lognormal is:

par <- tPar*exp(eta.par)

But this is also lognormal:

par <- exp(tpar + eta.par)

Though nlmixr2 defines these differently; for:

  • par <- tpar*exp(eta.par), tpar is untransformed and eta.par as transformed with exp
  • par <- exp(tpar+eta.par), tpar is and eta.par are transformed with exp and are mu-referenced.
par <- tpar + eta.par

This is identified as mu-referenced and untransformed. We also identify expit() and probitInv() for these parameters.

Also it seems that you are not using the standard deviation for specifying variability (it is CV%?, or is it something else? does it change based on transformation?)

Just wondering here. Perhaps I missed it in the documentation.

@andrewhooker andrewhooker self-assigned this Sep 13, 2024
@andrewhooker
Copy link
Owner

andrewhooker commented Oct 4, 2024

Hi Matt,

In the latest development version, this example is working. See https://andrewhooker.github.io/PopED/articles/examples.html#design-evaluation-including-uncertainty-in-the-model-parameters-robust-design

The flags are (as defined in the same example in the link above, also defined in https://andrewhooker.github.io/PopED/reference/create.poped.database.html#arg-bpop):

  • column 1 the type of the distribution for E-family designs (0 = Fixed, 1 = Normal, 2 = Uniform, 3 = User Defined Distribution, 4 = lognormal and 5 = truncated normal)
  • column 2 defines the mean.
  • column 3 defines the variance of the distribution (or length of uniform distribution).

These are the distributions of the uncertainties of the fixed effects. Not the distributions of the between subject variability ... So you need to make an assumption about the structure of the uncertainties. This is certainly related to how you have the fixed effects parameterized in your model, but not a direct correlation.

It would be great if you can get something working automatically on imported NONMEM or Monolix models!

@mattfidler
Copy link
Contributor Author

Many models specify fixed effects in different ways;

Would:

Example 1:

p = tp*exp(eta)

and

Example 2:

p = exp(tp+eta)

Clarifying question:

In example 1 the parameter tp is lognormal and in example 2 tp is normal (or log-normal).

@mattfidler
Copy link
Contributor Author

Much of babelmixr2 will allow the import of models from NONMEM and Monolix to rxode2 and the allow optimal design with PopED.

If you have time, we could chat a bit about this ACoP. Theo is working on some examples with this as well.

@mattfidler
Copy link
Contributor Author

With 5, can you specify the boundaries of the truncate normal parameter per parameter or is it simply assumed (0, Inf)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants