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 ??

______________________________________________
[email protected] 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.

Reply via email to