R/SimpsonInt.R

"SimpsonInt"<- function(xin, h)
{   #xin = data, h=distance of the points at which function is evaluated
  n<-length(xin)
  nn<-1:n
  int0<-xin[1]
  int2n<-xin[n]
  inteven<-xin[seq(3,n-1,by=2)]
  intodd<-xin[seq(2,n-2,by=2)]
  sumodd<-sum(intodd)
  sumeven<-sum(inteven)
  res<-(h/3)*(int0+4*sumodd+2*sumeven+int2n)
  res
}

Try the NPHazardRate package in your browser

Any scripts or data that you put into this service are public.

NPHazardRate documentation built on May 2, 2019, 10:24 a.m.