On Fri, 7 Mar 2008, Max wrote:
> Prof Brian Ripley formulated on Friday :
>> On Fri, 7 Mar 2008, Max wrote:
>>
>>> Dear UseRs,
>>>
>>> I'm curious about the derivative of n!.
>>>
>>> We know that Gamma(n+1)=n! So when on takes the derivative of
>>> Gamma(n+1) we get Int(ln(x)*exp(-x)*x^n,x=0..Inf)
Hi max,
Prof. Ripley is right. Your problem is that you missed a (-) sign in the
exponential. Here is a demonstration showing the agreement between
numerical and analytical results:
gx <- function(x, n) exp(-x) * x^n * log(x)
df <- function(n) {integrate(gx, lower=0, upper=Inf, n=n)$val}
lib
Prof Brian Ripley formulated on Friday :
> On Fri, 7 Mar 2008, Max wrote:
>
>> Dear UseRs,
>>
>> I'm curious about the derivative of n!.
>>
>> We know that Gamma(n+1)=n! So when on takes the derivative of
>> Gamma(n+1) we get Int(ln(x)*exp(-x)*x^n,x=0..Inf).
>>
>> I've tried code like
>>
>>> in
Hi Max,
The analytic integral \int _0 ^\Inf exp(-t) t^n log(t) might not converge
because the integrand tends to -Inf as t -> 0.
So, here is a numerical approach to estimating the derivative of the gamma
function:
library(numDeriv)
fx <- function(x, n) exp(-x) * x^n
gf <- function(n) {integrat
On Fri, 7 Mar 2008, Max wrote:
> Dear UseRs,
>
> I'm curious about the derivative of n!.
>
> We know that Gamma(n+1)=n! So when on takes the derivative of
> Gamma(n+1) we get Int(ln(x)*exp(-x)*x^n,x=0..Inf).
>
> I've tried code like
>
>> integrand<-function(x) {log(x)*exp(x)*x^n}
>> integrate(inte
5 matches
Mail list logo