Description Usage Arguments Details Value Examples
Compute predictions and sample data from Mlxtran
and R
models
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
model |
a |
parameter |
a vector of parameters with their names and values |
output |
a list (or list of lists) with fields:
|
treatment |
a list with fields
|
regressor |
a list, or a list of lists, with fields
|
varlevel |
(IOV supported by mlxR >= 3.2.2) a list (or a dataframe) with fields:
|
group |
a list, or a list of lists, with fields:
|
data |
a list (output of simulx when settings$data.in==TRUE) |
project |
the name of a Monolix project |
nrep |
number of replicates |
npop |
number of population parameters to draw randomly |
fim |
a string with the Fisher Information Matrix to be used |
result.folder |
the name of the folder where the outputs of simulx should be stored |
result.file |
the name of the single file where the outputs of simulx should be saved |
stat.f |
a R function for computing some summary (mean, quantiles, survival,...) of the simulated data. Default = "statmlx". |
addlines |
a list with fields:
|
settings |
a list of optional settings
|
simulx takes advantage of the modularity of hierarchical models for simulating different components of a model: models for population parameters, individual covariates, individual parameters and longitudinal data.
Furthermore, simulx
allows to draw different types of longitudinal data,
including continuous, count, categorical, and time-to-event data.
The models are encoded using either the model coding language Mlxtran, or R. Mlxtran models are automatically converted into C++ codes, compiled on the fly and linked to R using the Rcpp package. That allows one to implement very easily complex models and to take advantage of the numerical sovers used by the C++ mlxLibrary.
See http://simulx.webpopix.org for more details.
A list of data frames. Each data frame is an output of simulx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
myModel <- inlineModel("
[LONGITUDINAL]
input = {A, k, c, a}
EQUATION:
t0 = 0
f_0 = A
ddt_f = -k*f/(c+f)
DEFINITION:
y = {distribution=normal, prediction=f, sd=a}
[INDIVIDUAL]
input = {k_pop, omega}
DEFINITION:
k = {distribution=lognormal, prediction=k_pop, sd=omega}
")
f <- list(name='f', time=seq(0, 30, by=0.1))
y <- list(name='y', time=seq(0, 30, by=2))
res <- simulx(model = 'model/home.txt',
parameter = c(A=100, k_pop=6, omega=0.3, c=10, a=2),
output = list(f,y,"k"),
group = list(size=4, level='individual'))
plot(ggplotmlx() + geom_line(data=res$f, aes(x=time, y=f, colour=id)) +
geom_point(data=res$y, aes(x=time, y=y, colour=id)))
print(res$parameter)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.