Learn R Programming

CensMixReg (version 3.1)

rmmixcr: Random multivariate Finite Mixture Censored generator

Description

Random generator of multivariate FM-SMSN distributions.

Usage

rmmixcr(n, pii, mu, Sigma, shape, nu, percCensu, family)

Arguments

n

number of observations

pii

a vector of weights for the mixture (dimension of the number g of clusters). Must sum to one!

mu

a list of g lists with each list containing the necessary parameters of the selected family

Sigma

a list of g arguments of matrices of initial values (dimension pxp) for the scale parameters.

shape

a list of g arguments of vectors of initial values (dimension p)for the skewness parameters.

nu

nu it's degrees of freedom.

percCensu

Matrix of censoring indicators. For each observation: 0 if non-censored, 1 if censored.

family

distribution family to be used in fitting ("t", "Skew.t", "Skew.slash", "Skew.normal", "Normal")

See Also

smsn.mmix

Examples

Run this code
# NOT RUN {
mu          <- Sigma <- shape <- family <- list()
mu[[1]]     <- c(-3,-1)
mu[[2]]     <- c(2,3)
Sigma[[1]]  <- matrix(c(8,1,1,5.5), 2,2)
Sigma[[2]]  <- matrix(c(2,1,1,2.5), 2,2)
family[[1]] <- "Skew.t"
family[[2]] <- "Skew.normal"
shape[[1]]  <- c(4,5)
shape[[2]]  <- c(1,1)
nu          <- c(3,3)
pii         <- c(0.65,0.35)
percCensu   <- c(0.15,0.15)

data        <- rmmixcr(100, pii , mu , Sigma, shape, nu, percCensu, family)
# }

Run the code above in your browser using DataLab