marginal.mixture: Marginal distribution of a mixture.

View source: R/mixture.R

marginal.mixtureR Documentation

Marginal distribution of a mixture.

Description

The marginal of a mixture is itself a mixture of the component marginals with the same mixing weights: p(x_I) = \sum_k w_k p_k(x_I).

Usage

## S3 method for class 'mixture'
marginal(x, indices)

Arguments

x

A mixture object.

indices

Integer vector of variable indices to keep.

Details

Requires all components to support marginal.

Value

A mixture object with marginalized components.

Examples

# Mixture of bivariate normals, extract marginal over first variable
m <- mixture(
  list(mvn(c(0, 0), diag(2)), mvn(c(3, 3), diag(2))),
  c(0.5, 0.5)
)
m1 <- marginal(m, 1)
mean(m1)

algebraic.dist documentation built on Feb. 27, 2026, 5:06 p.m.