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

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

Deepankar Basu <basu.15 <at> osu.edu> 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 (http://integrals.wolfram.com/index.jsp), which says that

                           2

Integrate[Exp[b + c x - d x ], x] ==
      2
 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 ??



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.