| get_cov_matrix | R Documentation |
Pulls the uncertainty (covariance step) matrix for estimated parameters,
with built-in support for nonmem (via the .cov/.cor output tables)
and nlmixr2 (via the fit object's covariance matrix) models. This is
what feeds cormat(), but is exported separately since it may be
useful on its own (eg, for programmatic checks on parameter colinearity).
get_cov_matrix(
xpdb,
type = c("correlation", "covariance"),
.problem = NULL,
.subprob = NULL,
.method = NULL,
drop_fixed = TRUE,
quiet
)
xpdb |
< |
type |
< |
.problem |
< |
.subprob |
< |
.method |
< |
drop_fixed |
< |
quiet |
< |
For nonmem models, the matrix is built from the .cor/.cov output
tables produced by the $COV step. NONMEM includes fixed-effect
parameters in these tables as placeholder zeros (since no uncertainty is
estimated for them); drop_fixed (the default) removes them.
For nlmixr2 models, uncertainty is always calculated for fixed-effect
(theta) parameters; whether it's also calculated for random-effect
(omega) diagonal (variance) elements depends on the nlmixr2est
version and fit settings – when present, those rows/columns are named
"om.<eta name>" to distinguish them from the point estimates
returned by get_prm(). drop_fixed has no effect here, since
parameters without a standard error are already excluded from the
fit's covariance matrix rather than represented as placeholder zeros.
In both cases, if the covariance step was not run, or did not complete successfully, an informative error is raised rather than returning partial or placeholder data.
A symmetric numeric matrix, with parameter names as dimnames.
get_cov_matrix(xpdb_x)
get_cov_matrix(xpdb_x, type = "covariance")
## Not run:
xpdb_nlmixr2 <- nlmixr_example("xpdb_nlmixr2")
get_cov_matrix(xpdb_nlmixr2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.