I don't seem to get a problem with this. Have you tried a Monte Carlo
approach to verify that you are getting incorrect answers?
For me, I get when the upper is 1 that
> integrate(e2, lower = 0, upper = 1)
-0.2820948 with absolute error < 5e-05
> sum(e2(runif(1)))/1
[1] -0.2825667
whic
e2 <- function(x) {
out <- 0*x
for(i in 1:length(x))
out[i] <-integrate(function(y) qnorm(y),lower=0,upper=x[i])$value
out }
integrate(e2,lower=0, upper=a)$value
above is my code , when a is small , say a<0.45 the result is right .
however , when a>0.5
the result is incorrect .
2 matches
Mail list logo