Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-21 Thread Jeff Newmiller
That is an intrinsic part of nonlinear optimization. Choose your starting point wisely. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-21 Thread David Winsemius
On Oct 20, 2012, at 8:01 PM, stats12 wrote: Hi, Thank you for your comment. I worked on the code again and was able to make it work. Does that mean you know what value is correct for certain cases? Is there an overall strategy that is guiding this effort? I wrote earlier: DW Your

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-21 Thread Berend Hasselman
On 21-10-2012, at 05:01, stats12 wrote: Hi, Thank you for your comment. I worked on the code again and was able to make it work. The only problem I am having right now is that nlm depends on the initial value. When the initial value is 1, I get the following estimates 0.1230414

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-21 Thread stats12
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

[R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread stats12
Dear R users, When I run the code below, I get the error Error in integrate(integrand, 0, Inf) : non-finite function value. The code works if the function returns only sum(integ). However, I want to add cmh to it. When I add cmh I get that error. I can't figure out why this is happening because

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread David Winsemius
On Oct 20, 2012, at 9:23 AM, stats12 wrote: Dear R users, When I run the code below, I get the error Error in integrate(integrand, 0, Inf) : non-finite function value. The code works if the function returns only sum(integ). But you never showed us the working code. However, I want to

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread stats12
Hi, Thank you for your comment. I worked on the code again and was able to make it work. The only problem I am having right now is that nlm depends on the initial value. When the initial value is 1, I get the following estimates 0.1230414 19.6271029 when it is 2, I get the following 29.46874