Construct an IIV covariance matrix

Construct an IIV covariance matrix

getCovMatrixIIV(
  obj,
  spec = specifyParamSampling(obj),
  iivPopParamValues = getParamEstimates(spec),
  FLAGcheckPDCovMatrix = TRUE,
  FLAGreturnCorrMatrix = FALSE,
  FLAGcheckPDCorrMatrix = FLAGcheckPDCovMatrix
)

Arguments

obj

a filename (character string) denoting the path to a GPF file, or a GPF object, or an IQRnlmeParamSpec object.

spec

a IQRnlmeParamSpec object. Default: specifyParamSampling(obj). If specified, this parameter overwrites obj.

iivPopParamValues

a data.frame with population parameter values describing the IIV distribution. The number of rows in this data.frame defines the number of populations for which random effects are to be sampled.

FLAGcheckPDCovMatrix

logical indicating if the returned cov matrix should be checked for positive-definiteness and adjusted to a positive-definite matrix (if possible). Default: TRUE.

FLAGreturnCorrMatrix

logical indicating if instead only returning the cov matrix, a named list with an entry cov and corr should be containing the cov and corr matrices, respectively. Default: FALSE.

FLAGcheckPDCorrMatrix

logical that is meaningful only if FLAGreturnCorrMatrix is set to TRUE. If so, the FLAG has analogical meaning to FLAGcheckPDCovMatrix. Default: FLAGcheckPDCovMatrix.

Value

a covariance matrix or (if FLAGreturnCorrMatrix == TRUE) a named list with elements cov and cor. Note: if FLAGcheckPDCorrMatrix and FLAGcheckPDcovMatrix are TRUE, the returned object may not be matrices but character strings with the value "failed".

See also