Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with standard priors for Gompertz model #51

Open
OBaerenbold-Lumanity opened this issue Nov 1, 2022 · 3 comments
Open

Issue with standard priors for Gompertz model #51

OBaerenbold-Lumanity opened this issue Nov 1, 2022 · 3 comments

Comments

@OBaerenbold-Lumanity
Copy link

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

@giabaio
Copy link
Owner

giabaio commented Nov 2, 2022

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!

@OBaerenbold-Lumanity
Copy link
Author

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?

@giabaio
Copy link
Owner

giabaio commented Nov 2, 2022

Yes. The refactored version is 2.0.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants