Regularization and Estimation in Mixed effects model, over a regularization path.
cv.remix(
project = NULL,
final.project = NULL,
dynFUN,
y,
ObsModel.transfo,
alpha,
lambda.grid = NULL,
alambda = 0.001,
nlambda = 50,
lambda_max = NULL,
eps1 = 10^(-2),
eps2 = 10^(-1),
selfInit = FALSE,
pop.set1 = NULL,
pop.set2 = NULL,
prune = NULL,
n = NULL,
parallel = TRUE,
ncores = NULL,
print = TRUE,
digits = 3,
trueValue = NULL,
unlinkBuildProject = TRUE,
max.iter = +Inf
)A list of outputs of the final project and of the iterative process over each value of lambda.grid:
infoInformation about the parameters.
projectThe project path if not unlinked.
lambdaThe grid of \(\lambda\).
BICVector of BIC values for the model built over the grid of \(\lambda\).
BICcVector of BICc values for the model built over the grid of \(\lambda\).
LLVector of log-likelihoods for the model built over the grid of \(\lambda\).
LL.penVector of penalized log-likelihoods for the model built over the grid of \(\lambda\).
resList of all REMixed results for each \(\lambda\) (see remix).
outputsList of all REMixed outputs for each \(\lambda\) (see remix).
directory of the Monolix project (in .mlxtran). If NULL, the current loaded project is used (default is NULL).
directory of the final Monolix project (default add "_upd" to the Monolix project).
function computing the dynamics of interest for a set of parameters. This function need to contain every sub-function that it may needs (as it is called in a foreach loop). The output of this function need to return a data.frame with time as first columns and named dynamics in other columns. It must take in input :
parmsa named vector of parameter
timevector a timepoint.
See dynFUN_demo, model.clairon, model.pasin or model.pk for examples.
initial condition of the mechanism model, conform to what is asked in dynFUN. If regressor used in Monolix provided a named list of vector of individual initial conditions. Each vector need to be of length 1 (same for all), or exactly the numbre of individuals (range in the same order as their id).
list containing two lists of transformations and two vectors linking each transformations to their observation model name in the Monolix project. The list should include identity transformations and be named S and R. The two vectors should be named linkS and linkR.
Both S (for the direct observation models) and linkS, as well as R (for latent process models) and linkR, must have the same length.
Sa list of transformations for the direct observation models. Each transformation corresponds to a variable \(Y_p=h_p(S_p)\), where the name indicates which dynamic is observed (from dynFUN);
linkSa vector specifying the observation model names (that is used in the monolix project, alpha1, etc.) for each transformation, in the same order as in S
Rsimilarly, a list of transformations for the latent process models. Although currently there is only one latent dynamic, each \(s_k, k\leq K\) transformation corresponds to the same dynamic but may vary for each \(Y_k\) observed. The names should match the output from dynFUN;
linkRa vector specifying the observation model names for each transformation, in the same order as in R.
named list of named vector "alpha0", "alpha1" (all alpha1 are mandatory). The name of alpha$alpha0 and alpha$alpha1 are the observation model names from the monolix project to which they are linked (if the observations models are defined whithout intercept, alpha$alpha0 need to be set to the vector NULL).
grid of user-suuplied penalisation parameters for the lasso regularization (if NULL, the sequence is computed based on the data).
if lambda.grid is null, coefficients used to compute the grid (default to 0.05, see details).
if lambda.grid is null, number of lambda parameter to test (default to 50).
if lambda.grid is null, maximum of the lambda grid to test (default is automatically computed, see details)
integer (>0) used to define the convergence criteria for the regression parameters.
integer (>0) used to define the convergence criteria for the likelihood.
logical, if the SAEM is already done in the monolix project should be use as the initial point of the algorithm (if FALSE, SAEM is automatically compute according to pop.set1 settings ; if TRUE, a SAEM through monolix need to have been launched).
population parameters setting for initialisation (see details).
population parameters setting for iterations.
percentage for prunning (\(\in[0;1]\)) in the Adaptative Gauss-Hermite algorithm used to compute the log-likelihood and its derivates (see gh.LL).
number of points for gaussian quadrature (see gh.LL).
logical, if the computation should be done in parallel when possible (default TRUE).
number of cores for parallelization (default NULL and detectCores is used).
logical, if the results and algotihm steps should be displayed in the console (default to TRUE).
number of digits to print (default to 3).
-for simulation purposes- named vector of true value for parameters.
logical, if the build project of each lambda should be deleted.
maximum number of iteration (default 20).
See REMixed-package for details on the model.
For each \(\lambda\in\Lambda\), the remix is launched.
For population parameter estimation settings, see (<https://monolixsuite.slp-software.com/r-functions/2024R1/setpopulationparameterestimationsettings>).
if (FALSE) {
project <- getMLXdir()
ObsModel.transfo = list(S=list(AB=log10),
linkS="yAB",
R=rep(list(S=function(x){x}),5),
linkR = paste0("yG",1:5))
alpha=list(alpha0=NULL,
alpha1=setNames(paste0("alpha_1",1:5),paste0("yG",1:5)))
y = c(S=5,AB=1000)
res = cv.remix(project = project,
dynFUN = dynFUN_demo,
y = y,
ObsModel.transfo = ObsModel.transfo,
alpha = alpha,
selfInit = TRUE,
eps1=10**(-2),
ncores=8,
nlambda=8,
eps2=1)
}
Run the code above in your browser using DataLab