Dear all,

The following code provides a partial example of a code that is run separately for each of the 3 observations in set i.

SETS i /1*3/

.

ALIAS (ii, i) ;

out(i,outp).. sum(ii,lm(i,ii)*y(outp,ii))=E=y(outp,i)*(1+beta1(i));

model uno /out ,.../;

solve uno using nlp maximizing z;

In the GAMS .lst file, equation "out" for observation 1 will look like that

lm(1,1)*y(outp,1)+lm(1,2)*y(outp,2)+lm(1,3)*y(outp,3)=y(outp,1)*(1+beta1(1))

How can I write equation "out" in a way that its left-hand side summation does not include the observation under investigation. In the previous example, the "out" equation will look as follows:

lm(1,2)*y(outp,2)+lm(1,3)*y(outp,3)=y(outp,1)*(1+beta1(1))

Thanks,

Teo

## Sum over all observations except the observation under investigation

### Re: Sum over all observations except the observation under investigation

Hi Teo,

You could use a dollar condition as follows
I hope this helps!

Fred

You could use a dollar condition as follows

Code: Select all

```
out(i,outp).. sum(ii$(not sameas(i,ii)),lm(i,ii)*y(outp,ii))=E=y(outp,i)*(1+beta1(i));
```

Fred