## 3 Results  
### Working Examples: Fitting Finite Mixture Models to Lifespan Datasets  
The fitmixEM function fits lifespan datasets (in the case of yeast cells, this would be the replicative lifespan of a given genetic background) utilizing a finite mixture model in the form of fitmixEM (lifespan, model, \(\kappa\), initial = FALSE, starts)  
The lifespan argument denotes genotype backgrounds, strains, or single-gene-deletion strains of lifespan data of dividing cells in the context of RLS; otherwise, it can represent survival time until death, failure, divorce, or relapse. The initial argument depends on the choice of the user, either FALSE or TRUE. If the argument is assigned to FALSE, a value would not set for the starts argument by default. The user must define a vector of (\(\omega\), \(\alpha\), \(\beta\)) starting values, which should be assigned to starts. The three-length vector is of \(\kappa=1,\ \cdots,\mathrm{g}\) number of parameters of a given mixture model with the parts weight \(\omega_{\kappa}\) of the \(\kappa\)th component, \(\alpha_{\kappa}\) shape, and \(\beta_{\kappa}\) scale or rate parameters of a specified model argument of the \(\kappa\)th component when initial is set to TRUE. ```
fitmixEM(sir2,\"gompertz\", 2, initial=FALSE)
```  
```
1 Sestimate weight alpha beta [1,] 0.2700433 0.11108744 0.012783142 [2,] 0.7299567 0.07521764 0.001552122
```  
$measures AIC BIC KS log.likelihood [1,] 929.3526 942.7168 0.1048381 -459.6763 $cluster [1] 1 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 1 1 2 2 2 1 2 1 2 1 1 2 2 [37] 2 2 2 2 2 2 1 2 2 2 2 2 2 1 2 1 1 1 1 1 2 2 2 1 1 2 2 2 2 2 [73] 2 2 2 1 2 2 2 2 2 1 2 1 1 2 2 2 1 1 1 1 2 1 2 1 2 1 2 1 ```
As is previously employed in the other probability density functions (PDFs) in R studio, the first output is a vector called estimate that includes the estimated parameters of the finite mixture model (weight, alpha, beta) which correspond to weight, shape, and scale parameters, respectively. The second unit (i.e., measures) includes Akaike Information Criterion (AIC), Bayesian Information Criterion (BIC), Kolmogorov-Smirnov (KS), and log-likelihood (log.likelihood) statistics of four goodness-of-fit measures. Finally, the third unit (i.e., cluster) is the clustering employed by the k-means clustering method. As a demonstration, the code below estimates sir2, single-gene deletion mutant replicative lifespan from a two-parameter \"Gompertz\" mixture model, and presents the distribution of lifespan in Figure 1. The mutant sir2 genetic background has \"MATalpha\" mating type, media as \"YPD\" reference single deletion mutants under the temperature 30 \({}^{\circ}\)C. Relevant descriptive statistical measurements are as the following:
```
> sir2*sir2 RLS
53111111344231513262033294
25352541273313818272726
3>summary(sir2)#summaryofthestatisticalvalues Min.lstQu.MedianMean3 rdQu.Max. 1.003.005.0012.4925.5041.00
3>sd(sir2)#standarddeviation
12.54726
```
hist(sir2,xlab=\"numberofdaughtersRLS,sir2\",col=\"grey\",breaks=5,las=1,freq=FALSE,ylim=c(0,0.08),) lines(density(sir2),las=1,col=\"blue\") x<-sapply(1:2,plot.gompertz.components,mixture=dfsir2) legend(\"topright\",c(\"lifespan\",\"pdf\",\"Rompertz.mixture\"), col=c(\"grey\",\"blue\",\"darkred\"),lwd=1,cex=0.75)
```
### Distribution Functions for Finite Mixture Models

Similar to classic survival functions in R studio for studying standard probability distributions, we present functions for the computation of the density function dmix, distribution function pmix, and randomly generated rmix vector of values of the finite mixture distributions utilized in **fitmix** package. The mixture functions presented in **fitmix** are in the following forms:
```
dmix(lifespan,model,k,par) pmix(lifespan,model,k,par) rmix(M,model,k,par)
```

where lifespan is a vector of samples (realizations). The model argument is a character string available as PDFs of Gompertz (\"gompertz\"), Log-logistic (\"Log-logistic \"), Log-normal (\"Log-normal\"), and Weibull (\"weibull\") models indicating the distributions which are employed to fit lifespan data.