This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howtos:implementagingwithmap:apply_aging_using_a_map [2010/10/19 13:12] shona.weldon created |
howtos:implementagingwithmap:apply_aging_using_a_map [2010/10/19 14:24] (current) shona.weldon |
||
---|---|---|---|
Line 6: | Line 6: | ||
integer $lastAge = 100 | integer $lastAge = 100 | ||
- | local eafrToea[ea,eafr] = create (; dim=SEQ:age;$firstAge;$lastAge;1:year, \ | + | local eafrToea[ea,eafr] = create (; dim=SEQ;age:$firstAge:$lastAge:1;year, \ |
- | dim=SEQ:ageFr;$firstAge;$lastAge;1:year) | + | dim=SEQ;ageFr:$firstAge:$lastAge:1;year) |
eafrToea[ea,eafr] = insert (extract (diag (1.0; \ | eafrToea[ea,eafr] = insert (extract (diag (1.0; \ | ||
dimFrom1=eafrToea[ea,eafr]); \ | dimFrom1=eafrToea[ea,eafr]); \ | ||
- | age:+0..-1); \ | + | age:+0..-1); \ |
- | age->age:+1, ageFr->ageFr:+0) !This moves the diagonal forward one age so n year olds map to (n+1)1 year olds | + | 1->age:+1, 2->ageFr:+0) |
- | eafrToea[ea,eafr] = insert (1.0; age:-0, ageFr:-0) ! this does the binning of the last 2 ages | + | eafrToea[ea,eafr] = insert (1.0; age:-0, ageFr:-0) |
- | <\code> | + | |
+ | table (eafrToea[ea,eafr]) ! Just to prove to yourself it worked, comment it out later | ||
+ | </code> | ||
Now you can just apply the map to your stock (not the change of sequence name just before the map!): | Now you can just apply the map to your stock (not the change of sequence name just before the map!): | ||
Line 20: | Line 22: | ||
dim=age, name=ageFr), \ | dim=age, name=ageFr), \ | ||
eafrToea[ea,eafr]) | eafrToea[ea,eafr]) | ||
- | <\code> | + | </code> |