I'm using EV5.
I'm trying to use combinatorial to average series within several groups.
The following is my code, in which I divided the series of a group into
two subgroups and trying to estimate from those, an average in its
series.
The problem is in the attached files. The code is a draft, there are some
lines that does the same, but I'm trying to find out what's the problem
with the combinations. The matrices are just to compare with the groups.
Thanks in advance.
Code: Select all
workfile temp a 1990 2009 'name and date edited
''' %z variable is not defined, so it is not executed
matrix(20, 30) m1
matrix(20,30) m1_d_m
group g1 'same size as matrix m1
group g{%z}_d_m 'same size as matrix m1_d_m
'variables creation
for !i = 1 to 6
for !j = 1 to 5
series y{%z}_{!i}_{!j} = rnd 'two dimension in the series
next
next
'First set of groups, it goes increasing in its firt dimension
!hcol=1
for !hi = 1 to 6
!hj=1
while !hj < 6
g1.add y{%z}_{!hi}_{!hj} 'added to a single group
colplace(m1, y{%z}_{!hi}_{!hj}, !hcol)
group g_d{!hi}_m
g_d{!hi}_m.add y_{!hi}_{!hj} 'added to a first set
!hcol=!hcol+1
!hj=!hj+1
wend
next
'paso2 would perform an average for elements in g_d1_m until g_d6_m
'creating gw_d1_m until gw_d6_m, respectively.
'in this case, an average is calculated using 6 over 5 (equal to 6) in each g_d*_m to create
'those from gw_d*_m with the same size, but one series excluded.
include paso2.prg
'Second set of groups, it goes increasing in its second dimension
!gcol=1
for !gi = 1 to 5
!gj=1
while !gj < 7
g{%z}_d_m.add y{%z}_{!gj}_{!gi} 'added to a single group
colplace(m1_d_m, y{%z}_{!gj}_{!gi}, !gcol)
group g_d_m{!gi}
g_d_m{!gi}.add y_{!gj}_{!gi} 'added to a second set
!gcol=!gcol+1
!gj=!gj+1
wend
next
'paso3 would do the same as paso2, but in this case,
'from g_d_m1 until g_d_m5, should create new groups, gw_d_m1 up to gw_d_m5
'in this case, an average is calculated using 5 over 4 (equal to 5) in each g_d_m* to create
'those from gw_d_m* with the same size, but one series excluded.
include paso3.prg
