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
Paolo Bulla wrote:
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?
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,
On 16-Mar-04 Paolo Bulla wrote:
Hello,
I have to compute a multiple summation (not an integration
because the independent variables 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