mean.gmd: Sample Mean for Gaussian Mixture Data

Description Usage Arguments Value Examples

Description

Sample Mean for Gaussian Mixture Data

Usage

1
2
## S3 method for class 'gmd'
mean(x, trim = 0, na.rm = TRUE, K = NULL, rule = 2)

Arguments

x

An object of class gmd.

native

Boolean specyfing whether the resulting mean should be mapped back as a density (default: TRUE) or if its crl-transform should be return instead.

Value

The sample mean of the input Gaussian mixture data in density space (if native==TRUE) or in clr-space otherwise.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
N <- 100
M <- 4
w <- matrix(runif(N * M), N, M)
w <- w / rowSums(w)
s <- tidyr::crossing(
  observation = paste0("O", 1:N),
  component = paste0("C", 1:M)
) %>%
dplyr::mutate(mixing = as.numeric(t(w)))
d <- tibble::tibble(
  component = paste0("C", 1:M),
  mean = numeric(M),
  precision = 1:M
)
x <- gmd(s, d)
mean(x)

astamm/game documentation built on June 5, 2019, 8:53 a.m.