MBGR: Mixture of Bivariate Gamma Clustering/Regressions

Description Usage Arguments Value Examples

View source: R/MBGR.R

Description

Mixture of bivariate gamma regressions, or model-based clustering with bivariage gamma distributions and covariates, for various parsimonious model types. Models are estimated by EM algorithm.

Usage

1
2
3
MBGR(modelName = c("VC", "VI", "VV", "VE", "CV", "IV", "EV", "EC", "CE"),
  y, data, G, f1, f2, f3, f4, gating, initialization = "mclust",
  maxit = 200, tol = 1e-05, verbose = TRUE)

Arguments

modelName

A character string indicating which model to be fitted. Need to be one of "EE", "EI", "IE".

y

A vector of character strings indicating which variables in the data are treated as response or dependent variables.

data

A matrix or data frame of observations. Categorical variables are allowed as covariates.

G

An interger vector specifying the number of mixture components (clusters).

f1

A regression formula for the α_1 parameter in the bivariate gamma distribution. Note that, depending on the model type, might not be necessary to provide it.

f2

A regression formula for the α_2 parameter in the bivariate gamma distribution. Note that, depending on the model type, might not be necessary to provide it.

f3

A regression formula for the α_3 parameter in the bivariate gamma distribution. Note that, depending on the model type, might not be necessary to provide it.

f4

A regression formula for the β parameter in the bivariate gamma distribution. Note that, depending on the model type, might not be necessary to provide it.

gating

Specifies the gating network in the MoE model, can be "C", "E" or a regression formula.

initialization

Specifies initialization method for EM algorithm. The default is "mclust".

maxit

A parameter that controls the number of maximum iteration in the EM algorithm. The default is 100.

tol

A parameter that controls the convergence tolerance in the EM algorithm. The default is 1e-5.

verbose

A logical controlling whether estimations in each EM iteration are shown in the fitting process. The default is TRUE.

Value

An object of class BGR providing the estimation results. The details of the output components are:

call

The matched call.

expert.coef

The estimated coefficients in the expert network, if exists.

gating.coef

The estimated coefficients in the gating network, if exists.

alpha1

The estimated alpha1 values.

alpha2

The estimated alpha2 values.

alpha3

The estimated alpha3 values.

beta

The estimated beta values.

pro

A vector whose g-th component is the mixing proportion for the g-th component of the mixture model.

z

A matrix whose [i,g]-th entry is the probability that observation i in the data belongs to the g-th group.

class

The classification corresponding to z.

fitted.values

The fitted values of the regression.

residuals

The residuals of the regression

loglike

The final estimated maximum log-likelihood value.

ll

The sequence of log-likelihood values in the EM algorithm fitting process.

df

The number of estimated parameters.

AIC

AIC values.

BIC

BIC values.

Hessian

The Hessian matrix at the estimated values

iter

Total iteration numbers.

formula

The formulas used in the regression.

y

The input response data.

n

The number of observations in the data.

gating.model

The binomial/multinomial regression model in the gating network.

Model.Matrix

The used model matrix for each regression formula.

Examples

1
2
3
4
5
6
7
8
m1 <- MBGR(modelName = "VV",
           y=c("y1","y2"), data = fullsim, G=2,
           f1     = ~ w1 + w2,
           f2     = ~ w2 + w3,
           f3     = ~ w1 + w2 + w3,
           f4     = ~ w1 + w2 + w3,
           gating = "C",
           verbose = FALSE)

senhu/mvClaim documentation built on Jan. 29, 2022, 3:18 p.m.