Density, distribution function, and directional quantile approximation for a bivariate Gaussian mixture with four joint states.

dmix2norm(
  x,
  means = matrix(0, 4, 2),
  Sigma = rep(list(diag(1, 2)), 4),
  probs = rep(1/4, 4),
  log = FALSE
)

pmix2norm(
  x,
  means = matrix(0, 4, 2),
  Sigma = rep(list(diag(1, 2)), 4),
  probs = rep(1/4, 4),
  log = FALSE
)

qmix2norm(
  p,
  means = matrix(0, 4, 2),
  Sigma = rep(list(diag(1, 2)), 4),
  probs = rep(1/4, 4),
  v = NULL,
  x0 = c(-1, 1),
  range_s = c(-100, 100),
  log.p = FALSE,
  lower.tail = TRUE
)

Arguments

x

Numeric matrix. Rows are observations and columns are the two locations/components.

means

Numeric matrix of component means.

Sigma

List of variance-covariance matrices.

probs

Numeric vector of joint state probabilities.

log

Logical. If TRUE, dmix2norm() or pmix2norm() returns values on the log scale.

p

Numeric vector of probabilities.

v

Optional numeric direction vector used by qmix2norm().

x0

Numeric reference point used by qmix2norm().

range_s

Numeric vector of length two giving the search interval for the scalar root used by qmix2norm().

log.p

Logical. If TRUE, probabilities are supplied on the log scale.

lower.tail

Logical. If TRUE, probabilities are \(P[X \le x]\); otherwise, \(P[X > x]\).

Value

  • dmix2norm() returns a numeric vector of density values.

  • pmix2norm() returns a numeric vector of probabilities.

  • qmix2norm() returns a numeric matrix of directional quantiles.

Details

Version 1.0.0.

Examples

x <- matrix(c(-1, 0, 0, 1), ncol = 2, byrow = TRUE)
dmix2norm(x)
#> [1] 0.09653235 0.09653235
pmix2norm(x)
#> [1] 0.07932763 0.42067237
qmix2norm(c(0.25, 0.75))
#>            [,1]     [,2]
#> [1,] -0.6060727 1.393927
#> [2,]  0.6831531 2.683153