readMLX: Extract Data for REMixed Algorithm from a Monolix Project

View source: R/readMLX.R

readMLXR Documentation

Extract Data for REMixed Algorithm from a Monolix Project

Description

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.

Usage

readMLX(project = NULL, ObsModel.transfo, alpha)

Arguments

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

alpha

named list of named vector "alpha0", "alpha1" (all alpha1 are mandatory). The names 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).

Details

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.

Value

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. (\phi_{l\ pop})_{l\leq L} (NULL if none) ;

    • psi_pop : named vector with the population parameters with r.e. (\psi_{l\ pop})_{l\leq m} ;

    • 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 (\alpha_{0k})_{k\leq K} 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 (\alpha_{1k})_{k\leq K}, 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 (h_l)_{l\leq m} and (s_k)_{k\leq K} 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 (Y_{pi})_{p \leq P,i\leq N}. Each element i\leq N of the list, is a list of p\leq P data.frame with time (t_{pij})_{j\leq n_{ip}} and observations (Y_{pij})_{j\leq n_{ip}}. Each data.frame is named with the observation model identifiers ;

  • Robs list of individuals trajectories for the latent observation models (Z_{ki})_{k \leq K,i\leq N}. Each element i\leq N of the list, is a list of k\leq K data.frame with time (t_{kij})_{j\leq n_{ik}} and observations (Z_{kij})_{j\leq n_{ik}}. Each data.frame is named with the observation model identifiers ;

  • Serr named vector of the estimated error mocel constants (\varsigma_p)_{p\leq P} with observation model identifiers as names ;

  • Rerr named vector of the estimated error mocel constants (\sigma_k)_{k\leq K} with observation model identifiers as names ;

  • ObsModel.transfo same as inputObsModel.transfo list.

See Also

remix, cv.remix.

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

res <- readMLX(project,ObsModel.transfo,alpha)

## End(Not run)

REMixed documentation built on June 28, 2025, 1:09 a.m.