[R] writing an equation with multiple summation

Maram SAlem marammagdysalem at gmail.com
Mon Sep 28 17:26:56 CEST 2015


Dear All,

I'm trying to write and evaluate an equation which involves multiple
summations but can't figure out how to do it.

I've an numeric vector r
r<-vector(mode = "numeric", length = m)
 and I have multiple summations (for ex.) of the form:

[(sum from r[1]=0 to g(r[1])) (sum from r[2] =0 to g(r[2]))......(sum from
r[m] to g(r[m]))] {the sum is over some complicated expression in
r[1],r[2],.....,r[m]},

where g(r[i]) = m- (r[1] +r[2]+...+r[i-1])
Any suggestions for some function or a package that can help me with this?

Many Thanks,
Maram

	[[alternative HTML version deleted]]



More information about the R-help mailing list