0

I want to use a mixture of Gamma distribution as a parametric model for survival analysis on censored data using R. In the "flexsurv" package there are different distributions but I couldn't find a Gamma mixture distribution. In that package, it states that:

"Any user-defined parametric distribution can be fitted, given at least an R function defining the probability density or hazard."

https://cran.r-project.org/web/packages/flexsurv/flexsurv.pdf

Is there a way to directly define a Gamma mixture distribution (with a pre-specified number of components) in a parametric way to directly use this package for the maximum likelihood estimation?

data <- Surv(ages, censored)
fit_gammamixture <- flexsurvreg(data~1, dist=???)

I've found this paper regarding survival analysis with a mixture of gamma distributions but it is hard to understand and implement the algorithm presented here.

Modeling Censored Lifetime Data Using a Mixture of Gammas Baseline https://projecteuclid.org/download/pdf_1/euclid.ba/1340371053

NelsonGon
  • 13,015
  • 7
  • 27
  • 57
KRL
  • 195
  • 1
  • 1
  • 5
  • I’m unclear what is required. If you are doing regression analysis of any kind using categorical predictors, you are implicitly modeling a mixture. At the moment you have not given a clear understanding of how you want to go beyond this. – IRTFM May 02 '19 at 14:17
  • @42- We don't have categorical data. For example, I want to fit failure data to the following two component Gamma distribution: $w_1 Gamma(x; a_1, b_1) + w_2 Gamma(x; a_2, b_2)$ where $w_1 + w_2 = 1$. Also, the data are censored. – KRL May 02 '19 at 18:43
  • Generally R functions that support custom distribution require that you define a "family". Presumably the documentation for `pkg:flexsurv` says something about the requirements or a custom function. If it says that a "family" is needed then see: `?family` – IRTFM May 02 '19 at 22:10

0 Answers0