Description Usage Arguments Details Value Author(s) References See Also Examples
Density and random generation functions for the multivariate gamma distribution constructed using a normal (Gaussian) copula.
1 2 |
x |
a numeric matrix of which each row represents an observation. |
shape |
a vector of shape parameters for the marginal distributions of the columns of |
rate |
a vector of rate parameters for the marginal distributions of the columns of |
corr |
the correlation matrix. See Details. |
log |
logical; if |
n |
number of vectors to simulate. |
The construction of multivariate distributions from univariate marginal distributions using normal copulas is discussed in Song (2000). Briefly, given univariate marginal densities and the corresponding distribution functions (here, the gamma distribution), the standard normal quantiles of the values of the distribution functions follow a multivariate standard normal distribution, that is, a multivariate normal distribution with marginal means of 0 and marginal variances of 1. Thus the covariance matrix is referred to as the correlation matrix in this context.
For dmvgamma
, a vector of densities. For rmvgamma
, a vector with n
rows and ncol(corr)
columns representing a sample from the multivariate gamma distribution with the specified parameters.
Daniel Dvorkin
Song, P. (2000) Multivariate dispersion models generated from Gaussian copula. Scandinavian Journal of Statistics 27, 305–320.
mvnorm
, mvweisd
for related distributions; thetahat
for parameter estimation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(123)
s <- 1:2
r <- 2:3
rho <- matrix(c(1, 0.5, 0.5, 1), ncol=2)
x <- rmvgamma(5, s, r, rho)
print(x)
# [,1] [,2]
# [1,] 0.1600585 0.4178748
# [2,] 1.3762076 0.7846068
# [3,] 0.6280634 1.6192241
# [4,] 0.3958020 0.2131819
# [5,] 0.1229824 0.3399217
dmvgamma(x, s, r, rho)
# [1] 1.92014830 0.10438760 0.08317813 0.79129064 2.32215333
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.