# mvweisd: The Multivariate Weibull (Shape-Decay) Distribution In lcmix: Layered and chained mixture models

## Description

Density and random generation functions for the multivariate Weibull (Shape-Decay) distribution constructed using a normal (Gaussian) copula.

## Usage

 ```1 2``` ```dmvweisd(x, shape, decay, corr=diag(ncol(x)), log=FALSE) rmvweisd(n, shape=1, decay=1, corr=diag(length(shape))) ```

## Arguments

 `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 `x`. If `length(shape) < ncol(x)`, the elements of `shape` will be recycled. If `length(shape) > ncol(x)`, the `shape` vector will be truncated and a warning given. `decay` a vector of decay parameters for the marginal distributions of the columns of `x`. If `length(decay) < ncol(x)`, the elements of `decay` will be recycled. If `length(decay) > ncol(x)`, the `decay` vector will be truncated and a warning given. `corr` the correlation matrix. See Details. `log` logical; if `TRUE`, density is given as the log-density. `n` number of vectors to simulate.

## Details

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 shape-decay parameterization of the Weibull 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.

## Value

For `dmvweisd`, a vector of densities. For `rmvweisd`, a vector with `n` rows and `ncol(corr)` columns representing a sample from the multivariate Weibull (shape-decay) distribution with the specified parameters.

Daniel Dvorkin

## References

Song, P. (2000) Multivariate dispersion models generated from Gaussian copula. Scandinavian Journal of Statistics 27, 305–320.

`weisd` for the underlying univariate distribution; `mvnorm`, `mvgamma` for related distributions; `thetahat` for parameter estimation.
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18``` ```set.seed(123) s <- 1:2 d <- 2:3 rho <- matrix(c(1, 0.5, 0.5, 1), ncol=2) x <- rmvweisd(5, s, d, rho) print(x) # [,1] [,2] # [1,] 0.1600585 0.3834426 # [2,] 1.3762076 0.6174464 # [3,] 0.6280634 1.0148760 # [4,] 0.3958020 0.2199443 # [5,] 0.1229824 0.3249533 dmvweisd(x, s, d, rho) # [1] 2.6471540 0.1836727 0.2035865 0.8923407 2.9891143 ```