Skip to content

Instantly share code, notes, and snippets.

@dritoshi
Created April 2, 2012 10:35
Show Gist options
  • Save dritoshi/2282454 to your computer and use it in GitHub Desktop.
Save dritoshi/2282454 to your computer and use it in GitHub Desktop.
mci.sapply <- function(x, u) {
unlist(sapply(x,
function(x) {
g <- x * exp( -(u * x)^2 / 2)
mean(g) / sqrt(2 * pi) + 0.5
}
))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment