Skip to content

posterior odds value when shat2 is infinite #263

@MapleLin-Bio

Description

@MapleLin-Bio

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions