Skip to contents

Mvlgamma

Usage

torch_mvlgamma(self, p)

Arguments

self

(Tensor) the tensor to compute the multivariate log-gamma function

p

(int) the number of dimensions

mvlgamma(input, p) -> Tensor

Computes the multivariate log-gamma function <https://en.wikipedia.org/wiki/Multivariate_gamma_function>_) with dimension p element-wise, given by

log(Γp(a))=C+i=1plog(Γ(ai12)) where C=log(π)×p(p1)4 and Γ() is the Gamma function.

All elements must be greater than p12, otherwise an error would be thrown.

Examples

if (torch_is_installed()) {

a = torch_empty(c(2, 3))$uniform_(1, 2)
a
torch_mvlgamma(a, 2)
}
#> torch_tensor
#>  0.4101  0.3927  0.3932
#>  0.3896  0.6576  0.9037
#> [ CPUFloatType{2,3} ]