R/nextA.R

Defines functions nextA

nextA = function(b, d, env) {
  SQNP <- sqrt(env$gNP)
  
  # draws from multivariate normals can be taken using 
  # draws = mu + l * eta where l*l' = d (l is the cholesky decomposition)      

  # accounting for non-diffuse priors
  newDraw = colMeans(b) + t(chol(d)) %*% matrix(rnorm(env$gNIV), nrow = env$gNIV, ncol = 1)/SQNP 
  return(newDraw)
}

Try the RSGHB package in your browser

Any scripts or data that you put into this service are public.

RSGHB documentation built on Oct. 17, 2018, 5:04 p.m.