addIndividualBlock
[Simulx] Add an INDIVIDUAL block to a structural model
Add an INDIVIDUAL block to a structural model. The structural model can be either a txt file or a library model, and the resulting model is written to another a file.
Usage
addIndividualBlock(sourceModelFile, targetModelFile, force = FALSE)
Arguments
- sourceModelFile
(character) Path to the model file. Can be absolute or relative. Alternatively, the name of a library model (starting with "lib:"); see
getLibraryModelName
for a list of available models.- targetModelFile
(character) Path to the resulting file. Can be absolute or relative.
- force
(logical) [optional] Should the resulting file be overwritten if already existing? Default: FALSE.
Details
Adding an INDIVIDUAL block enables to add inter-individual variability to all parameters of a structural model. For every parameter theta available in the structural model file, population parameters theta_pop (typical value) and omega_theta (standard deviation of random effects) are added to the model, and lognormal distributions are used by default. If the structural model is a library model, the distributions are set to normal, lognormal or logitnormal depending on the meaning of the parameter.
The resulting file can then be used as a starting point to remove IIV from some parameters, change parameter distributions, or add correlations if needed, and the final model can then be used to create a new Simulx project with newProject
.
More details on the syntax of the INDIVIDUAL block can be found here.
Examples
if (FALSE) {
addIndividualBlock("lib:bolus_1cpt_VCl.txt", "example_output_bolus_1cpt_VCl_with_individual_block.txt")
}
# Working example: create project from a library model with IIV on all parameters.
targetModelFile = tempfile("example_output_bolus_1cpt_VCl_with_individual_block",fileext = ".txt")
addIndividualBlock("lib:bolus_1cpt_VCl.txt", targetModelFile) # we add an IIV block to a library model which has parameters V and Cl.
#> [ERROR] Only available with simulx.
file.show(targetModelFile) # to look at the created file with a text editor
#> Warning: file.show(): file 'C:\Users\FRANOM~1\AppData\Local\Temp\RtmpopEtMJ\example_output_bolus_1cpt_VCl_with_individual_block49d056981fd5.txt' does not exist
newProject(targetModelFile) # create a new Simulx project with this model
#> [ERROR] Unexpected type encountered for the field "data", required.
getPopulationElements() # a population parameters element was automatically created with V_pop, omega_V, Cl_pop, omega_Cl.
#> [ERROR] This function relates to "simulx" software. It is not available for "monolix" software.
#> NULL