440 likes | 552 Views
Comparison of LIAM2 and Genesis Model Generators. Howard Redway Model Development Unit UK Department for Work and Pensions Howard.Redway@dwp.gsi.gov.uk IMA Conference May 18 2012. Background: Why Were Genesis and LIAM2 Developed How Are They Used
E N D
Comparison of LIAM2 and Genesis Model Generators Howard Redway Model Development Unit UK Department for Work and Pensions Howard.Redway@dwp.gsi.gov.uk IMA ConferenceMay 18 2012
Background: Why Were Genesis and LIAM2 Developed How Are They Used Overview of the Structure of Genesis and LIAM2 Main Differences in Functionality Structure of a Genesis Model Structure of a LIAM2 Model Simple Example of Genesis and LIAM2 Code More Complex Example of Genesis and LIAM2 Code Conclusions Questions Further Information Presentation Overview
Originally Developed for Pensim2 (replacing for Pensim) To model State and Private Pensions policies Desktop tool Parameter driven by users Maintainable within DWP (Not black box like Pensim) Based on DWP standard language – SAS Why Genesis was Developedand How is it Used (1)
Originally Developed for Pensim2 (replacing for Pensim) To model State and Private Pensions policies Desktop tool Parameter driven by users Maintainable within DWP (not black box like Pensim) Based on DWP standard language – SAS Realised it could generate a wide class of models Became Genesis separate from Pensim2 5 other Genesis models in addition to Pensim2 Genesis is owned and maintained by DWP Why Genesis was Developedand How is it Used (1)
Pensim2: First release 2004 Used by the Pensions Commission Private and State Pension Policy Development Forecasting Up to 20 users at any one time High turnover of users and developers About 6 released a year (2 major) Why Genesis was Developedand How is it Used (2)
LIAM2 was developed: For the development and management of large dynamic microsimulation models by teams of researchers To be flexible so that modellers can update the models fast to changes in the circumstances To separate the computer programming from the model development Microsimulation teams no longer have to reinvent the wheel Different teams can cooperate more easily Why LIAM2 Developed and How is it Used
LIAM2 was developed: For the development and management of large dynamic microsimulation models by teams of researchers To be flexible so that modellers can update the models fast to changes in the circumstances To separate the computer programming from the model development Microsimulation teams no longer have to reinvent the wheel Different teams can cooperate more easily As an open source tool running on a standard PC Why LIAM2 Developed and How is it Used
LIAM2 was developed: For the development and management of large dynamic microsimulation models by teams of researchers To be flexible so that modellers can update the models fast to changes in the circumstances To separate the computer programming from the model development Microsimulation teams no longer have to reinvent the wheel Different teams can cooperate more easily As an open source tool running on a standard PC Several models produced or under development Why LIAM2 Developed and How is it Used
LIAM2 was developed: For the development and management of large dynamic microsimulation models by teams of researchers To be flexible so that modellers can update the models fast to changes in the circumstances To separate the computer programming from the model development Microsimulation teams no longer have to reinvent the wheel Different teams can cooperate more easily As an open source tool running on a standard PC Several models produced or under development LIAM2 is being developed at the Federal Planning Bureau (Belgium), with funding and testing by CEPS/INSTEAD (Luxembourg) and IGSS (Luxembourg), and EU funding Why LIAM2 Developed and How is it Used
LIAM2 is: An interpreter/compiler Written in Python (model developer and users do not need to know this) The model is specified in text as a LIAM2 program In YAML-markup language (independent of Python) Most LIAM2 statements are interpreted and executed (some are compiled) Structure of a Model: LIAM2 (1)
Structure of a Model: LIAM2 (2) Model Specification (YAML format) LIAM2
Structure of a Model: LIAM2 (2) Model Specification (YAML format) Alignment Matrices LIAM2
Structure of a Model: LIAM2 (2) Model Specification (YAML format) Alignment Matrices Base Data LIAM2
Structure of a Model: LIAM2 (2) Model Specification (YAML format) Alignment Matrices Base Data LIAM2 Output Log and PC Output
Genesis is: A code generator Written in SAS Model specified as parameters in Excel sheets Writes and then runs a SAS program Structure of a Model: Genesis (1)
Structure of a Model: Genesis (1) Genesis Model Engine
Structure of a Model: Genesis (1) Parameters Excel Spreadsheets Genesis Model Engine
Structure of a Model: Genesis (1) Static Code Developers Own SAS Parameters Excel Spreadsheets Genesis Model Engine
Structure of a Model: Genesis (1) Static Code Developers Own SAS Parameters Excel Spreadsheets Genesis Model Engine SAS Program
Structure of a Model: Genesis (1) Static Code Developers Own SAS Parameters Excel Spreadsheets Genesis Model Engine Base Data SAS Program
Structure of a Model: Genesis (1) Static Code Developers Own SAS Parameters Excel Spreadsheets Genesis Model Engine Base Data SAS Program Output Log
Structure of a Model: Genesis (1) Tools Static Code Developers Own SAS Parameters Excel Spreadsheets Genesis Model Engine Base Data SAS Program Tools Output Log Tools
Genesis has: Static Code: Provides the flexibility to code in SAS processes that are not supported by the specific Genesis functionality Missing values: SAS missing value indicator enable missing values to be trapped (LIAM2 uses -1 and FALSE for Integer and Boolean missing values). Date processing Unordered Polychotomous Regressions Main Differences in Functionality (1)
Genesis has: Static Code: Provides the flexibility to code in SAS processes that are not supported by the specific Genesis functionality Missing values: SAS missing value indicator enable missing values to be trapped (LIAM2 uses -1 and FALSE for Integer and Boolean missing values). Date processing Unordered Polychotomous Regressions Ordered Polychotomous Regressions Probit Regression (specific functionality) Main Differences in Functionality (1)
LIAM2 has: Interactive Console and Breakpoints: Powerful debugging tool (inspection of variables and step through procedures) Temporary Variables: Not saved automatically and may be local to a procedure Main Differences in Functionality (2)
LIAM2 has: Interactive Console and Breakpoints: Powerful debugging tool (inspection of variables and step through procedures) Temporary Variables: Not saved automatically and may be local to a procedure Macros (more general than Genesis Selection Criteria) One2Many links and link functions Forced outcomes with alignment (take/leave) Partnership matching Cloning: create a new record copying selected variables Output functions (can be switched off) Main Differences in Functionality (2)
How would you assign level of education in LIAM2 for persons aged 25 and over? Assuming the variables Age and EducationLevel had be defined Specify the following as a process for the entity person. Example 1: Simple LIAM2 Choice Process
How would you assign level of education in LIAM2 for persons aged 25 and over? Assuming the variables Age and EducationLevel had be defined Specify the following as a process for the entity person. EducationLevel: if( (Age>25) and (EducationLevel != -1), choice([2,3,4], [0.25, 0.39, 0.36]) , EducationLevel ) Example 1: Simple LIAM2 Choice Process
How would you assign level of education in LIAM2 for persons aged 25 and over? Assuming the variables Age and EducationLevel had be defined Specify the following as a process for the entity person. EducationLevel: if( (Age>25) and (EducationLevel != -1), choice([2,3,4], [0.25, 0.39, 0.36]) , EducationLevel ) The within the simulation block of the program: person: [EducationLevel] Example 1: Simple LIAM2 Choice Process
Example 1: Simple Genesis DPM Action SelectionCriteriaRule Sheet
Example 1: Simple Genesis DPM Action SelectionCriteriaRule Sheet DPM_Assign_Education Sheet
Example 1: Simple Genesis DPM Action SelectionCriteriaRule Sheet DPM_Assign_Education Sheet ActionRule Sheet
Example 2: More Complex Genesis DPM Action DPM_Assign_Education Sheet
EducationLevel: if( (age>25) and (EducationLevel != -1) and (Man_UK_Born) , if((period=2002), choice([2,3,4], [0.25,0.39,0.36]) , if((period=2003), choice([2,3,4], [0.24,0.39,0.37]) , if((period=2004), choice([2,3,4], [0.23,0.38,0.39]) , if((period=2005), choice([2,3,4], [0.23,0.37,0.4]) , EducationLevel ) ) ) ) , Example 2: More Complex LIAM2 Choice Process
EducationLevel: if( (age>25) and (EducationLevel != -1) and (Man_UK_Born) , if((period=2002), choice([2,3,4], [0.25,0.39,0.36]) , f((period=2003), choice([2,3,4], [0.24,0.39,0.37]) , if((period=2004), choice([2,3,4], [0.23,0.38,0.39]) , if((period=2005), choice([2,3,4], [0.23,0.37,0.4]) , EducationLevel ) ) ) ) , if( (age>25) and (EducationLevel != -1) and (Man_NonUK_Born) etc ) Example 2: More Complex LIAM2 Choice Process
LIAM2 and Genesis are both able to generate discrete dynamic microsimulation models containing similar processes (demographic, labour market, pension processes) Genesis requires SAS (currently version 9.1) Genesis is owned and maintained by DWP LIAM2 is Open Source Conclusions (1)
LIAM2 and Genesis are both able to generate discrete dynamic microsimulation models containing similar processes (demographic, labour market, pension processes) Genesis requires SAS (currently version 9.1) Genesis is owned and maintained by DWP LIAM2 is Open Source There are a few major differences in functionality Genesis has Static Code LIAM2 has Interactive Console and Temporary variables Conclusions (1)
LIAM2 and Genesis are both able to generate discrete dynamic microsimulation models containing similar processes (demographic, labour market, pension processes) Genesis requires SAS (currently version 9.1) Genesis is owned and maintained by DWP LIAM2 is Open Source There are a few major differences in functionality Genesis has Static Code LIAM2 has Interactive Console and Temporary variables Many other differences in functionality Conclusions (1)
LIAM2 and Genesis are both able to generate discrete dynamic microsimulation models containing similar processes (demographic, labour market, pension processes) Genesis requires SAS (currently version 9.1) Genesis is owned and maintained by DWP LIAM2 is Open Source There are a few major differences in functionality Genesis has Static Code LIAM2 has Interactive Console and Temporary variables Many other differences in functionality Different approach to how a model is specified Conclusions (1)
The slow running of Genesis is a concern Currently looking for ways to speed this up LIAM2 appears to be significantly faster No direct comparison available yet Conclusions (2)
The slow running of Genesis is a concern Currently looking for ways to speed this up LIAM2 appears to be significantly faster No direct comparison available yet If both Genesis and LIAM2 are capable of generating a specific model with acceptable runtimes then the most appropriate interface for the intended users is likely to be a significant factor Conclusions (2)
Questions? Genesis Information: Howard.Redway@dwp.gsi.gov.uk Or any member of the Model Development Unit Two presentations in the next session LIAM2 information: http://liam2.plan.be/ Questions Further Information