Message-ID: <43AB5178.1040202@stats.uwo.ca>
Date: 2005-12-23T01:23:04Z
From: Duncan Murdoch
Subject: convolution of the double exponential distribution
In-Reply-To: <5F883C17941B9F4E80E5FA8C9F1C5E0E01CF2C13@jhms08.phibred.com>
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