acope3 / RibModelFramework

1 stars 14 forks source link

Add priors for all parameters and make defining these priors more flexible #394

Open acope3 opened 1 year ago

acope3 commented 1 year ago

Currently, some of the parameters ($\Delta\eta$, $s_{\phi}$) in our models have improper priors (i.e. a uniform defined on $(-\infty,\infty)$). I would like to ensure all models' parameters have proper priors and there is some flexibility in how these are implemented. The prior for $\Delta\mathit{M}$ is a good example.

Here are my thoughts,

1) $\Delta\eta$ (ROC), $\Delta\omega$ (FONSE) - Normal distribution prior (same as $\Delta\mathit{M}$) 2) $s_{\phi}$ - Half-Cauchy 3) $\alpha$ (PA, PANSE) - uniform, Half-Cauchy 4) $\lambda$ (PANSE) - uniform, Half-Cauchy 5) $Z/Y$ (PANSE) - Half-Cauchy (Note: Y is the total number of reads here, but should make values closer to 0) 6) $\lambda'$ (PA) - uniform, Half-Cauchy 7) NSE Rates (PANSE) -- uniform (log-scale), uniform (natural scale), exponential distribution

mikegilchrist commented 1 year ago

In general, I suggest we follow the suggestions from the stan team and point you to (https://github.com/stan-dev/stan/wiki/Prior-Choice-Recommendations). My reading is that they recommend using a gamma rather than a 1/2 Cauchy (which is always maximal at 0) for variables bounded to the positive reals. If my understanding is correct, I'd recommend using the gamma instead of the 1/2 cauchy or exponential. On a more minor point, I recommend a multivariate normal for codon specific parameters ($\Delta M, \Delta \eta$), as I recall $\Delta \omega$ is an odds ratio, so we might want to treat that one differently.

Also to be clear, most of the parameters constrained to be positive are proposed on the log scale. I'm assuming, however, that these priors will be implemented on the natural scale. Is this assumption correct?

Finally, is this the smartest approach? Might we be better off to implement the models using rstan and brms which can autogenerate stan code for logistic and other forms of regression?

mikegilchrist commented 5 months ago

I have implemented (but not rigourously tested) allowing us to add priors to to dEta in essentially the same way they are implemented for dM.