Re: [R] Problem with numerical integration and optimization with BFGS

From: Ben Bolker <>
Date: Thu, 24 May 2007 22:44:19 +0000 (UTC)

Deepankar Basu <basu.15 <at>> writes:

> For my model, the likelihood function for each observation is the sum of
> three integrals. The integrand in each of these integrals is of the
> following form:
> A*exp(B+C*x-D*x^2)

 (where D is positive)

  Being very lazy, I tried Mathematica's online integrator (, which says that


Integrate[Exp[b + c x - d x ], x] ==
 b + c /(4 d)              -c + 2 d x
E             Sqrt[Pi] Erf[----------]
                           2 Sqrt[d]
              2 Sqrt[d]

  R knows "Erf" (the error function)
as pnorm -- can you use this to avoid numerical integration entirely ?? mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 24 May 2007 - 22:48:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 May 2007 - 02:31:12 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.