Contents

  1. Bugs in Code
  2. Error in estimating mu
  3. Final Plots
    • Relative Error Plots
    • 2 CV Plot
    • Using Reference Panel
  4. Difference in nvar
  5. T1D Results
  6. Microbenchmarking
  7. Posterior Probabilities of Null Model
  8. Comments and To Do

1. Bugs in Code


We found a couple of bugs in the code. I have corrected these and re-ran the simulations.

ppfunc <- function(z, V, W = 0.2) {
    stopifnot(class(z)=="numeric") 
    r = W^2/(W^2 + V)
    bf = 0.5 * (log(1 - r) + (r * z^2)) # log BFs
    denom = logsum(bf) # denominator (on log scale so don't sum to 100)
    exp(bf - denom)  # convert back from log scale
}

but it was incorrect for when z is a matrix. How?

  1. Our (log) BFs were wrong because we were multiplying r by z column wise rather than row wise.

  2. I was calculating the logsum of the whole matrix of BFs (obtaining one value) rather than for each row seperately to obtain one for each simulation (although this didn’t matter as we normalised the PPs afterwards).

.zj_pp = function(Zj, int.Sigma, int.nrep, int.ERR, int.r) {
  stopifnot(class(Zj)=="numeric")
  stopifnot(class(int.ERR)=="matrix")
  stopifnot(class(int.r)=="numeric")
  exp.zm = Zj %*% int.Sigma
  mexp.zm = matrix(exp.zm, int.nrep, length(Zj), byrow = TRUE)  # matrix of Zj replicated in each row
  zstar = mexp.zm + int.ERR # MATRIX of z scores
  bf = 0.5 * t(log(1 - int.r) + (int.r * t(zstar^2))) # row wise
  denom = apply(bf, 1, logsum) # get different denom for each rep
  exp(bf - denom)  # convert back from log scale
}

2. Error in estimating mu