sum, I guess, as in > x <- seq(0,2*pi,length=10) > y <- x <- seq(0,2*pi,length=10) > X <- cbind(x,y) > sum(sapply(1:NROW(X), function(i) sin(X[i,1])*cos(X[i,2]))) [1] 1.991599e-16
There may be more efficient ways to deal with the `sapply' part, especially if your function is vectorized. HTH, Giovanni > Date: Tue, 16 Mar 2004 11:12:03 +0100 > From: Paolo Bulla <[EMAIL PROTECTED]> > Sender: [EMAIL PROTECTED] > Cc: > Precedence: list > User-Agent: Internet Messaging Program (IMP) 3.2.1 > > > Hello, > I have to compute a multiple summation (not an integration because the > independent variables a > are discrete) for all the values of a function of several variables f > (x_1,...,x_n), that is > > sum ... sum f(x_1,...,x_n) > x_1 x_n > > have you some suggestion? Is it possible? > I know that for multiple integration there is the function adapt, but it has at > most n=20. In my case n depends on the dimension of the dataset and, hence, it > could be bigger. > > Thank you, > Paolo > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > > -- __________________________________________________ [ ] [ Giovanni Petris [EMAIL PROTECTED] ] [ Department of Mathematical Sciences ] [ University of Arkansas - Fayetteville, AR 72701 ] [ Ph: (479) 575-6324, 575-8630 (fax) ] [ http://definetti.uark.edu/~gpetris/ ] [__________________________________________________] ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html