buildmlx: Automatic statistical model building

View source: R/buildmlx.R

buildmlxR Documentation

Automatic statistical model building

Description

buildmlx uses SAMBA (Stochastic Approximation for Model Building Algorithm), an iterative procedure to accelerate and optimize the process of model building by identifying at each step how best to improve some of the model components. This method allows to find the optimal statistical model which minimizes some information criterion in very few steps.

Usage

buildmlx(
  project = NULL,
  final.project = NULL,
  model = "all",
  prior = NULL,
  weight = NULL,
  coef.w1 = 0.5,
  paramToUse = "all",
  covToTest = "all",
  covToTransform = "none",
  center.covariate = FALSE,
  criterion = "BICc",
  linearization = FALSE,
  ll = T,
  test = T,
  direction = NULL,
  steps = 1000,
  n.full = 10,
  max.iter = 20,
  explor.iter = 2,
  fError.min = 0.001,
  seq.cov = FALSE,
  seq.cov.iter = 0,
  seq.corr = TRUE,
  p.max = 0.1,
  p.min = c(0.075, 0.05, 0.1),
  print = TRUE,
  nb.model = 1
)

Arguments

project

a string: the initial Monolix project

final.project

a string: the final Monolix project (default adds "_built" to the original project)

model

components of the model to optimize c("residualError", "covariate", "correlation"), (default="all")

prior

list of prior probabilities for each component of the model (default=NULL)

weight

list of penalty weights for each component of the model (default=NULL)

coef.w1

multiplicative weight coefficient used for the first iteration only (default=0.5)

paramToUse

list of parameters possibly function of covariates (default="all")

covToTest

components of the covariate model that can be modified (default="all")

covToTransform

list of (continuous) covariates to be log-transformed (default="none")

center.covariate

TRUE/FALSE center the covariates of the final model (default=FALSE)

criterion

penalization criterion to optimize c("AIC", "BIC", "BICc", gamma) (default=BICc)

linearization

TRUE/FALSE whether the computation of the likelihood is based on a linearization of the model (default=FALSE)

ll

TRUE/FALSE compute the observe likelihood and the criterion to optimize at each iteration

test

TRUE/FALSE perform additional statistical tests for building the model (default=TRUE)

direction

method for covariate search c("full", "both", "backward", "forward"), (default="full" or "both")

steps

maximum number of iteration for stepAIC (default=1000)

n.full

maximum number of covariates for an exhaustive comparison of all possible covariate models (default=10)

max.iter

maximum number of iterations (default=20)

explor.iter

number of iterations during the exploratory phase (default=2)

fError.min

minimum fraction of residual variance for combined error model (default = 1e-3)

seq.cov

TRUE/FALSE whether the covariate model is built before the correlation model

seq.cov.iter

number of iterations before building the correlation model (only when seq.cov=F, default=0)

seq.corr

TRUE/FALSE whether the correlation model is built iteratively (default=TRUE)

p.max

maximum p-value used for removing non significant relationships between covariates and individual parameters (default=0.1)

p.min

vector of 3 minimum p-values used for testing the components of a new model (default=c(0.075, 0.05, 0.1))

print

TRUE/FALSE display the results (default=TRUE)

nb.model

number of models to display at each iteration (default=1)

Details

Penalization criterion can be either a custom penalization of the form gamma*(number of parameters), AIC (gamma=2) or BIC (gamma=log(N)).

Several strategies can be used for building the covariate model at each iteration of the algorithm: direction="full" means that all the possible models are compared (default when the number of covariates is less than 10). Othrwise, direction is the mode of stepwise search of stepAIC {MASS}, can be one of "both", "backward", or "forward", with a default of "both" when there are at least 10 covariates. See https://monolix.lixoft.com/rsmlx/ for more details.

Value

a new Monolix project with a new statistical model.

Examples

# RsmlxDemo1.mlxtran is a Monolix project for modelling the pharmacokinetics (PK) of warfarin 
# using a PK model with parameters ka, V, Cl.

# By default, buildmlx will compute the best statistical model in term of BIC, i.e , 
# the best covariate model, the best correlation model for the three random effects and the best 
# residual error model in terms of BIC. 
# In this example, three covariates (wt, age, sex) are available with the data and will be used 
# for building the covariate model for the three PK parameters:
r1 <- buildmlx(project="RsmlxDemo1.mlxtran")
  
# Here, the covariate model will be built for V and Cl only and log-transformation of all 
# continuous covariates will also be considered:
r2 <- buildmlx(project="RsmlxDemo1.mlxtran", paramToUse=c("V", "Cl"), covToTransform="all") 

# Only the covariate model will be  built, using AIC instead of BIC:
r3 <- buildmlx(project="RsmlxDemo1.mlxtran", model="covariate", criterion="AIC") 

# See http://monolix.lixoft.com/rsmlx/buildmlx/ for detailed examples of use of buildmlx
# Download the demo examples here: http://monolix.lixoft.com/rsmlx/installation



Rsmlx documentation built on Oct. 17, 2023, 5:09 p.m.

Related to buildmlx in Rsmlx...