uniform.quantiles: Evenly Spaced Sample Quantiles

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Quantiles corresponding to the uniform distribution of the distribution function of a vector, or of the columns of a matrix or data frame.

Usage

1
uniformQuantiles(X, K, decreasing=TRUE)

Arguments

X

a numeric vector, matrix, or data frame.

K

the number of quantiles.

decreasing

logical; if TRUE, the quantiles are given in descending order.

Details

For a vector x, the kth uniform quantile, for k = 1,…,K, is the sample quantile at q = (k-0.5)/K. In other words, uniformQuantiles(X, K, FALSE)[k] = quantile(X, (k-0.5)/K) if X is a vector. If X is a matrix or data frame, the function is applied to the columns of X.

Value

A vector of quantiles if X is a vector, a matrix of quantiles of the columns of X if X is a matrix or data frame.

Note

uniformQuantiles is used to initialize component means in mixmod and mdmixmod.

Author(s)

Daniel Dvorkin

See Also

mixmod, mdmixmod; quantile in package stats.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(123)

X = matrix(rnorm(300), ncol=3)
uniformQuantiles(X, 5)
#             [,1]       [,2]        [,3]
# [1,]  1.26449867  1.0584323  1.55267383
# [2,]  0.51301442  0.3039516  0.56563159
# [3,]  0.06175631 -0.2258300  0.03591471
# [4,] -0.38719515 -0.6200279 -0.45546412
# [5,] -1.06822046 -1.2894076 -1.02776368

lcmix documentation built on May 31, 2017, 5 a.m.

Search within the lcmix package
Search all R packages, documentation and source code