#' Parameteric bootstrap
#' @export
para.bootstrap <- function(h2, x, n.sub, h2.method = GCTA.rr, target = c("beta2","h2")[1]){
x <- std.fn(x)
K <- x %*% t(x) * 1/ncol(x)
In <- diag(nrow(x))
Vh <- h2*K + (1-h2)*In
res.tmp <- numeric(n.sub)
set.seed(1234)
for(i in 1:n.sub){
y.bs <- MASS::mvrnorm(n = 1, mu = numeric(nrow(x)), Sigma = Vh)
res.tmp[i] <- h2.method(x = x, y = y.bs, target = target)
}
res.tmp
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.