[R] summation equation whose numerator has subscript

2015-11-30 Thread Sherouk Moawad via R-help
Dear R experts Please do you have any idea about how this summation can be written in R(the equation can be viewed in the following link): http://s16.postimg.org/or2km30ph/equation.jpg I've tried out out this code but it gave me error for writing brackets in function of summation: >>> x=mat

[R] how to write this summation n R

2015-11-23 Thread Sherouk Moawad via R-help
Dear R experts do you have any idea about how this equation can be written in R?? __ 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/

[R] finding root of nonlinear equation

2015-11-17 Thread Sherouk Moawad via R-help
Dear R experts I'm trying to use R to solve for the root of one nonlinear function I tried to use the package "rootSolve" but it didn't give any value the value is (numeric(0)) although I tried on changing the interval of root. I tried also the package "nleqslv" but itdidn't iterate what ever

Re: [R] condition in triple summation

2015-10-19 Thread Sherouk Moawad via R-help
ou want to do it. On Mon, Oct 19, 2015 at 3:53 AM, Sherouk Moawad via R-help wrote: If I'm summing over (i,j,k) each from 1 to 3 And I have  condition that (i>j>k) But I want to restrict this condition to only cases where i,j,k>1 Sent from Yahoo Mail on Android From:"Jeff

Re: [R] condition in triple summation

2015-10-19 Thread Sherouk Moawad via R-help
Please excuse my brevity. On October 18, 2015 2:03:34 PM PDT, Sherouk Moawad via R-help wrote: >Dear R-Expertsx=c(0,0.3, 0.5,0.6)sum(sapply(1:4, function(i) >{sum(sapply(1:3, function(j){sum(sapply(1:2, function(k) >{(i>j)*(j>k)*exp(x[i]+x[j]+x[k])}))}))})) >I want to restrict

[R] condition in triple summation

2015-10-18 Thread Sherouk Moawad via R-help
Dear R-Expertsx=c(0,0.3, 0.5,0.6)sum(sapply(1:4, function(i) {sum(sapply(1:3, function(j){sum(sapply(1:2, function(k) {(i>j)*(j>k)*exp(x[i]+x[j]+x[k])}))}))})) I want to restrict the condition (i>j>k) to only those cases where i>1&j>1&k>1In other words'if i=1 then i>=jif j=1 then j>=kother wise

[R] double summation

2015-10-14 Thread Sherouk Moawad via R-help
Σi=02 Σj=01(exp(xi+xj)), i>j if (i>0 and j>0)  I want to write this summation which has a condition on numerator(j0 and j>0I tried on this code sum(sapply(0:2, function(i){sum(sapply(0:1, function(j){if (i>0&j>0){i>j}{exp(x[i]+x[j])}))}))But it didn't work Any help please [[alternative H