Missing Values: LIAM2 only supports a missing values indicator nan for float variables. Missing integers are codes as -1 and boolians and false, both of which are valid values. SAS, and therefore Genesis, supports missing values indicators for all variable type and Genesis code makes use of these. It even allows different indicators to be specified by the user for different type of missing values.Final Remarks
Selection Groups: Many procedures in Genesis models are large and apply different probabilities or regression equations to different population groups. Genesis has a reasonably concise syntax for specifying such procedures. The introduction of global arrays in 0.6.0 was a major improvement in converting Genesis code to LIAM2 procedures using choice, particularly when probabilities were period-specific; the enhancement also enable significant reductions in runtimes to be achieved. But if a Genesis regression involves several different formulae then a separate LIAM2 regression process is required for each, although these may be specified within nested if terms.
Alignment with Choice: Several Genesis procedures that would use choice in LIAM2 are aligned but LIAM2 does not support alignment for choice. There are several ways to work round this.
Ordered Regressions: Genesis supports ordered multinomial regressions but LIAM2 only binary stochastic outcomes. A workaround would be necessary in LIAM2 requiring as separate assignment for each of the ordered outcomes.
Support for Dates: SAS support a large number of date functions, most of which can be used in the specification of Genesis generic code.
Modular Structure: Genesis has a modular structure that enables groups of related procedures to be specified in separate Excel workbooks. A LIAM2 model is specified as a program in a single text file, together with a data file that may contain macro variable and alignment parameters. Even for the small comparison model the program of 1700 lines has becoming too large to work with conveniently. A LIAM2 implementation of Pensim2 may be between 10 and 20 times larger.
Processing LIAM2 if: The processing of the LIAN2 if statements can result in unexpected crashes, requiring a workaround, and may also involve unnecessary additional processing. Gaëtan explained the reason for this in an email to me in March “ . . . the vectorized nature of Liam2 which means that both branches of an if are always evaluated (for all individuals), and the if only "selects" one value or another. For expressions which evaluate to a "bad" value outside the filter, this is not a problem, for expressions which "crash" outside the filter, like in this case, it is.” Does the same issue apply to the use of filters?
Probabilities in Choice: Gaëtan also explained that “the choice function currently does not support "vector" arguments (ie a different value for each person)”. This means that if the probabilities vary between groups of individuals and by period then a separate choice with if filter procedure is necessary for each combination. So it is not possible to specify all the probabilities in a global array and use these as prob_option parameters in choice. In my model I have used Gaëtan’s suggestion of not using choices but implementing the procedure by testing uniform() < prob_option. When more than two outcomes are possible it is necessary to convert the probabilities for each outcome to a series of cumulative probabilities (or specify these in the global array) and use a series of nested ifs. Recoding my previous model to use global arrays in this way reduced runtimes considerably and would also make updating the probabilities much easier.