survHE icon indicating copy to clipboard operation
survHE copied to clipboard

Issue with standard priors for Gompertz model

Open OBaerenbold-Lumanity opened this issue 3 years ago • 3 comments

Hi Gianluca,

Thanks for the great package!

There appears to be an issue with the standard priors for the Gompertz model in version 1.1.2. Line 307 and following in utils_fit_models.R and line 57 in Gompertz.stan define the prior for alpha as Gamma(0,5) which causes an error in Stan due to the shape parameter needing to be strictly greater than 0.

I suspect either line 328 should include "gom" while line 330 shouldn't which leads to a Gamma(0.1,0.1) prior, or alternatively alpha is supposed to be unrestricted and have a Normal(0,5) prior. As a quick fix I currently just run fit.models with 'priors=list("gompertz"=list(a_alpha=0.1,b_alpha=0.1))' instead.

Best, Oliver

OBaerenbold-Lumanity avatar Nov 01 '22 13:11 OBaerenbold-Lumanity

Thank you for this. Are you on the most recent version of survHE? I have made some substantial refactoring a while back (see here) and have split the package into 3 separate bits. If you install the version on the devel branch of this GitHub repo, you get the frequentist version of the models (+ the basic plotting/printing/summary etc). If you want to do the HCM analysis, you need to install separately the module survHEhmc (from the relevant branch).

If you look at line 228 of https://github.com/giabaio/survHE/blob/hmc/R/runHMC.R, you can see that the prior for the Gompertz model is fixed and correct...

Your proposed solution also would work --- but I would advice switching to the most recent version. Hope this helps!

giabaio avatar Nov 02 '22 14:11 giabaio

Thanks, that's very helpful! I'll give it a try.

Just to understand: The version on CRAN (1.1.2) is the main branch on the repository and the refactored version is split onto the three branches as described in your linked blog?

OBaerenbold-Lumanity avatar Nov 02 '22 15:11 OBaerenbold-Lumanity

Yes. The refactored version is 2.0.

Thanks

giabaio avatar Nov 02 '22 15:11 giabaio