I have a question regarding the function "integrate".
Why does integrate sometimes returns "extremely bad integrand behaviour", 
when I integrate a well-define function between 0 and ,1 and how can I 
solve the problem.
The following is an example of the problem:
x = seq(0, 1, length=50) 
y = c(0.6697534, 0.7868631, 0.8793606, 0.9404326, 0.9933826, 1.0441545, 
1.0861214, 1.1076160, 1.0943228, 1.0620462, 1.0334792, 1.0176313, 
1.0189657, 1.0286591, 1.0635902, 1.0815423, 1.0952207, 1.0985036, 
1.0782912, 1.0411431, 1.0056234, 0.9641239, 0.9360296, 0.9212780, 
0.9057849, 0.8850640, 0.8836523, 0.8780735, 0.8793521, 0.8651096, 
0.8526203, 0.8280131, 0.8029167, 0.7886007, 0.7844318, 0.7838392, 
0.7996804, 0.8162264, 0.8245920, 0.8315790, 0.8465705, 0.8623909, 
0.8948042, 0.9145519, 0.9141968, 0.9188292, 0.9278436, 0.9264173, 
0.9381125, 0.9527778)
fct = approxfun(x, y, method="linear", rule=2)
integrate(fct, 0, 1)$value

My R version is 1.7.1

Regards
Tine Buch-Larsen


------------------------------------------------------------------------------
This e-mail and any attachment may be confidential and may also be privileged.
If you are not the intended recipient, please notify us immediately and then
delete this e-mail and any attachment without retaining copies or disclosing
the contents thereof to any other person.
Thank you.
------------------------------------------------------------------------------
        [[alternative HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to