Package 'pmxcv'

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

Help Index


Built-in integration-based %CV functions

Description

Built-in integration-based %CV functions

Usage

dist.intcv(
  dist = "log",
  ...,
  exact = ifelse(dist == "log", TRUE, FALSE),
  lambda = NULL,
  fun = FALSE
)

Arguments

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

Value

Percent CV


Built-in moment functions

Description

Built-in moment functions

Usage

dist.moment(
  dist = "log",
  ...,
  exact = ifelse(dist == "log", TRUE, FALSE),
  lambda = NULL
)

Arguments

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

Value

moment


Integration-based CV%

Description

Integration-based CV%

Usage

intcv(...)

Arguments

...

Arguments passed to moment()

Value

Percent CV


Variance from CV%

Description

Variance from CV%

Usage

invcv(cvfun, cv, verbose = FALSE, ...)

Arguments

cvfun

intcv()-based function

cv

CV% generated from cvfun

verbose

extra output

...

Other parameters to pass to cvfun

Value

Best-fit variance


Moment function

Description

Moment function

Usage

moment(...)

Arguments

...

all arguments passed to moment_f()

Value

moment


Integratable moment function

Description

Integratable moment function

Usage

moment_f(x, u, v, n, pdist, qdist)

Arguments

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

Value

Point result of the moment function


Box-Cox transform typically used in NONMEM

Description

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.

Usage

nonmemboxcox(x, lambda, theta = 1, inv = FALSE)

Arguments

x

random vector. Must be positive.

lambda

shape parameter

theta

centrality parameter

inv

inverse transform

Value

Box-Cox transformed or untransformed vector


Numeric CV% of a sample

Description

Numeric CV% of a sample

Usage

numcv(x, ...)

Arguments

x

numeric vector

...

other arguments for sd() and mean()

Value

Percent cv

Examples

test_x <- rnorm(1000, mean=50, sd=5)
cv <- numcv(test_x)
cv # expect ~ 10(%)