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

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

Arguments

x

The mvn object.

indices

The indices of the marginal distribution to obtain.

Value

A normal (for a single index) or mvn marginal distribution.

Examples

X <- mvn(c(1, 2, 3))
# Univariate marginal
marginal(X, 1)
#> Normal distribution (mu = 1, var = 1) 
# Bivariate marginal
marginal(X, c(1, 3))
#> Multivariate normal distribution (2 dimensions) 
#>   mu:
#> [1] 1 3
#>   sigma:
#>      [,1] [,2]
#> [1,]    1    0
#> [2,]    0    1