Learn R Programming

nlmeVPC (version 2.6)

optK: Find the optimal number of bins

Description

This function automatically finds the optimal number of bins using dynamic programming.

Usage

optK(X,
     Kmethod = "cluster",
     maxK = 10,
     beta = 0.2,
     lambda = 0.3,
     R = 4,
     C1 = 2.5,
     C2 = 7.8, ...)

Value

The optimal number of bins, the result of binning, and the summary of binning including the penalty values up to the maximum number of bins are returned.

Arguments

X

Numeric vector corresponding to Y.

Kmethod

The way to calculate the penalty in automatic binning."cluster" or "kernel".

maxK

The maximum number of bins.

beta

Additional parameter for automatic binning. For more detailed explanation, see reference.

lambda

Additional parameter for automatic binning. For more detailed explanation, see reference.

R

Additional parameter for automatic binning. For more detailed explanation, see reference.

C1

Additional parameter for automatic binning. For more detailed explanation, see reference.

C2

Additional parameter for automatic binning. For more detailed explanation, see reference.

...

Arguments to be passed to methods.

References

Lavielle, M. and Bleakley, K. (2011). Automatic data binning for improved visual diagnosis of pharmacometric models. Journal of pharmacokinetics and pharmacodynamics, 38(6), 861-871.

Examples

Run this code
# \donttest{
data(origdata)
optK(origdata$TIME)
# }

Run the code above in your browser using DataLab