Re: [R] calculate the integral

2018-10-24 Thread Bert Gunter
Is this homework? This list has a no homework policy. Also, please stop posting in html. Bert Gunter On Wed, Oct 24, 2018 at 6:40 AM malika yassa via R-help < r-help@r-project.org> wrote: > helloplease can anyone help me, I find it difficult to calculate this > integrali have this > programmx<

[R] calculate the integral

2018-10-24 Thread malika yassa via R-help
helloplease can anyone help me, I find it difficult to calculate this integrali have this programmx<-rnorm(10,0,1)y<-rexp(10,2)z<-exp(10,3)s<-vector()for (  j in 1:10)s[j]<-x[j+1]+x[j]s1[i]<-s[j]/2f<-function(y,u){exp(y-u)}sapply(x, function(i){  z[j] integrate(f,lower=s1[j],upper=,s1[j+1] x=i)$

[R] calculate the integral

2018-10-24 Thread malika yassa via R-help
helloplease can anyone help me, I find it difficult to calculate this integrali have this programmx<-rnorm(10,0,1)y<-rexp(10,2)z<-exp(10,3)s<-vector()for (  j in 1:10)s[j]<-x[j+1]+x[j]s1[i]<-s[j]/2f<-function(y,u){exp(y-u)}sapply(x, function(i){  z[j] integrate(f,lower=s1[j],upper=,s1[j+1] x=i)$