marginal: Generic method for obtaining the marginal distribution of a...

View source: R/generic_dist.R

marginalR Documentation

Generic method for obtaining the marginal distribution of a distribution object x over components indices.

Description

Generic method for obtaining the marginal distribution of a distribution object x over components indices.

Usage

marginal(x, indices)

Arguments

x

The distribution object.

indices

The indices of the marginal distribution to obtain.

Value

A distribution object for the marginal over indices.

Examples

x <- mvn(c(0, 0), diag(2))
m <- marginal(x, 1)  # marginal over first component
mean(m)               # 0

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