R用户
我将以表格形式为表达式编写代码
sum(l(from 1 to n))sum(i(from 1 to m))sum(t(from 1 to m)[phil(i)*phil(j)*I(X(l)<min(y(i),y(t)-z(i)z(t)]
我想我应该使用一个循环,所以要定义像
这样的函数fun1<-function(phil,x,y,z){s1<-phil(j)*phil(r)*(x(l)<min(y(i),y(t))-z(i)*z(t))}
s1=0
for (t in 1:m )
s1<-phil1(i)*phil1(t)*(x(l)<min(y(i),y(t))-z(i)*z(t))
for (i in 1:m)
s2=sum(s1)
for (l in 1:n)
s3=sum(s2) #not sure what commands I can put here
有人可以给我一些写这段代码的想法 非常感谢!!!