Re: [R] Help with Integration Output

2011-09-24 Thread B77S
It is not simply the answer, it is a list str(integrate(dnorm, -1.96, 1.96)) List of 5 $ value : num 0.95 $ abs.error : num 1.05e-11 $ subdivisions: int 1 $ message : chr "OK" $ call: language integrate(f = dnorm, lower = -1.96, upper = 1.96) - attr(*, "class")= chr "i

[R] Help with Integration Output

2011-09-24 Thread ChrisQ
Hi, I need to do a calculation in R which involves adding the estimate of a numerical integration with another number - however, if I add the number to the output of the intergrate function (which when run on its own provides me with a number with error), I get the message 'non-numeric argument to

Re: [R] help with integration

2009-03-04 Thread Uwe Ligges
andrea.tor...@apat.it wrote: Dear all, I have a problem with the integration of the following function. Could you please give some suggestions? Thank you very much!!! y<-rnorm(n=100) f<-function(x,xi,h){ n<-length(xi) Ke<-c() for(t in 1:n) { Ke[t]<-dnorm((x-xi[t])/h) } fke<-sum(Ke)*(1

[R] help with integration

2009-03-04 Thread andrea . toreti
Dear all, I have a problem with the integration of the following function. Could you please give some suggestions? Thank you very much!!! y<-rnorm(n=100) f<-function(x,xi,h){ n<-length(xi) Ke<-c() for(t in 1:n) { Ke[t]<-dnorm((x-xi[t])/h) } fke<-sum(Ke)*(1/(n*h)) fke<-fke^2 return(fke)