stephens999 / ashr

An R package for adaptive shrinkage
GNU General Public License v3.0
79 stars 35 forks source link

Bug in autoselect.mixsd for halfuniform, halfnormal #95

Closed willwerscheid closed 5 years ago

willwerscheid commented 5 years ago

Try for example ash(1:10, 1, mixcompdist = "halfnormal", grange=c(-0.1, 20)). We set sigmaamax = min(max(abs(grange-mode)), sigmaamax) so both the positive and negative components of g are capped at 0.1. I have not yet looked carefully, but I think we can remove the handling of grange from autoselect.mixsd and let gconstrain take care of it.

willwerscheid commented 5 years ago

It looks like code for halfnormal has not been added to constrain_mix yet. When updating, we should probably handle the case where pi is all zeros after truncating. Also I am not sure why pi is passed in along with g instead of just using g$pi.