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

Descriptive aliases for ETAs #15

Closed
kylebaron opened this issue Mar 13, 2016 · 6 comments
Closed

Descriptive aliases for ETAs #15

kylebaron opened this issue Mar 13, 2016 · 6 comments

Comments

@kylebaron
Copy link
Collaborator

For example:

$OMEGA 
name="PK"
labels=c(CL,VC,KA)
1 2 3

$OMEGA
name="PD"
labels=c(IC50,KIN)
4 5 

$MAIN
double CLi = TVCL*exp(ETA_PK_CL);
double IC50i = TVIC50*exp(ETA_PD_IC50);
@dpastoor
Copy link
Contributor

i'd throw out a minor syntatic proposal of instead of name be like prefix, with a default value of ETA_ such that

$OMEGA 
labels=c(CL,VC,KA)
1 2 3

$MAIN
double CLi = TVCL*exp(ETA_CL);
double IC50i = TVIC50*exp(ETA_IC50);

however could be overridden

$OMEGA 
prefix="ETA_PK"
labels=c(CL,VC,KA)
1 2 3

$MAIN
double CLi = TVCL*exp(ETA_PK_CL);

or completely ignored if someone really wanted

$OMEGA 
prefix=""
labels=c(ECL,EVC,EKA)
1 2 3



$MAIN
double CLi = TVCL*exp(ECL);

@kylebaron
Copy link
Collaborator Author

Nice ... will do it. Thanks!

@kylebaron
Copy link
Collaborator Author

@kylebaron
Copy link
Collaborator Author

This is how it's looking; and passing all the unit tests I already had in place. Trying to see where the other gotchas are going to be here. @vjd

  • Since we took the time to set up labels for each omega element, we can now more-easily "capture" the value
  • It's still okay not to include labels for one of the random effect blocks
  • Included the prefix piece but as @dpastoor noted people are free to omit that and code it directly into the label
  • Error if you do provide labels and the number of unique labels provided doesn't match the number of rows for the matrix
  • Error if one of the labels is the same as a parameter name or a compartment name (that would have resulted in a complaint from the compiler anyway)
  • Same setup for $SIGMA
  • oprefix, olabels, sprefix, slabels are now arguments for $NMXML
  • Probably need an error if someone uses punctuation other than _
$PARAM TVCL = 1, TVVC=30, TVKA=1.1

$CMT GUT CENT

$ADVAN2

$MAIN
pred_CL = TVCL*exp(ECL);
pred_VC = TVVC*exp(EVC);
pred_KA = TVKA*exp(EKA);

$OMEGA
prefix="E", labels = s(CL,VC,KA)
0.1 0.2 0.3

$CAPTURE ECL EKA TVCL pred_CL

Also note that options are evaluated so you could do this (if you wanted):

$OMEGA
labels=paste0("ETA_", s(CL,VC,KA))
1 2 3
$MAIN
pred_CL = TVCL*exp(ETA_CL);
// ....

I don't see it usually working like that, but you could do it.

@vjd
Copy link

vjd commented Mar 18, 2016

This is a helpful suggestion @dpastoor and thanks for implementing this right away @kylebmetrum

Kyle - you presumably take the same concept into $CMT that will allow extraction of the compartment numbers easier when referring _F(n), _ALG(n) etc. I understand that right now we have to make a call to check the compartment number (which is sequential by default), but this can be really useful for systems biology kind of models.

@kylebaron
Copy link
Collaborator Author

I didn't update #13 yet, but here's what I did:

$CMT DEPOT CENT PERIPH

$MAIN

F_DEPOT = 0.5;

D_CENT = 2.3;

ETC .... so you will get alias for F_CMT, D_CMT, R_CMT and ALAG_CMT. I'm pretty sure this will end use of compartment numbers in the specification file.

From the data side, you can do this:

data <- expand.ev(amt=1000, cmt=cmtn(mod,"DEPOT"))

Or (not documented)

mod %>% ev(amt=1000, cmt="DEPOT") %>% mrgsim %>% ...

So if cmt is character in the data set, we look up the compartment number for you and replace with that integer.

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

3 participants