| Title: | Finite Mixture Model Fitting of Lifespan Datasets |
|---|---|
| Description: | Fits the lifespan datasets of biological systems such as yeast, fruit flies, and other similar biological units with well-known finite mixture models introduced by Farewell et al. (1982) <doi:10.2307/2529885> and Al-Hussaini et al. (2000) <doi:10.1080/00949650008812033>. Estimates parameter space fitting of a lifespan dataset with finite mixtures of parametric distributions. Computes the following tasks; 1) Estimates parameter space of the finite mixture model by implementing the expectation maximization (EM) algorithm. 2) Finds a sequence of four goodness-of-fit measures consist of Akaike Information Criterion (AIC), Bayesian Information Criterion (BIC), Kolmogorov-Smirnov (KS), and log-likelihood (log-likelihood) statistics. 3)The initial values is determined by k-means clustering. |
| Authors: | Emine Guven [aut, cre] (ORCID: <https://orcid.org/0000-0001-9324-0879>), Hong Qin [aut] |
| Maintainer: | Emine Guven <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-05-17 08:07:34 UTC |
| Source: | https://github.com/guven-code/fitmix |
Computing probability density function for the well-known mixture models.
dmix(lifespan, model, K, param)dmix(lifespan, model, K, param)
lifespan |
Vector of samples |
model |
choice of one of the mixture models; |
K |
number of components |
param |
Vector of weight |
A vector of the same length as lifespan data, given the pdf of the one of the mixture models computed at lifespan.
lifespan<-seq(0,30,0.2) K<-2 weight<-c(0.6,0.4) alpha<-c(0.5,1) beta<-c(1,0.5) param<-c(weight,alpha,beta) dmix(lifespan, "log-logistic", K, param)lifespan<-seq(0,30,0.2) K<-2 weight<-c(0.6,0.4) alpha<-c(0.5,1) beta<-c(1,0.5) param<-c(weight,alpha,beta) dmix(lifespan, "log-logistic", K, param)
Fits lifespan data of time units with gompertz, log-logistics, log-normal, and weibull mixture models choice of one.
fitmixEM(lifespan, model, K, initial = FALSE, starts)fitmixEM(lifespan, model, K, initial = FALSE, starts)
lifespan |
numeric vector of lifespan dataset |
model |
model name of the one of the well-known model: |
K |
number of well-known model components. |
initial |
logical true or false |
starts |
numeric if initial sets to true |
Estimates parameters of the given mixture model implementing the expectation maximization (EM) algorithm.
General form for the cdf of a statistical mixture model is given by
a distribution f is a mixture of K component distributions of
if
with
, . This equation is a stochastic model, thus
it allows to generate new data points; first picks a distribution of choice, with
probablities by weight, then generates another observation according to the chosen distribution.
In short represenated by,
Z ~ Mult( and
X|Z ~ f_Z, where Z is a discrete random variable which component X is drawn from.
The families considered for the cdf of Gompertz, Log-normal, Log-logistic, and Weibull.
1.The return has three values; the first value is estimate, measures, and cluster.
2. The second value includes four different measurements of goodness-of-fit tests involving:
Akaike Information Criterion (AIC), Bayesian Information Criterion (BIC), Kolmogorov-Smirnov (KS), and log-likelihood (log.likelihood) statistics.
3. The last value is the output of clustering vector.
Farewell, V. (1982). The Use of Mixture Models for the Analysis of Survival Data with Long-Term Survivors. Biometrics, 38(4), 1041-1046. doi:10.2307/2529885 McLachlan, G. J. and Peel, D. (2000) Finite Mixture Models, John Wiley & Sons, Inc.
Essam K. Al-Hussaini, Gannat R. Al-Dayian & Samia A. Adham (2000) On finite mixture of two-component gompertz lifetime model, Journal of Statistical Computation and Simulation, 67:1, 20-67, DOI: 10.1080/00949650008812033
lifespan<-sample(1000) fitmixEM(lifespan, "weibull", K = 2, initial = FALSE)lifespan<-sample(1000) fitmixEM(lifespan, "weibull", K = 2, initial = FALSE)
Computing cumulative distribution function for the well-known mixture models.
pmix(lifespan, model, K, param)pmix(lifespan, model, K, param)
lifespan |
Vector of samples |
model |
choice of one of the mixture models; |
K |
number of components |
param |
Vector of weight |
A vector of the same length as lifespan data, given the cdf of the one of the mixture models computed at lifespan.
lifespan<-seq(0,30,0.2) K<-2 weight<-c(0.5,0.5) alpha<-c(0.5,1) beta<-c(1,0.5) param<-c(weight,alpha,beta) pmix(lifespan, "log-logistic", K, param)lifespan<-seq(0,30,0.2) K<-2 weight<-c(0.5,0.5) alpha<-c(0.5,1) beta<-c(1,0.5) param<-c(weight,alpha,beta) pmix(lifespan, "log-logistic", K, param)
Random generation for the well-known mixture models with parameters weigth, shape and scale.
rmix(N, model, K, param)rmix(N, model, K, param)
N |
Number of inputs for the mixture random generation |
model |
Choice of one of the mixture models; |
K |
Number of components |
param |
Vector of weight |
Outputs of random generated vector lenght of N from the given mixture model.
N<-100 K<-2 weight<-c(0.5,0.5) alpha<-c(0.5,1) beta<-c(1,0.5) param<-c(weight,alpha,beta) rmix(N, "weibull", K, param)N<-100 K<-2 weight<-c(0.5,0.5) alpha<-c(0.5,1) beta<-c(1,0.5) param<-c(weight,alpha,beta) rmix(N, "weibull", K, param)