Re: [R] how to use quadrature to integrate some complicated functions

2011-11-08 Thread R. Michael Weylandt
It's polite to include the whole list in your replies so the threads get archived properly. Yes, underflow is occasionally a problem: hence the common use of log-likelihood in MLE and other applications. Might that help you out here? You can get log-likelihoods directly from pnorm and dnorm with t

Re: [R] how to use quadrature to integrate some complicated functions

2011-11-08 Thread David Winsemius
On Nov 8, 2011, at 9:43 AM, R. Michael Weylandt wrote: Have you tried wrapping it in a function and using integrate()? R is pretty good at handling numerical integration. If integrate() isn't good for you, can you say more as to why? Michael On Nov 6, 2011, at 4:15 PM, JeffND wrote: H

Re: [R] how to use quadrature to integrate some complicated functions

2011-11-08 Thread R. Michael Weylandt
Have you tried wrapping it in a function and using integrate()? R is pretty good at handling numerical integration. If integrate() isn't good for you, can you say more as to why? Michael On Nov 6, 2011, at 4:15 PM, JeffND wrote: > Hello to all, > > I am having trouble with intregrating a co

[R] how to use quadrature to integrate some complicated functions

2011-11-06 Thread JeffND
Hello to all, I am having trouble with intregrating a complicated uni-dimensional function of the following form Phi(x-a_1)*Phi(x-a_2)*...*Phi(x-a_{n-1})*phi(x-a_n). Here n is about 5000, Phi is the cumulative distribution function of standard normal, phi is the density function of standard nor