Title: | Integration-Based Coefficients of Variance |
---|---|
Description: | Estimate coefficient of variance percent (CV%) for any arbitrary distribution, including some built-in estimates for commonly-used transformations in pharmacometrics. Methods are described in various sources, but applied here as summarized in: Prybylski, (2024) <doi:10.1007/s40262-023-01343-2>. |
Authors: | John Prybylski [aut, cre] |
Maintainer: | John Prybylski <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1.0 |
Built: | 2024-11-05 06:37:22 UTC |
Source: | CRAN |
Built-in integration-based %CV functions
dist.intcv( dist = "log", ..., exact = ifelse(dist == "log", TRUE, FALSE), lambda = NULL, fun = FALSE )
dist.intcv( dist = "log", ..., exact = ifelse(dist == "log", TRUE, FALSE), lambda = NULL, fun = FALSE )
dist |
Selection of built-in distributions. |
... |
passed to moment() |
exact |
If there is an exact moment generating function, use that. Default TRUE only for log |
lambda |
shape parameter for nonmemboxcox() |
fun |
return function (for use in invcv()) |
Percent CV
Built-in moment functions
dist.moment( dist = "log", ..., exact = ifelse(dist == "log", TRUE, FALSE), lambda = NULL )
dist.moment( dist = "log", ..., exact = ifelse(dist == "log", TRUE, FALSE), lambda = NULL )
dist |
Selection of built-in distributions. |
... |
passed to moment() |
exact |
If there is an exact moment generating function, use that. Default TRUE only for log |
lambda |
shape parameter for nonmemboxcox() |
moment
Integration-based CV%
intcv(...)
intcv(...)
... |
Arguments passed to moment() |
Percent CV
Variance from CV%
invcv(cvfun, cv, verbose = FALSE, ...)
invcv(cvfun, cv, verbose = FALSE, ...)
cvfun |
intcv()-based function |
cv |
CV% generated from cvfun |
verbose |
extra output |
... |
Other parameters to pass to cvfun |
Best-fit variance
Moment function
moment(...)
moment(...)
... |
all arguments passed to moment_f() |
moment
Integratable moment function
moment_f(x, u, v, n, pdist, qdist)
moment_f(x, u, v, n, pdist, qdist)
x |
numeric vector |
u |
mean |
v |
variance |
n |
moment number |
pdist |
un-transform function for transformed random variable (eg, exp()) |
qdist |
transform function (eg, log()) |
Point result of the moment function
Parameters are typically treated as lognormally-distributed by NONMEM users. Box-Cox transforms are typically applied to the exponentiated individual ETA parameters; this means the parameter is neither Box-Cox distributed nor lognormally-distributed, but both. To get the "Box-Cox Transform" as it would be relevant for CV% calculation, these properties have to be considered.
nonmemboxcox(x, lambda, theta = 1, inv = FALSE)
nonmemboxcox(x, lambda, theta = 1, inv = FALSE)
x |
random vector. Must be positive. |
lambda |
shape parameter |
theta |
centrality parameter |
inv |
inverse transform |
Box-Cox transformed or untransformed vector
Numeric CV% of a sample
numcv(x, ...)
numcv(x, ...)
x |
numeric vector |
... |
other arguments for sd() and mean() |
Percent cv
test_x <- rnorm(1000, mean=50, sd=5) cv <- numcv(test_x) cv # expect ~ 10(%)
test_x <- rnorm(1000, mean=50, sd=5) cv <- numcv(test_x) cv # expect ~ 10(%)