Closed James-Thorson-NOAA closed 4 months ago
Thanks!! Is it obvious what the distribution function would be? I.e. the equivalent of pgamma here so the quantile residuals work?
Also, I assume Q / lambda is the most intuitive parameter to report in print()
rather than a derived version? As noted in the comments, the distribution approaches lognormal as Q -> 0.
Model fit by ML ['sdmTMB']
Formula: density ~ 1 + depth_scaled
Data: d
Family: gengamma(link = 'log')
coef.est coef.se
(Intercept) 4.52 0.11
depth_scaled 0.20 0.11
Dispersion parameter: 1.41
Generalized gamma Q: 0.04
ML criterion at convergence: 2348.525
Just noting for myself that there are some helpful examples here, which could be reparameterized for the Prentice version. Plus a bunch of implementations on CRAN to check against. First example https://search.r-project.org/CRAN/refmans/flexsurv/html/GenGamma.html
Actually, I just realized it's the Prentice parameterization used in the flexsurv package already, so we can either import that pgengamma or use an open-source code snippet. https://search.r-project.org/CRAN/refmans/flexsurv/html/GenGamma.html
Adding generalized-gamma distribution.
See test below, where the gengamma distribution results in gengamma_Q close to 0, i.e., collapsing to the lognormal distribution, and AIC confirms that it fits with slightly less than 2 AIC higher than the lognormal.