Message-ID: <BAY102-F21F8CD6F04A53A57F1CAE6B36F0@phx.gbl>
Date: 2005-11-01T22:30:36Z
From: Lynette Sun
Subject: multidimensional integration not over a multidimensional rectangle
In-Reply-To: <4367EA71.60608@pdf.com>
Hi,
anyone knows about any functions in R can get multidimensional integration
not over a multidimensional rectangle (not adapt).
For example, I tried the following function f(x,n)=x^n/n!
phi.fun<-function(x,n)
{ if (n==1) {
x
}else{
integrate(phi.fun, lower=0, upper=x, n=n-1)$value
}
}
I could get f(4,2)=4^2/2!=8, but failed in f(4,3)=4^3/3! Thanks
Best,
Lynette