You are right. I ran the code again and got the same error again. But ran it for the second time, it didn't return an error and I got some values. It's my first time doing this kind of coding and I'm still learning. I agree that my code may look unorganized and wrong. I'll work on your comments and see if I can figure out the problem. Thanks
-- View this message in context: http://r.789695.n4.nabble.com/Error-in-integrate-integrand-0-Inf-non-finite-function-value-tp4646868p4646917.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.