Hi there,
I am confused about the way to deal with log(po) in the single_effect_regression() function.
# log(po) = log(BF * prior) for each SNP
lbf = dnorm(betahat,0,sqrt(V + shat2),log = TRUE) -
dnorm(betahat,0,sqrt(shat2),log = TRUE)
lpo = lbf + log(prior_weights + sqrt(.Machine$double.eps))
# Deal with special case of infinite shat2 (e.g., happens if X does
# not vary).
lbf[is.infinite(shat2)] = 0
lpo[is.infinite(shat2)] = 0
maxlpo = max(lpo)
I'm not sure if it's my misunderstanding. In the special case of infinite shat2, why lpo[is.infinite(shat2)] is set to 0, not log(prior_weights + sqrt(.Machine$double.eps))? If we specify null_weight , the corresponding column of X will always meet this case, but lpo[is.infinite(shat2)] = 0 implies that the prior weight is fixed as 1.
Thank you!
Hi there,
I am confused about the way to deal with log(po) in the
single_effect_regression()function.I'm not sure if it's my misunderstanding. In the special case of infinite
shat2, whylpo[is.infinite(shat2)]is set to0, notlog(prior_weights + sqrt(.Machine$double.eps))? If we specifynull_weight, the corresponding column ofXwill always meet this case, butlpo[is.infinite(shat2)] = 0implies that the prior weight is fixed as 1.Thank you!