margin: Marginalization of tensors

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The function removes dimensions from a tensor by summing all entries which only differ in these dimensions.

Usage

1

Arguments

X

the tensor

i

the dimensions to be removed

by

instead of i the dimensions to be kept

Details

This is a tensor multiplication with the 1_i tensor.

Value

The tensor with all elements only differing only in the dimensions specified added up and only the other dimensions left over.

Author(s)

K. Gerald van den Boogaart

See Also

to.tensor

Examples

1
2
3
4
5
6
7
A <- diag(1:5)
A
margin.tensor(A,1)

A <- to.tensor(1:30,dim=c(i=3,j=5,k=2))
ftable(A)
margin.tensor(A,"j")

tensorA documentation built on Nov. 20, 2020, 9:07 a.m.

Related to margin in tensorA...