init_theta | R Documentation |
These functions are useful to obtain and modify initial values of $THETA
,
$OMEGA
and $SIGMA
.
init_theta(m, replace, ...)
init_omega(m, replace, ...)
init_sigma(m, replace, ...)
m |
An nm object. |
replace |
Optional |
... |
Additional arguments for mutating initial estimate NONMEM subroutines. See examples. |
It's easiest to learn this function by view examples, the vignette
and the demo setup_nm_demo()
. It is a good idea to view the resulting
data.frame
to see the columns that are able to be manipulated.
If replace
is specified returns an nm object with modified
ctl_contents
field. Otherwise returns a tibble
or list of tibble
s
with initial estimation information.
# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1",
based_on = file.path(exdir, "Models", "ADVAN2.mod"),
data_path = file.path(exdir, "SourceData", "THEOPP.csv"))
m1 <- m1 %>%
fill_input() %>%
init_theta(init = c(-2, 0.5, 1)) %>%
init_sigma(init = c(0.1, 0.1)) # %>%
# run_nm()
init_theta(m1) ## display current $THETA in tibble-form
init_omega(m1) ## display current $OMEGA in tibble-form
## here we supply a named vector in a different order
m1 <- m1 %>% init_theta(init = c(KA = -2, V = 1))
m1 %>% dollar("THETA")
## can also manipulate other aspects (like the FIX column) similarly
m1 <- m1 %>% init_theta(init = c(KA = -2, V = 1),
FIX = c(KA = TRUE))
m1 %>% dollar("THETA")
## perturb all parameters by ~10%
m1 <- m1 %>% init_theta(init = rnorm(length(init), mean = init, sd = 0.1))
m1 %>% dollar("THETA")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.