I want to simulate the number of emigrants by age, sex and household position to 47 groups of municipalities in Flanders (destinations).
I use the following code
ENTITY=PERSON
internal_migration_target
- indx: 1
- indx2: -1
- int_migrant: False
- score_male: logit_score(-3.269+0.357*single + 0.0952*in_singleparenthh - 0.4476*in_couplechildhh)
- score_female: logit_score(-3.301+0.367*single + 0.1376*in_singleparenthh - 0.5183*in_couplechildhh)
- while indx <= 47:
# this is for version 0.11
- migr_matM: MIGR_MATM[indx,:,:]
- migr_matF: MIGR_MATF[indx,:,:]
#- qshow(migr_matM)
- int_emigrant: if(int_migrant==False,if(ISMALE,
logit_regr(score_male, align=migr_matM, filter=age<88),
logit_regr(score_female, align=migr_matF,filter=age<88)),False)
- int_migrant: if(int_emigrant,True,int_migrant)
- indx2: if(int_emigrant,indx,indx2)
- qshow(count(int_migrant))
- indx: indx + 1
This is the structure of MIGR_MATM and MIGR_MATF
indx,age,period
,,2015
1,0,0.00165212602533260
2,0,0.00327526738355410
3,0,0.00770992145155213
4,0,0.00411582272977595
...
44,0,0.00060867800933306
45,0,0.00066664734355526
46,0,0.00049273934088867
47,0,0.00060867800933306
1,1,0.00192052419013189
2,1,0.00367159036348745
3,1,0.00720196571299461
4,1,0.00389753438585590
...
44,1,0.00056486005592115
45,1,0.00067783206710537
46,1,0.00048013104753297
47,1,0.00056486005592115
I don't understand why I get the following message?
ERROR: index 47 is out of bounds for axis 0 with size 47
Secondly, I overestimate the number of moves: 209001 in stead of about 156000. Any idea?
Thank you in advance for the help!
Ingrid