Dear R users... 

I made the R-code for this triple summation computation 

http://www.nabble.com/file/p20517134/a.jpg 

-------------------------------------------------
Here is my code..


x=seq(.1,1,.1); l=10
y=seq(1,10); m=10
z=seq(.1,1,.1); n=10

sum(sapply(1:l, function(i) {sum(sapply(1:m, function(j) {sum(sapply(1:n,
function(k){exp(x[i]*y[j]*z[k]  )/gamma(y[j]+1)}))^(1.5)  }))}))

-------------------------------------------------

In fact, this is a part of optimization and in my real data the number of x
is about 5000. So, I guess if it is vectorized, then the running time could
be shortened.

How could I vectorize this? or any suggestion will be greatly appreciated.

Kathryn Lord
-- 
View this message in context: 
http://www.nabble.com/make-a-triple-summation-more-efficient-tp20517134p20517134.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to