gh.LL {REMixed} | R Documentation |
Adaptive Gauss-Hermite approximation of log-likelihood derivatives
Description
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.
Usage
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
)
Arguments
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. |
Details
Based on notation introduced REMixed-package
. The log-likelihood of the model LL(\theta,\alpha_1)
for a set of population parameters \theta
and regulatization parameters \alpha_1
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.
Value
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 \theta, \alpha
provided.
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)))
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)