Skip to content
Prev 276723 / 398506 Next

how to use quadrature to integrate some complicated functions

On Nov 8, 2011, at 9:43 AM, R. Michael Weylandt wrote:

            
The density of a standard normal is very tractable mathematically. Why  
wouldn't you extract the arguments and sum them before submitting to  
integration ... which also might not be needed since pnorm could  
economically provide the answer. Perhaps with limits a, b:

suitable_norm_factor*
    pnorm(
      dnorm( sum(x-a_1, x-a_2, ..., x-a_{n-1}, x-a_n) ), a,  
lower.tail=FALSE) ) -
    pnorm(
      dnorm( sum(x-a_1, x-a_2, ..., x-a_{n-1}, x-a_n) ), b,  
lower.tail=FALSE) ) )
If efficiency is desired ... use mathematical theory to maximum extent  
before resorting to pickaxes.