Fit the specified multivariate discrete distribution.
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
)
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.
an optional vector of initial value of the parameter estimates. Should have the same dimension as the estimated parameters. See dist
for details.
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.
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
.
an optional number controlling the maximum number of iterations. The default value is maxiters=150
.
an optional logical variable controlling the display of iterations. The default value is FALSE.
a description of the distribution to fit. Choose from "MN"
, "DM"
, "GDM"
, "NegMN"
. See dist
for details.
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.
See dist
for details about model parameterization.
# NOT RUN {
data(rnaseq)
Y <- as.matrix(rnaseq[, 1:6])
fit <- MGLMfit(data=Y, dist="GDM")
# }
Run the code above in your browser using DataLab