Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f=function(n){
- x=rnorm(n)
- g=exp(-x^2)
- f=mean(g)
- f
- }
- f(10000)
- [1] 0.5800912
- f <- function(x) {exp(-x^2)}
- integrate(f,-Inf,Inf)
- 1.772454 with absolute error < 4.3e-06
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement