edward130603 / BayesSpace

Bayesian model for clustering and enhancing the resolution of spatial gene expression experiments.
http://edward130603.github.io/BayesSpace
Other
96 stars 20 forks source link

code and Supplementary information are incoherence #115

Open usst-hzf opened 10 months ago

usst-hzf commented 10 months ago

RCPP:EXPORT iterate_deconv function in program code. When updating mu, Yrows.each_col()%=w(index_1k) , shouldn't it be multiply by w? How come it becomes a remainder, it should be Yrows.each_col()*=w(index_1k)

edward130603 commented 10 months ago

In c++, % is the element-wise matrix multiplication operator, while * is for regular matrix multiplication.

usst-hzf commented 10 months ago

OK,Thanks. I have one more question.

In Updata z and w,Parameters of the gamma distribution: w_beta is 2/(Y.row-mu_i_long) lambda (Y.row-mu_i_long).t()+4) in code. But w_beta is (Y.row-mu_i_long).t() lambda (Y.row-mu_i_long)+4)/2 in supplementary infomation.

edward130603 commented 10 months ago

There are 2 parameterizations of the gamma distribution: https://en.wikipedia.org/wiki/Gamma_distribution

In Bayesian statistics, we typically use $\alpha$ and $\beta$, but the R function we used had the other parameterization, where $\theta = 1/\beta$.

usst-hzf commented 10 months ago

Thanks!