Learn R Programming

algebraic.dist (version 0.9.1)

marginal: 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)

Value

A distribution object for the marginal over indices.

Arguments

x

The distribution object.

indices

The indices of the marginal distribution to obtain.

Examples

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

Run the code above in your browser using DataLab