computeFinalTest {REMixed}R Documentation

Compute final estimation

Description

Computes a final saem and wald test if 'test' on the final model found by remix algorithm.

Usage

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
)

Arguments

remix.output

a remix outputs. It's important that the project path of this outputs is still existing.

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 time as first columns and named dynamics in other columns. It must take in input :

  • y a named vector with the initial condition. The names are the dynamics names.

  • parms a named vector of parameter.

  • time vector a timepoint.

See dynFUN_demo, model.clairon, model.pasin or model.pk for examples.

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 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.

  • S: a 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);

  • linkS : a 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;

  • R: similarly, 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;

  • linkR : a vector specifying the observation model names for each transformation, in the same order as in R.

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 (\in[0;1]) in the Adaptative Gauss-Hermite algorithm used to compute the log-likelihood and its derivates (see gh.LL).

n

number of points for gaussian quadrature (see gh.LL).

parallel

logical, if the computation should be done in parallel when possible (default TRUE).

ncores

number of cores for parallelization (default NULL and detectCores is used).

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).

Details

For population parameter estimation settings, see (<https://monolixsuite.slp-software.com/r-functions/2024R1/setpopulationparameterestimationsettings>).

Value

a remix object on which final SAEM and test, if test is TRUE, have been computed.

Examples

## 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)

[Package REMixed version 0.1.0 Index]