Skip to contents

Evaluates \(\varphi_g(t) = \sum_k w_k \exp(i t^\top \mu_k - t^\top \Sigma_k t / 2)\) at each row of t. Here cf stands for characteristic function; in gmm_cf_mean(), gmm_cf_variance() and gmm_cf_tail_prob() it stands for counterfactual.

Usage

gmm_cf(g, t)

Arguments

g

A gmm or gmm_fit.

t

Numeric matrix of frequencies with one frequency per row and as many columns as the mixture has dimensions. A vector is read as one frequency per element for a one-dimensional mixture and as a single frequency otherwise.

Value

A complex vector with one value for each row of t.

Examples

g <- gmm(
  weights = c(0.3, 0.7),
  means = list(c(0, 0), c(2, 1)),
  covariances = list(diag(2), 0.5 * diag(2))
)
gmm_cf(g, rbind(c(0, 0), c(0.5, -1)))
#> [1] 1.0000000+0i 0.6727094+0i