My first problem is that the counters involved in the summation are dependent, For instance for each r[i], 0<r[i]< m-(r[1] +r[2]+...+r[i-1]) so I tried using seq() and for loops to express all the possible combinations but I couldn't.
On 28 September 2015 at 17:26, Maram SAlem <marammagdysa...@gmail.com> wrote: > 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]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.