Density and random generation for the vine copula based mixture model distributions.

dvcmm(x, margin, margin_pars, RVMs, mix_probs)

rvcmm(dims, obs, margin, margin_pars, RVMs)

Arguments

x

A vector of length d or a d-column matrix for evaluation points, where d is the number of variables (p)

margin

A matrix, containing the name of univariate marginal distributions in each component as given in vcmm. Rows correspond to variable, columns correspond to component.

margin_pars

An array, specifying the univariate marginal distributions' parameters in each component. First, second, third dimensions specify the parameter, variable, component, respectively.

RVMs

A list, containing the R-vine copula model of each component. RVineMatrix describes the encoding of a R-vine copula model.

mix_probs

A vector of length k (number of components), containing mixture proportion of each component

dims

An integer, specifying the number of variables

obs

A vector, containing number of observations of each component (sum(obs) = i)

Value

dvcmm() returns the density, and rvcmm() returns random deviates.

Examples

# Generate data with 3 variables from a vine copula based mixture model # with 2 components, the first/second component has 300/600 observations. dims <- 3 obs <- c(300,600) RVMs <- list() RVMs[[1]] <- VineCopula::RVineMatrix(Matrix=matrix(c(1,3,2,0,3,2,0,0,2),dims,dims), family=matrix(c(0,3,4,0,0,14,0,0,0),dims,dims), par=matrix(c(0,0.5,2.5,0,0,5,0,0,0),dims,dims), par2=matrix(sample(0, dims*dims, replace=TRUE),dims,dims)) RVMs[[2]] <- VineCopula::RVineMatrix(Matrix=matrix(c(1,3,2,0,3,2,0,0,2), dims,dims), family=matrix(c(0,6,5,0,0,13,0,0,0), dims,dims), par=matrix(c(0,2,14,0,0,1,0,0,0),dims,dims), par2=matrix(sample(0, dims*dims, replace=TRUE),dims,dims)) margin <- matrix(c('Normal', 'Gamma', 'Lognormal', 'Lognormal', 'Normal', 'Student-t'), 3, 2) margin_pars <- array(0, dim=c(4, 3, 2)) margin_pars[,1,1] <- c(1, 2, 0, 0) margin_pars[,1,2] <- c(1.5, 0.4, 0, 0) margin_pars[,2,1] <- c(1, 0.2, 0, 0) margin_pars[,2,2] <- c(18, 5, 0, 0) margin_pars[,3,1] <- c(0.8, 0.8, 0, 0) margin_pars[,3,2] <- c(4, 2, 5, 0) x_data <- rvcmm(dims, obs, margin, margin_pars, RVMs)