There are a couple other things like this that Ben
wants to implement, so maybe he can say more.
This seems good. I was trying this with the old but good quadpack, but it was hard since I had never worked with importing external Fortran code.
Is your code in a Stan branch?
Why not the one Ben Goodrich suggested? It's C++ and seems pretty
simple. Also, I couldn't find boost numerical integrator.
I'd think doubly exponential [i.e., exp(-exp(abs(x)))]
would be very limiting, but I have no clue as to what kinds
of applications people would use this for.
Cook points to more of an explanation here:
 http://www.johndcook.com/blog/double_exponential_integration/
> On Nov 30, 2015, at 10:34 PM, Ben Goodrich <goodri...@gmail.com> wrote:
>
> On Monday, November 30, 2015 at 6:15:08 PM UTC-5, Marco Inacio wrote:
> Why not the one Ben Goodrich suggested? It's C++ and seems pretty
> simple. Also, I couldn't find boost numerical integrator.
>
> Boost doesn't have a general numerical integrator. I think it would be difficult to expose a function like integrate() into the Stan language because no single numerical integration procedure works well on every problem. But Cook's approach works well on functions that decline at a double exponential rate, which covers a lot of things one might want to do in statistics. So, I think something like this could be included in Stan Math and used when appropriate as the back end by functions exposed to the Stan language.
>
> Ben
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+unsubscribe@googlegroups.com.
But how would it work with integrals on (-inf, inf) or (0, inf)?
Would those have to be double exponential to start with? Â
Or could we take a normal(0, 1), transform it to (-1, 1), then
work from there with a Jacobian?
Also, it looks like Bailey himself wrote a BSD version in C++:
 http://crd-legacy.lbl.gov/~dhbailey/mpdist/
though it's not clear which of those packages it'd be in.
I've corresponded a little with John Cook before so I took the liberty of sending him a message with a pointer to this discussion. In the past he's been surprisingly responsive so we might just hear from him. Otherwise I'm happy to follow up or let you (Marco) do it. Let me know.
>
> We need to keep the licensing clean on Stan itself.
> Sorry this keeps coming up with things you want to do!
>
> - Bob
Could you tell me where should I put Cook's "DEIntegrator.h" and
"DEIntegratorConstants.h" files? Or if you preffer, organizing them
yourself, I created a clean branch
feature/issue-210-numerical-integration in stan-dev/math.