Displaying 2 results from an estimated 2 matches for "xiefu".
Did you mean:
xie
2009 Oct 23
1
integrate() function error
This is my code , when i run it ,error happed . can you tell me what's the
reason and modify it ?thank you very much !! the error is "evaluation of
function gave a result of wrong length"
e2<-function(a) integrate(function(x) x,lower=0,upper=a)$value
integrate(e2,lower=0, upper=0.5)$value
[[alternative HTML version deleted]]
2009 Oct 23
1
a problem about integrate function in R .thank you .
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 . why ? thank you .
[[alternative HTML version deleted]]