fitmixturegrouped {ForestFit} | R Documentation |
Estimating parameters of the well-known mixture models fitted to the grouped data
Description
Estimates parameters of the gamma, log-normal, and Weibull mixture models fitted to the grouped data using the expectation maximization (EM) algorithm. General form for the cdf of a statistical mixture model is given by
where , is the whole parameter vector,
for
is the parameter space of the
-th component, i.e.
,
is the cdf of the
-th component, and known constant
is the number of components. Parameters
and
are the shape and scale parameters. The constants
s sum to one, i.e.
. The families considered for the cdf
include Gamma, Log-normal, and Weibull. If a sample of
independent observations each follows a distribution with cdf
have been divided into
separate groups of the form
, for
. So, the likelihood function of the observed data is given by
where
in which denotes the pdf of the
-th component. Using the the EM algorithm proposed by Dempster et al. (1977), we can solve
by introducing two new missing variables.
Usage
fitmixturegrouped(family, r, f, K, initial=FALSE, starts)
Arguments
family |
Name of the family including: " |
r |
A numeric vector of length |
f |
A numeric vector of length |
K |
Number of components. |
initial |
The sequence of initial values including |
starts |
If |
Details
Identifiability of the mixture models supposed to be held. For skew-normal mixture model the parameter vector of -th component gets the form
where
and
denote the location, scale, and skewness parameters, respectively.
Value
The output has two parts, The first part includes vector of estimated weight, shape, and scale parameters.
A sequence of goodness-of-fit measures consist of Akaike Information Criterion (
AIC
), Consistent Akaike Information Criterion (CAIC
), Bayesian Information Criterion (BIC
), Hannan-Quinn information criterion (HQIC
), Anderson-Darling (AD
), Cram\'eer-von Misses (CVM
), Kolmogorov-Smirnov (KS
), and log-likelihood (log-likelihood
) statistics.
Author(s)
Mahdi Teimouri
References
G. J. McLachlan and P. N. Jones, 1988. Fitting mixture models to grouped and truncated data via the EM algorithm, Biometrics, 44, 571-578
Examples
n<-50
K<-2
m<-10
weight<-c(0.3,0.7)
alpha<-c(1,2)
beta<-c(2,1)
param<-c(weight,alpha,beta)
data<-rmixture(n, "weibull", K, param)
r<-seq(min(data),max(data),length=m+1)
D<-data.frame(table(cut(data,r,labels=NULL,include.lowest=TRUE,right=FALSE,dig.lab=4)))
f<-D$Freq
fitmixturegrouped("weibull",r,f,K,initial=FALSE)