Learn R Programming

estimators (version 0.7.3)

dmgamma: The Multivariate Gamma Distribution

Description

Density function and random generation for the Multivariate Gamma distribution with shape parameter vector shape and scale parameter scale.

Usage

dmgamma(x, shape, scale, log = FALSE)

rmgamma(n, shape, scale)

Value

dmgamma returns a numeric vector (the evaluated density function). rmgamma returns a matrix with length(shape) rows and n columns.

Arguments

x

numeric. The quantile vector.

shape

numeric. The shape parameter vector.

scale

numeric. The scale parameter vector.

log

logical. If TRUE, probabilities p are given as log(p).

n

numeric. The number of observations.

Examples

Run this code
# Classic R Stats Format
dmgamma(c(4, 6), shape = c(2, 3), scale = 2)
set.seed(1)
rmgamma(10, shape = c(2, 3), scale = 2)

# S4 Distribution Class
library(distr)
D <- MGamma(shape = c(2, 3), scale = 2)
d(D)(c(4, 6))
set.seed(1)
r(D)(10)

Run the code above in your browser using DataLab