Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

gmgm (version 1.1.2)

expectation: Compute expectations of a Gaussian mixture model

Description

This function computes expectations of a Gaussian mixture model.

Usage

expectation(gmm, data_x = NULL)

Value

A numeric matrix containing the expectations.

Arguments

gmm

An object of class gmm.

data_x

A data frame or numeric matrix containing observations of the explanatory variables if conditional expectations are computed. Its columns must explicitly be named after the explanatory variables. If NULL (the default), the joint expectation is computed in a one-row matrix.

See Also

density, sampling

Examples

Run this code
data(gmm_body, data_body)
expect_1 <- expectation(gmm_body)
expect_2 <- expectation(gmm_body,
                        data_body[, c("WEIGHT", "FAT", "HEIGHT", "AGE")])

Run the code above in your browser using DataLab