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

Feature consideration: Autodetect model transformations to set typical values? #8

Open
billdenney opened this issue Sep 16, 2022 · 7 comments

Comments

@billdenney
Copy link
Contributor

This is a longer-term request. It does not need to happen before the PKNCA connection is made.

Something that would help the PKNCA connection would be the ability to automatically detect typical value translations and parameter names. This also seems like it could be useful for users to get the automatic back-translation. As an example, it would be useful to do something like the following:

  • Make a model with absorption rate on the log scale so that the parameter name is lka and the parameter within the model is defined as ka <- exp(lka) (eta and additional covariates may be added, too).
  • When updating model parts make it auto-detect the typical value parameter and translation for updates so that ini(model, ka=2) gets automatically translated to ini(model, lka=log(2)).

The code for this could be pretty similar to what is already in addEta().

My first thought for implementation is that it would be best/easiest within the ini() function itself, but if the mu-referencing is only known to nlmixr2est and not known to rxode2, that makes it a bit more complicated. If implemented in rxode2, then I think that the mu-referencing code would need to move from nlmixr2est to rxode2 (but I don't really know).

My second thought is to put it here and give it a unique name like updateIni(). That is cleaner in that translation of parameter names would never happen without it being intentional. (In other words, translation from ka to lka would not happen within ini().) But, it makes the user need to know another function for a similar purpose.

My third thought is: Don't make this too complicated, Bill.

Thoughts?

@billdenney
Copy link
Contributor Author

I implemented this in nlmixr2/babelmixr2#48

Perhaps we should consider it it should move upstream to rxode2?

@mattfidler
Copy link
Member

Isn't this in the get split mu ref module? And if it uses the same code, it can only be promoted to nlmixr2est

@mattfidler
Copy link
Member

My first thought for implementation is that it would be best/easiest within the ini() function itself, but if the mu-referencing is only known to nlmixr2est and not known to rxode2, that makes it a bit more complicated. If implemented in rxode2, then I think that the mu-referencing code would need to move from nlmixr2est to rxode2 (but I don't really know).

mu referencing is calculated in rxode2. The model removing mu referencing and calculating pure mu referencing is in nlmixr2est

@billdenney
Copy link
Contributor Author

I'm not sure if we're talking about the same thing. What I'm talking about is something that I wrote for the PKNCA link:

https://github.com/nlmixr2/babelmixr2/blob/1914b39d24cfd9d7b05c394f117daf4c1f5a1099/R/pknca.R#L174-L215

What it does it it allows a model with lvc as the parameter and vc as the part used in the model to do something like:

mod %>%
  ini_transform(vc=2)

And it will look at the transformation table and the mu reference table to see that what the user meant was:

mod %>%
  ini(lvc = log(2))

Is that what you've already done? (If so please let me know how to do it, and I will drop the part I added to the PKNCA link.)

@mattfidler
Copy link
Member

No it isn't the same thing that we are talking about. However, since it uses getSplitMuModel it cannot be promoted to rxode2 because it uses some of the same functions needed by saem.

@mattfidler
Copy link
Member

Let me think about this a bit. If we don't promote to rxode2, people will want it there (as evidenced by the excitement of model piping in rxode2 models.

@mattfidler
Copy link
Member

Well, it uses the saem piece to figure out the pure mu-referenced models, so I am guessing that we can simply ask for them to load nlmixr2extra to get this, I guess.

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

No branches or pull requests

2 participants