# Re: [R] convolution of the double exponential distribution

From: Erich Neuwirth <erich.neuwirth_at_univie.ac.at>
Date: Sat 24 Dec 2005 - 04:23:41 EST

Mathematica says

Assuming[q ∈ Reals && q > 0, Integrate[(q + x)^n*Exp[-2*x], {x, 0, Infinity}]]

2^(-1 - n)*Exp[2*q]*Gamma[1 + n, 2*q]

and 2-argument Gamma is the incomplete Gamma function (integration starting at 2*q)

Duncan Murdoch wrote:
> On 12/22/2005 7:56 PM, Bickel, David wrote:
>

```>>Is there any R function that computes the convolution of the double
>>exponential distribution?
>>
>>If not, is there a good way to integrate ((q+x)^n)*exp(-2x) over x from
>>0 to Inf for any value of q and for any positive integer n? I need to
>>perform the integration within a function with q and n as arguments. The
>>function integrate() is giving me this message:
>>
>>"evaluation of function gave a result of wrong length"
```

>
>
> Under the substitution of y = q+x, that looks like a gamma integral.
> The x = 0 to Inf range translates into y = q to Inf, so you'll need an
> incomplete gamma function, such as pgamma. Be careful to get the
> constant multiplier right.
>
> Duncan Murdoch
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
>
>

--
Erich Neuwirth, University of Vienna
Faculty of Computer Science
Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-38624 Fax: +43-1-4277-9386

R-help@stat.math.ethz.ch mailing list