Re: [R] Double integration using R

2011-11-06 Thread R. Michael Weylandt
There do exist packages for multi-variate integration in R, but sticking to base functions, what you've described should work but the inner integral will need to be vectorized before it's passes to the outer integral: Vectorize() can do this directly, but it won't be particularly fast since it's

[R] Double integration using R

2011-11-06 Thread Robert A'gata
Hi, I have a function that I need to do double integration: \int^T_0 \int^t_0 N(\delta / \sigma \sqrt(u)) (1-N(\delta / \sigma \sqrt(u))) du dt where N(x) is a standard normal probability of x. I start off by writing an inner integral into a function. Meaning \int^t_0 N(\delta,\sigma \sqrt(u))