MGLMfit: Fit multivariate discrete distributions

View source: R/MGLMfit.R

DMD.DM.fitR Documentation

Fit multivariate discrete distributions

Description

Fit the specified multivariate discrete distribution.

Usage

DMD.DM.fit(
  data,
  init,
  weight,
  epsilon = 1e-08,
  maxiters = 150,
  display = FALSE
)

DMD.GDM.fit(
  data,
  init,
  weight,
  epsilon = 1e-08,
  maxiters = 150,
  display = FALSE
)

DMD.NegMN.fit(
  data,
  init,
  weight,
  epsilon = 1e-08,
  maxiters = 150,
  display = FALSE
)

MGLMfit(
  data,
  dist,
  init,
  weight,
  epsilon = 1e-08,
  maxiters = 150,
  display = FALSE
)

Arguments

data

a data frame or matrix containing the count data. Rows of the matrix represent observations and columns are the categories. Rows and columns of all zeros are automatically removed.

init

an optional vector of initial value of the parameter estimates. Should have the same dimension as the estimated parameters. See dist for details.

weight

an optional vector of weights assigned to each row of the data. Should be Null or a numeric vector with the length equal to the number of rows of data. If weight=NULL, equal weights of all ones will be assigned.

epsilon

an optional numeric controlling the stopping criterion. The algorithm terminates when the relative change in the log-likelihoods of two successive iterates is less than epsilon. The default value is epsilon=1e-8.

maxiters

an optional number controlling the maximum number of iterations. The default value is maxiters=150.

display

an optional logical variable controlling the display of iterations. The default value is FALSE.

dist

a description of the distribution to fit. Choose from "MN", "DM", "GDM", "NegMN". See dist for details.

Details

See dist for details about model parameterization.

Value

Returns an object of S4 class "MGLMfit". An object of class "MGLMfit" is a list containing at least the following components:

  • estimate the vector of the distribution prameter estimates.

  • SE the vector of standard errors of the estimates.

  • vcov the variance-covariance matrix of the estimates.

  • logL the loglikelihood value.

  • iter the number of iterations used.

  • BIC Bayesian information criterion.

  • AIC Akaike information criterion.

  • distribution the distribution fitted.

  • LRT when dist="DM" or "GDM", it is the likelihood ratio test statistic for comparing the current model to the multinomial model. No LRT provided when dist="NegMN".

  • LRTpvalue the likelihood ratio test P value.

  • gradient the gradient at the estimated parameter values.

  • DoF the degrees of freedom of the model.

Author(s)

Yiwen Zhang and Hua Zhou

Examples

data(rnaseq)
Y <- as.matrix(rnaseq[, 1:6])
fit <- MGLMfit(data=Y, dist="GDM") 



MGLM documentation built on April 14, 2022, 1:07 a.m.