Learn R Programming

GMCM (version 1.4)

rtheta: Get random parameters for the Gaussian mixture (copula) model

Description

Generate a random set parameters for the Gaussian mixture model (GMM) and Gaussian mixture copula model (GMCM). Primarily, it provides an easy prototype of the theta-format used in GMCM.

Usage

rtheta(m = 3, d = 2, method = c("old", "EqualSpherical",
  "UnequalSpherical", "EqualEllipsoidal", "UnequalEllipsoidal"))

Arguments

m

The number of components in the mixture.

d

The dimension of the mixture distribution.

method

The method by which the theta should be generated. See details. Defaults to "old" which is the regular "old" behavior.

Value

A named list of parameters with the 4 elements:

m

An integer giving the number of components in the mixture. Default is 3.

d

An integer giving the dimension of the mixture distribution. Default is 2.

pie

A numeric vector of length m of mixture proportions between 0 and 1 which sums to one.

mu

A list of length m of numeric vectors of length d for each component.

sigma

A list of length m of variance-covariance matrices (of size d times d) for each component.

Details

Depending on the method argument the parameters are generated as follows. The new behavior is inspired by the simulation scenarios in Friedman (1989) but not exactly the same.

  • pie is generated by \(m\) draws of a chi-squared distribution with \(3m\) degrees of freedom divided by their sum. If method = "old" the uniform distribution is used instead.

  • mu is generated by \(m\) i.i.d. \(d\)-dimensional zero-mean normal vectors with covariance matrix 100I. (unchanged from the old behavior)

  • sigma is dependent on method. The covariance matrices for each component are generated as follows. If the method is

    • "EqualSpherical", then the covariance matrices are the identity matrix and thus are all equal and spherical.

    • "UnequalSpherical", then the covariance matrices are scaled identity matrices. In component \(h\), the covariance matrix is \(hI\)

    • "EqualEllipsoidal", then highly elliptical covariance matrices which equal for all components are used. The square root of the \(d\) eigenvalues are chosen equidistantly on the interval \(10\) to \(1\) and a randomly (uniformly) oriented orthonormal basis is chosen and used for all components.

    • "UnqualEllipsoidal", then highly elliptical covariance matrices different for all components are used. The eigenvalues of the covariance matrices equal as in all components as in "EqualEllipsoidal". However, they are all randomly (uniformly) oriented (unlike as described in Friedman (1989)).

    • "old", then the old behavior is used. The old behavior differs from "EqualEllipsoidal" by using the absolute value of \(d\) zero-mean i.i.d. normal eigenvalues with a standard deviation of 8.

    In all cases, the orientation is selected uniformly.

References

Friedman, Jerome H. "Regularized discriminant analysis." Journal of the American statistical association 84.405 (1989): 165-175.

See Also

is.theta

Examples

Run this code
# NOT RUN {
rtheta()

rtheta(d = 5, m = 2)

rtheta(d = 3, m = 2, method = "EqualEllipsoidal")

test <- rtheta()
is.theta(test)

summary(test)
print(test)
plot(test)

# }
# NOT RUN {
A <- SimulateGMMData(n = 100, rtheta(d = 2, method = "EqualSpherical"))
plot(A$z, col = A$K, pch = A$K, asp = 1)
B <- SimulateGMMData(n = 100, rtheta(d = 2, method = "UnequalSpherical"))
plot(B$z, col = B$K, pch = B$K, asp = 1)
C <- SimulateGMMData(n = 100, rtheta(d = 2, method = "EqualEllipsoidal"))
plot(C$z, col = C$K, pch = C$K, asp = 1)
D <- SimulateGMMData(n = 100, rtheta(d = 2, method = "UnequalEllipsoidal"))
plot(D$z, col = D$K, pch = D$K, asp = 1)
# }

Run the code above in your browser using DataLab