| Title: | Regularized Estimation in Mixed Effects Model |
|---|---|
| Description: | Implementation of an algorithm in two steps to estimate parameters of a model whose latent dynamics are inferred through latent processes, jointly regularized. This package uses 'Monolix' software (<https://monolixsuite.slp-software.com/>), which provide robust statistical method for non-linear mixed effects modeling. 'Monolix' must have been installed prior to use. |
| Authors: | Auriane Gabaut [aut, cre], Ariane Bercu [aut], Mélanie Prague [aut], Cécile Proust-Lima [aut] |
| Maintainer: | Auriane Gabaut <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.1.2 |
| Built: | 2026-05-20 08:38:33 UTC |
| Source: | https://github.com/aurianegbt/remixed |
Computes akaike information criterion from the output of remix as
where is the total number of parameters estimated and the log-likelihood of the model.
## S3 method for class 'remix' AIC(object, ..., k)## S3 method for class 'remix' AIC(object, ..., k)
object |
output of |
... |
additional arguments. |
k |
numeric, the penalty per parameter to be used; the default k = 2 is the classical AIC. |
AIC.
Akaike, H. 1998. Information theory and an extension of the maximum likelihood principle, Selected papers of hirotugu akaike, 199-213. New York: Springer.
## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) AIC(res) ## End(Not run)## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) AIC(res) ## End(Not run)
Computes bayesian information criterion from the output of remix as
where is the total number of parameters estimated, the number of subject and the log-likelihood of the model.
## S3 method for class 'remix' BIC(object, ...)## S3 method for class 'remix' BIC(object, ...)
object |
output of |
... |
additional arguments. |
BIC.
Schwarz, G. 1978. Estimating the dimension of a model. The annals of statistics 6 (2): 461-464
## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) BIC(res) ## End(Not run)## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) BIC(res) ## End(Not run)
Computes corrected bayesian information criterion as
where is the total number of parameters linked to fixed effects, to random effects, the number of subject, the total number of observations and the log-likelihood of the model.
BICc(object, ...)BICc(object, ...)
object |
|
... |
opptional additional arguments. |
BICc.
Delattre M, Lavielle M, Poursat M-A. A note on BIC in mixed-effects models. Elect J Stat. 2014; 8(1): 456-475.
## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) BICc(res) ## End(Not run)## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) BICc(res) ## End(Not run)
Computes a final saem and wald test if 'test' on the final model found by remix algorithm.
computeFinalTest( remix.output, dynFUN, y, ObsModel.transfo, final.project = NULL, pop.set = NULL, prune = NULL, n = NULL, parallel = TRUE, ncores = NULL, print = TRUE, digits = 3, trueValue = NULL, test = TRUE, p.max = 0.05 )computeFinalTest( remix.output, dynFUN, y, ObsModel.transfo, final.project = NULL, pop.set = NULL, prune = NULL, n = NULL, parallel = TRUE, ncores = NULL, print = TRUE, digits = 3, trueValue = NULL, test = TRUE, p.max = 0.05 )
remix.output |
a |
dynFUN |
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
See |
y |
initial condition of the mechanism model, conform to what is asked in dynFUN. |
ObsModel.transfo |
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 Both
|
final.project |
directory of the final Monolix project (default add "_upd" to the Monolix project). |
pop.set |
population parameters setting for final estimation (see details). |
prune |
percentage for prunning ( |
n |
number of points for gaussian quadrature (see |
parallel |
logical, if the computation should be done in parallel when possible (default TRUE). |
ncores |
number of cores for parallelization (default NULL and |
print |
logical, if the results and algotihm steps should be displayed in the console (default to TRUE). |
digits |
number of digits to print (default to 3). |
trueValue |
-for simulation purposes- named vector of true value for parameters. |
test |
if Wald test should be computed at the end of the iteration. |
p.max |
maximum value to each for wald test p.value (default 0.05). |
For population parameter estimation settings, see (<https://monolixsuite.slp-software.com/r-functions/2024R1/setpopulationparameterestimationsettings>).
a remix object on which final SAEM and test, if test is TRUE, have been computed.
## Not run: 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) res_with_test = computeFinalTest(retrieveBest(res0,criterion=BICc), dynFUN_demo, y, ObsModel.transfo) ## End(Not run)## Not run: 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) res_with_test = computeFinalTest(retrieveBest(res0,criterion=BICc), dynFUN_demo, y, ObsModel.transfo) ## End(Not run)
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 )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 )
project |
directory of the Monolix project (in .mlxtran). If NULL, the current loaded project is used (default is NULL). |
final.project |
directory of the final Monolix project (default add "_upd" to the Monolix project). |
dynFUN |
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
.
See |
y |
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). |
ObsModel.transfo |
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 Both
;
|
alpha |
named list of named vector " |
lambda.grid |
grid of user-suuplied penalisation parameters for the lasso regularization (if NULL, the sequence is computed based on the data). |
alambda |
if |
nlambda |
if |
lambda_max |
if |
eps1 |
integer (>0) used to define the convergence criteria for the regression parameters. |
eps2 |
integer (>0) used to define the convergence criteria for the likelihood. |
selfInit |
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 |
population parameters setting for initialisation (see details). |
pop.set2 |
population parameters setting for iterations. |
prune |
percentage for prunning ( |
n |
number of points for gaussian quadrature (see |
parallel |
logical, if the computation should be done in parallel when possible (default TRUE). |
ncores |
number of cores for parallelization (default NULL and |
print |
logical, if the results and algotihm steps should be displayed in the console (default to TRUE). |
digits |
number of digits to print (default to 3). |
trueValue |
-for simulation purposes- named vector of true value for parameters. |
unlinkBuildProject |
logical, if the build project of each lambda should be deleted. |
max.iter |
maximum number of iteration (default 20). |
See REMixed-package for details on the model.
For each , the remix is launched.
For population parameter estimation settings, see (<https://monolixsuite.slp-software.com/r-functions/2024R1/setpopulationparameterestimationsettings>).
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 .
BICVector of BIC values for the model built over the grid of .
BICcVector of BICc values for the model built over the grid of .
LLVector of log-likelihoods for the model built over the grid of .
LL.penVector of penalized log-likelihoods for the model built over the grid of .
resList of all REMixed results for each (see remix).
outputsList of all REMixed outputs for each (see remix).
## Not run: 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) ## End(Not run)## Not run: 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) ## End(Not run)
Example of solver for remix and cv.remix algorithm. It is perfectly adapted for the Monolix demo project (see getMLXdir).
dynFUN_demodynFUN_demo
dynFUN_demo
function of t, y, parms :
tvector of timepoint.
yinitial condition, named vector of form c(AB=<...>,S=<...>).
parmsnamed vector of model parameter ; should contain phi_S,delta_AB,delta_S.
Suppose you have antibodies secreting cells -- that produces antibodies -- at rate . These two biological entities decay respectively at rate and . The biological mechanism behind is :
Pasin C, Balelli I, Van Effelterre T, Bockstal V, Solforosi L, Prague M, Douoguih M, Thiébaut R, for the EBOVAC1 Consortium. 2019. Dynamics of the humoral immune response to a prime-boost Ebola vaccine: quantification and sources of variation. J Virol 93 : e00579-19. https://doi.org/10.1128/JVI.00579-19
t = seq(0,300,1) y =c(AB=1000,S=5) parms = c(phi_S = 611, delta_AB = 0.03, delta_S=0.01) res <- dynFUN_demo(t,y,parms) plot(res[,"time"], log10(res[,"AB"]), ylab="log10(AB(t))", xlab="time (days)", main="Antibody titer over the time", type="l") plot(res[,"time"], res[,"S"], ylab="S(t)", xlab="time (days)", main="Antibody secreting cells quantity over time", type="l")t = seq(0,300,1) y =c(AB=1000,S=5) parms = c(phi_S = 611, delta_AB = 0.03, delta_S=0.01) res <- dynFUN_demo(t,y,parms) plot(res[,"time"], log10(res[,"AB"]), ylab="log10(AB(t))", xlab="time (days)", main="Antibody titer over the time", type="l") plot(res[,"time"], res[,"S"], ylab="S(t)", xlab="time (days)", main="Antibody secreting cells quantity over time", type="l")
Computes extended bayesian information criterion as
where is the total number of parameters estimated, the number of subject, the log-likelihood of the model, the number of submodel to explore (here the numbre of biomarkers tested) and the numbre of biomarkers selected in the model.
eBIC(object, ...)eBIC(object, ...)
object |
|
... |
opptional additional arguments. |
eBIC.
Chen, J. and Z. Chen. 2008. Extended Bayesian information criteria for model selection with large model spaces. Biometrika 95 (3): 759-771.
## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) eBIC(res) ## End(Not run)## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) eBIC(res) ## End(Not run)
Extracts a build from a cvRemix object.
extract(fit, n)extract(fit, n)
fit |
output of |
n |
rank (in the 'fit$lambda') to extract. |
outputs from remix algorithm of rank 'n' computed by cv.remix.
## Not run: 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) cv.outputs = cv.Remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), ncores=8, eps2=1) res <- extract(cv.outputs,6) plotConvergence(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt")) plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)## Not run: 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) cv.outputs = cv.Remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), ncores=8, eps2=1) res <- extract(cv.outputs,6) plotConvergence(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt")) plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)
Get monolix demo project path
getMLXdir()getMLXdir()
path to the monolix demo from REMix package.
print(getMLXdir())print(getMLXdir())
Computes Adaptive Gauss-Hermite approximation of the log-likelihood and its derivatives in NLMEM with latent observation processes, see REMixed-package for details on the model.
gh.LL( dynFUN, y, mu = NULL, Omega = NULL, theta = NULL, alpha1 = NULL, covariates = NULL, ParModel.transfo = NULL, ParModel.transfo.inv = NULL, Sobs = NULL, Robs = NULL, Serr = NULL, Rerr = NULL, ObsModel.transfo = NULL, data = NULL, n = NULL, prune = NULL, parallel = TRUE, ncores = NULL, onlyLL = FALSE, verbose = TRUE, precBits = 10 )gh.LL( dynFUN, y, mu = NULL, Omega = NULL, theta = NULL, alpha1 = NULL, covariates = NULL, ParModel.transfo = NULL, ParModel.transfo.inv = NULL, Sobs = NULL, Robs = NULL, Serr = NULL, Rerr = NULL, ObsModel.transfo = NULL, data = NULL, n = NULL, prune = NULL, parallel = TRUE, ncores = NULL, onlyLL = FALSE, verbose = TRUE, precBits = 10 )
dynFUN |
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
See |
y |
initial condition of the mechanism model, conform to what is asked in |
mu |
list of individuals random effects estimation (vector of r.e. need to be named by the parameter names), use to locate the density mass; (optional, see description). |
Omega |
list of individuals estimated standard deviation diagonal matrix (matrix need to have rows and columns named by the parameter names), use to locate the density mass; (optional, see description). |
theta |
list of model parameters containing (see details)
(optional, see description). |
alpha1 |
named vector of regulatization parameters |
covariates |
matrix of individual covariates (size N x n). Individuals must be sorted in the same order than in |
ParModel.transfo |
named list of transformation functions |
ParModel.transfo.inv |
Named list of inverse transformation functions for the individual parameter model (names must be consistent with |
Sobs |
list of individuals trajectories for the direct observation models |
Robs |
list of individuals trajectories for the latent observation models |
Serr |
named vector of the estimated error mocel constants |
Rerr |
named vector of the estimated error mocel constants |
ObsModel.transfo |
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 Both
|
data |
output from |
n |
number of points per dimension to use for the Gauss-Hermite quadrature rule. |
prune |
integer between 0 and 1, percentage of pruning for the Gauss-Hermite quadrature rule (default NULL). |
parallel |
logical, if computation should be done in parallel. |
ncores |
number of cores to use for parallelization, default will detect the number of cores available. |
onlyLL |
logical, if only the log-likelihood should be computed (and not |
verbose |
logical, if progress bar should be printed through the computation. |
precBits |
precision if needed |
Based on notation introduced REMixed-package. The log-likelihood of the model for a set of population parameters and regulatization parameters is estimated using Adaptative Gausse-Hermite quadrature, using conditional distribution estimation to locate the mass of the integrand. If the project has been initialized as a Monolix project, the user can use readMLX function to retrieve all the project information needed here.
A list with the approximation by Gauss-Hermite quadrature of the likelihood L, the log-likelihood LL, the gradient of the log-likelihood dLL, and the Hessian of the log-likelihood ddLL at the point provided.
## Not run: 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))) data <- readMLX(project,ObsModel.transfo,alpha) LL <- gh.LL(dynFUN = dynFUN_demo, y = c(S=5,AB=1000), ObsModel.transfo=ObsModel.transfo, data = data) print(LL) ## End(Not run)## Not run: 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))) data <- readMLX(project,ObsModel.transfo,alpha) LL <- gh.LL(dynFUN = dynFUN_demo, y = c(S=5,AB=1000), ObsModel.transfo=ObsModel.transfo, data = data) print(LL) ## End(Not run)
Generate the individual parameters of indivual whose covariates are covariates and random effects eta_i.
indParm(theta, covariates, eta_i, transfo, transfo.inv)indParm(theta, covariates, eta_i, transfo, transfo.inv)
theta |
list with at least
|
covariates |
line data.frame of individual covariates ; |
eta_i |
named vector of random effect for each |
transfo |
named list of transformation functions |
transfo.inv |
amed list of inverse transformation functions for the individual parameter model (names must be consistent with |
The models used for the parameters are :
with the transformation, the vector of covariates effect and with the random effects associated parameter ;
with the transformation and the vector of covariates effect associated parameter.
a list with phi_i and psi_i parameters.
phi_pop = c(delta_S = 0.231, delta_L = 0.000316) psi_pop = c(delta_Ab = 0.025,phi_S = 3057, phi_L = 16.6) gamma = NULL covariates = data.frame(cAGE = runif(1,-15,15), G1 = rnorm(1), G2 = rnorm(1)) beta = list(delta_Ab=c(0,1.2,0),phi_S = c(0.93,0,0),phi_L=c(0,0,0.8)) theta=list(phi_pop = phi_pop,psi_pop = psi_pop,gamma = gamma, beta = beta) eta_i = c(delta_Ab = rnorm(1,0,0.3),phi_S=rnorm(1,0,0.92),phi_L=rnorm(1,0,0.85)) transfo = list(delta_Ab=log,phi_S=log,phi_L=log) transfo.inv = list(delta_Ab = exp,phi_S=exp,phi_L=exp) indParm(theta,covariates,eta_i,transfo,transfo.inv)phi_pop = c(delta_S = 0.231, delta_L = 0.000316) psi_pop = c(delta_Ab = 0.025,phi_S = 3057, phi_L = 16.6) gamma = NULL covariates = data.frame(cAGE = runif(1,-15,15), G1 = rnorm(1), G2 = rnorm(1)) beta = list(delta_Ab=c(0,1.2,0),phi_S = c(0.93,0,0),phi_L=c(0,0,0.8)) theta=list(phi_pop = phi_pop,psi_pop = psi_pop,gamma = gamma, beta = beta) eta_i = c(delta_Ab = rnorm(1,0,0.3),phi_S=rnorm(1,0,0.92),phi_L=rnorm(1,0,0.85)) transfo = list(delta_Ab=log,phi_S=log,phi_L=log) transfo.inv = list(delta_Ab = exp,phi_S=exp,phi_L=exp) indParm(theta,covariates,eta_i,transfo,transfo.inv)
Selecting an initialization point by grouping biomarkers of project and running the SAEM. Initial condition is then selected using maximum log-likelihood.
initStrat( project, alpha, ObsModel.transfo, Nb_genes = 2, trueValue = NULL, pop.set = NULL, useSettingsInAPI = FALSE, conditionalDistributionSampling = FALSE, print = TRUE, digits = 2, unlinkTemporaryProject = TRUE, seed = NULL )initStrat( project, alpha, ObsModel.transfo, Nb_genes = 2, trueValue = NULL, pop.set = NULL, useSettingsInAPI = FALSE, conditionalDistributionSampling = FALSE, print = TRUE, digits = 2, unlinkTemporaryProject = TRUE, seed = NULL )
project |
directory of the Monolix project (in .mlxtran). If NULL, the current loaded project is used (default is NULL). |
alpha |
named list of named vector " |
ObsModel.transfo |
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 Both
|
Nb_genes |
Size of group of genes. |
trueValue |
-for simulation purposes- named vector of true value for parameters. |
pop.set |
population parameters setting for initialization (see details). |
useSettingsInAPI |
logical, if the settings for SAEM should not be changed from what is currently set in the project. |
conditionalDistributionSampling |
logical, if conditional distribution estimation should be done on the final project. |
print |
logical, if the results and algotihm steps should be displayed in the console (default to TRUE). |
digits |
number of digits to print (default to 2). |
unlinkTemporaryProject |
If temporary project (of genes group) is deleted (defaut: TRUE) |
seed |
value of the seed used to initialize the group (see set.seed). |
For population parameter estimation settings, see (<https://monolixsuite.slp-software.com/r-functions/2024R1/setpopulationparameterestimationsettings>).
a list of outputs for every group of genes tested with composition of the group, final parameter estimates, final scores estimates (OFV, AIC, BIC, BICc), temporary project directory. The final selected set is initialize in the project.
## Not run: 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))) initStrat(project,alpha,ObsModel.transfo,seed=1710) ## End(Not run)## Not run: 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))) initStrat(project,alpha,ObsModel.transfo,seed=1710) ## End(Not run)
Generates the dynamics of antibodies secreting cells -- that produces antibodies -- over time, with two injection of vaccine at time and , using Clairon and al., 2023, model.
model.clairon(t, y, parms, tinj = 21)model.clairon(t, y, parms, tinj = 21)
t |
vector of timepoint. |
y |
initial condition, named vector of form c(S=S0,Ab=A0). |
parms |
named vector of model parameter (should contain " |
tinj |
time of injection (default to 21). |
Model is defined as
on each interval and . For each interval , we have corresponding to the last injection date of vaccine, such that and . By definition, (Clairon and al., 2023).
Matrix of time and observation of antibody secreting cells and antibody titer .
Quentin Clairon, Melanie Prague, Delphine Planas, Timothee Bruel, Laurent Hocqueloux, et al. Modeling the evolution of the neutralizing antibody response against SARS-CoV-2 variants after several administrations of Bnt162b2. 2023. hal-03946556
y = c(S=1,Ab=0) parms = c(fM2 = 4.5, theta = 18.7, delta_S = 0.01, delta_Ab = 0.23, delta_V = 2.7) t = seq(0,35,1) res <- model.clairon(t,y,parms) plot(res)y = c(S=1,Ab=0) parms = c(fM2 = 4.5, theta = 18.7, delta_S = 0.01, delta_Ab = 0.23, delta_V = 2.7) t = seq(0,35,1) res <- model.clairon(t,y,parms) plot(res)
Generate trajectory of the Humoral Immune Response to a Prime-Boost Ebola Vaccine.
model.pasin(t, y, parms)model.pasin(t, y, parms)
t |
vector of time ; |
y |
initial condition, named vector of form |
parms |
named vector of model parameter ; should contain " |
The model correspond to the dynamics of the humoral response, from 7 days after the boost immunization with antibodies secreting cells - and , characterized by their half lives- that produces antibodies -- at rate and . All these biological entities decay at rate repectively and . Model is then defined as
Matrix of time and observation of antibody titer Ab, and ASCs S and L.
Pasin C, Balelli I, Van Effelterre T, Bockstal V, Solforosi L, Prague M, Douoguih M, Thiébaut R, for the EBOVAC1 Consortium. 2019. Dynamics of the humoral immune response to a prime-boost Ebola vaccine: quantification and sources of variation. J Virol 93: e00579-19. https://doi.org/10.1128/JVI.00579-19
y = c(Ab=0,S=5,L=5) parms = c(theta_S = 611, theta_L = 3.5, delta_Ab = 0.025, delta_S = 0.231, delta_L = 0.000152) t = seq(0,100,5) res <- model.pasin(t,y,parms) plot(res)y = c(Ab=0,S=5,L=5) parms = c(theta_S = 611, theta_L = 3.5, delta_Ab = 0.025, delta_S = 0.231, delta_L = 0.000152) t = seq(0,100,5) res <- model.pasin(t,y,parms) plot(res)
The administration is via a bolus. The PK model has one compartment (volume V) and a linear elimination (clearance Cl). The parameter ka is defined as .
model.pk(t, y, parms)model.pk(t, y, parms)
t |
vector of time ; |
y |
initial condition, named vector of form c(C=C0) ; |
parms |
named vector of model parameter ; should contain either " |
Matrix of time and observation of Concentration C.
res <- model.pk(seq(0,30,1),c(C=100),parms=c(ka=1)) plot(res)res <- model.pk(seq(0,30,1),c(C=100),parms=c(ka=1)) plot(res)
Calibration plot for cvRemix object.
## S3 method for class 'cvRemix' plot(x, criterion = BICc, trueValue = NULL, ...)## S3 method for class 'cvRemix' plot(x, criterion = BICc, trueValue = NULL, ...)
x |
output of |
criterion |
which criterion function to take into account. Default is the function 'BICc", but one can use 'BIC', 'AIC', 'eBIC' or any function depending on a 'cvRemix' object. |
trueValue |
-for simulation purposes- named vector of true value for parameters. |
... |
opptional additional arguments. |
A plot.
Calibration plot
plotCalibration( fit, legend.position = "none", trueValue = NULL, criterion = BICc, dismin = TRUE )plotCalibration( fit, legend.position = "none", trueValue = NULL, criterion = BICc, dismin = TRUE )
fit |
fit object of class cvRemix, from |
legend.position |
(default NULL) the default position of legends ("none", "left", "right", "bottom", "top", "inside"). |
trueValue |
(for simulation purpose) named vector containing the true value of regularization parameter. |
criterion |
function ; which criterion among 'BIC', 'eBIC', 'AIC', 'BICc', or function of cvRemix object to take into account (default : BICc). |
dismin |
logical ; if minimizers of information criterion should be display. |
Calibration plot, over the lambda.grid.
## Not run: 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) plotCalibration(res) plotIC(res) ## End(Not run)## Not run: 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) plotCalibration(res) plotIC(res) ## End(Not run)
Log-likelihood convergence
plotConvergence(fit, ...)plotConvergence(fit, ...)
fit |
fit object of class remix, from |
... |
opptional additional arguments. |
Log-Likelihood values throughout the algorithm iteration.
## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) plotConvergence(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt"))#' plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) plotConvergence(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt"))#' plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)
IC plot
plotIC(fit, criterion = BICc, dismin = TRUE)plotIC(fit, criterion = BICc, dismin = TRUE)
fit |
fit object of class cvRemix, from |
criterion |
which criterion among 'BICc', 'BIC', 'AIC' or 'eBIC' to take into account (default: BICc); |
dismin |
logical ; if minimizers of information criterion should be display. |
IC trhoughout the lambda.grid.
## Not run: 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) plotCalibration(res) plotIC(res) ## End(Not run)## Not run: 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) plotCalibration(res) plotIC(res) ## End(Not run)
Plot initialization
plotInit(init, alpha = NULL, trueValue = NULL)plotInit(init, alpha = NULL, trueValue = NULL)
init |
outputs from |
alpha |
named list of named vector " |
trueValue |
(for simulation purpose) named vector containing the true value of regularization parameter. |
log-likelihood value for all groups of genes tested.
## Not run: 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))) init <- initStrat(project,alpha,ObsModel.transfo,seed=1710) plotInit(init) ## End(Not run)## Not run: 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))) init <- initStrat(project,alpha,ObsModel.transfo,seed=1710) plotInit(init) ## End(Not run)
Display the value of parameters at each iteration
plotSAEM(fit, paramToPlot = "all", trueValue = NULL)plotSAEM(fit, paramToPlot = "all", trueValue = NULL)
fit |
object of class remix, from |
paramToPlot |
Population parameters to plot (which have been estimated by SAEM) ; |
trueValue |
(for simulation purpose) vector named of true values ; |
For each parameters, the values at the end of each iteration of remix algorithm is drawn. Moreover, the SAEM steps of each iteration are displayed.
## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) plotConvergence(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt")) plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)## Not run: 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) lambda = 1440 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) plotConvergence(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt")) plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)
This function retrieves all necessary information from a Monolix project file to format the input for the REMixed package. It gathers all relevant data required for the REMix algorithm.
readMLX(project = NULL, ObsModel.transfo, alpha)readMLX(project = NULL, ObsModel.transfo, alpha)
project |
directory of the Monolix project (in .mlxtran). If NULL, the current loaded project is used (default is NULL). |
ObsModel.transfo |
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 Both
|
alpha |
named list of named vector " |
To simplify its use, functions remix, cv.remix, gh.LL can be used with arguments data rather than all necessary informations "theta", "alpha1", "covariates", "ParModel.transfo", "ParModel.transfo.inv", "Sobs", "Robs", "Serr", "Rerr", "ObsModel.transfo" that could be extract from a monolix project. If the SAEM task of the project hasn't been launched, it's the initial condition and not the estimated parameters that are returned. If the conditional distribution estimation task has been launched, parameters "mu" and "Omega" are returned too.
A list containing parameters, transformations, and observations from the Monolix project in the format needed for the REMixed algorithm :
mu list of individuals random effects estimation (vector of r.e. need to be named by the parameter names), use to locate the density mass (if conditional distribution estimation through Monolix has been launched);
Omega list of individuals estimated standard deviation diagonal matrix (matrix need to have rows and columns named by the parameter names), use to locate the density mass (if conditional distribution estimation through Monolix has been launched);
theta list of model parameters containing i
phi_pop : named vector with the population parameters with no r.e. (NULL if none) ;
psi_pop : named vector with the population parameters with r.e. ;
gamma : named list (for each parameters) of named vector (for each covariates) of covariate effects from parameters with no r.e. ;
beta : named list (for each parameters) of named vector (for each covariates) of covariate effects from parameters with r.e..
alpha0 : named vector of parameters (names are identifier of the observation model, such as in a Monolix project);
omega : named vector of estimated r.e. standard deviation;
alpha1 named vector of regulatization parameters , with identifier of observation model as names;
covariates matrix of individual covariates (size N x n). Individuals must be sorted in the same order than in mu and Omega;
ParModel.transfo named list of transformation functions and for the individual parameter model (names must be consistent with phi_pop and psi_pop, missing entries are set by default to the identity function ;
ParModel.transfo.inv named list of inverse transformation functions for the individual parameter model (names must be consistent with phi_pop and psi_pop ;
Sobs ist of individuals trajectories for the direct observation models . Each element of the list, is a list of data.frame with time and observations . Each data.frame is named with the observation model identifiers ;
Robs list of individuals trajectories for the latent observation models . Each element of the list, is a list of data.frame with time and observations . Each data.frame is named with the observation model identifiers ;
Serr named vector of the estimated error mocel constants with observation model identifiers as names ;
Rerr named vector of the estimated error mocel constants with observation model identifiers as names ;
ObsModel.transfo same as inputObsModel.transfo list.
## Not run: 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))) res <- readMLX(project,ObsModel.transfo,alpha) ## End(Not run)## Not run: 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))) res <- readMLX(project,ObsModel.transfo,alpha) ## End(Not run)
Regularization and Estimation in Mixed effects model.
remix( project = NULL, final.project = NULL, dynFUN, y, ObsModel.transfo, alpha, lambda, eps1 = 10^(-2), eps2 = 10^(-1), selfInit = FALSE, pop.set1 = NULL, pop.set2 = NULL, pop.set3 = NULL, prune = NULL, n = NULL, parallel = TRUE, ncores = NULL, print = TRUE, verbose = FALSE, digits = 3, trueValue = NULL, finalSAEM = FALSE, test = TRUE, max.iter = +Inf, p.max = 0.05 )remix( project = NULL, final.project = NULL, dynFUN, y, ObsModel.transfo, alpha, lambda, eps1 = 10^(-2), eps2 = 10^(-1), selfInit = FALSE, pop.set1 = NULL, pop.set2 = NULL, pop.set3 = NULL, prune = NULL, n = NULL, parallel = TRUE, ncores = NULL, print = TRUE, verbose = FALSE, digits = 3, trueValue = NULL, finalSAEM = FALSE, test = TRUE, max.iter = +Inf, p.max = 0.05 )
project |
directory of the Monolix project (in .mlxtran). If NULL, the current loaded project is used (default is NULL). |
final.project |
directory of the final Monolix project (default add "_upd" to the Monolix project). |
dynFUN |
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
See |
y |
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). |
ObsModel.transfo |
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 Both
|
alpha |
named list of named vector " |
lambda |
penalization parameter |
eps1 |
integer (>0) used to define the convergence criteria for the regression parameters. |
eps2 |
integer (>0) used to define the convergence criteria for the likelihood. |
selfInit |
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 |
population parameters setting for initialisation (see details). |
pop.set2 |
population parameters setting for iterations. |
pop.set3 |
population parameters setting for final estimation. |
prune |
percentage for prunning ( |
n |
number of points for gaussian quadrature (see |
parallel |
logical, if the computation should be done in parallel when possible (default TRUE). |
ncores |
number of cores for parallelization (default NULL and |
print |
logical, if the results and algotihm steps should be displayed in the console (default to TRUE). |
verbose |
logical, if progress bar should be printed when possible. |
digits |
number of digits to print (default to 3). |
trueValue |
-for simulation purposes- named vector of true value for parameters. |
finalSAEM |
logical, if a final SAEM should be launch with respect to the final selected set. |
test |
if Wald test should be computed at the end of the iteration. |
max.iter |
maximum number of iterations (default 20). |
p.max |
maximum value to each for wald test p.value (default 0.05). |
See REMixed-package for details on the model.
For population parameter estimation settings, see (<https://monolixsuite.slp-software.com/r-functions/2024R1/setpopulationparameterestimationsettings>).
a list of outputs of final project and through the iteration :
infoinformations about the parameters (project path, regulatization and population parameter names, alpha names, value of lambda used, if final SAEM and test has been computed, parameters p.max and ) ;
finalRescontaining loglikelihood LL and penalized loglikelihood LL.pen values, final population parameters param and final regularization parameters alpha values, number of iterations iter and time needed , if computed, the estimated standard errors standardError and if test computed, the final results before test saemBeforeTest ;
iterOutputsthe list of all remix outputs, i.e. parameters, lieklihood, SAEM estimates and convergence criterion value over the iteration.
## Not run: 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) lambda = 382.22 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) summary(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt")) plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)## Not run: 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) lambda = 382.22 res = remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), eps2=1, lambda=lambda) summary(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt")) plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)
Extracts the build minimizing an information criterion over a grid of lambda.
retrieveBest(fit, criterion = BICc)retrieveBest(fit, criterion = BICc)
fit |
output of |
criterion |
which criterion function to take into account. Default is the function 'BICc", but one can use 'BIC', 'AIC', 'eBIC' or any function depending on a 'cvRemix' object. |
outputs from remix algorithm achieving the best IC among those computed by cv.remix.
cv.remix, remix, BIC.remix, eBIC, AIC.remix, BICc.
## Not run: 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) cv.outputs = cv.Remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), ncores=8, eps2=1) res <- retrieveBest(cv.outputs) plotConvergence(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt"))#' plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)## Not run: 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) cv.outputs = cv.Remix(project = project, dynFUN = dynFUN_demo, y = y, ObsModel.transfo = ObsModel.transfo, alpha = alpha, selfInit = TRUE, eps1=10**(-2), ncores=8, eps2=1) res <- retrieveBest(cv.outputs) plotConvergence(res) trueValue = read.csv(paste0(dirname(project),"/demoSMLX/Simulation/populationParameters.txt"))#' plotSAEM(res,paramToPlot = c("delta_S_pop","phi_S_pop","delta_AB_pop"),trueValue=trueValue) ## End(Not run)