Hi guys, I'm trying to use the the integral function to estimate the area under a PDF and a crossing curve. first I stated the function with several vectors in it:
fn=function(a,b,F,mu,alpha,xi) { x<-vector() fs<-function(x) { c <- (mu+(alpha*(1-(1-F)^xi)/xi)) tmp <- (1 + (xi * (x - mu))/alpha) ((as.numeric(tmp > 0) * (tmp^(-1/xi - 1) * exp(-tmp^(-1/xi))))/alpha)*((a*(x-c)^0.5)+(b*(x-c))) } return(fs)} #then I use the integral function xn<-fn(1,2,0.98,824,300,-0.0098) horror<-integrate(xn,lower=2021,upper=Inf) what I got is error message #Error in integrate(xn, lower = 2021, upper = Inf) : # non-finite function value can somebody help me by giving some light how to solve this problem? many thanks Best wishes, Al [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.