Upload
betty-caldwell
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
MDUDevelopment UnitModel
Howard RedwayModel Development UnitUK Department for Work and Pensions
IMA ConferenceMay 18 2012
Comparison of LIAM2 and Genesis Model Generators
MDUDevelopment UnitModel
Background: Why Were Genesis and LIAM2 DevelopedHow 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
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
Structure of a Model: LIAM2 (2)
LIAM2
AlignmentMatrices
Model Specification(YAML format)
MDUDevelopment UnitModel
Structure of a Model: LIAM2 (2)
LIAM2
Base Data
AlignmentMatrices
Model Specification(YAML format)
MDUDevelopment UnitModel
Structure of a Model: LIAM2 (2)
LIAM2
Output
Base Data
Log and PC Output
AlignmentMatrices
Model Specification(YAML format)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
Structure of a Model: Genesis (1)
Genesis Model Engine
ParametersExcel Spreadsheets
MDUDevelopment UnitModel
Structure of a Model: Genesis (1)
Genesis Model Engine
Static CodeDevelopers Own SAS
ParametersExcel Spreadsheets
MDUDevelopment UnitModel
Structure of a Model: Genesis (1)
Genesis Model Engine
SAS Program
Static CodeDevelopers Own SAS
ParametersExcel Spreadsheets
MDUDevelopment UnitModel
Structure of a Model: Genesis (1)
Genesis Model Engine
SAS Program
Static CodeDevelopers Own SAS
ParametersExcel Spreadsheets
Base Data
MDUDevelopment UnitModel
Structure of a Model: Genesis (1)
Genesis Model Engine
SAS Program
Static CodeDevelopers Own SAS
ParametersExcel Spreadsheets
Output
Base Data
Log
MDUDevelopment UnitModel
Structure of a Model: Genesis (1)
Genesis Model Engine
Tools
SAS Program
Tools
Tools Static CodeDevelopers Own SAS
ParametersExcel Spreadsheets
Output
Base Data
Log
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
Example 1: Simple Genesis DPM Action
SelectionCriteriaRule Sheet
SelectionCriteria Condition1 Condition2
Over25_Education_Not_Assigned pa_Age>25 MISSING(pa_EducationLevel)
MDUDevelopment UnitModel
Example 1: Simple Genesis DPM Action
Table Name Data Item
pa EducationLevel
Selection Criteria Outcome 2002 2003 2004 2005
2 0.25 0.25 0.25 0.25
3 0.39 0.39 0.39 0.39
4
SelectionCriteriaRule Sheet
DPM_Assign_Education Sheet
SelectionCriteria Condition1 Condition2
Over25_Education_Not_Assigned pa_Age>25 MISSING(pa_EducationLevel)
MDUDevelopment UnitModel
Example 1: Simple Genesis DPM Action
Actions Name Selection Criteria Tablename Variable
DPM_Assign_Education Over25_Education_Not_Assigned pa EducationLevel
Table Name Data Item
pa EducationLevel
Selection Criteria Outcome 2002 2003 2004 2005
2 0.25 0.25 0.25 0.25
3 0.39 0.39 0.39 0.39
4
SelectionCriteriaRule Sheet
ActionRule Sheet
DPM_Assign_Education Sheet
SelectionCriteria Condition1 Condition2
Over25_Education_Not_Assigned pa_Age>25 MISSING(pa_EducationLevel)
MDUDevelopment UnitModel
Example 2: More Complex Genesis DPM Action
DPM_Assign_Education Sheet
Table Name Data Item
pa EducationLevel
Selection Criteria Outcome 2002 2003 2004 2005
Man_UK_Born 2 0.25 0.24 0.23 0.23
Man_UK_Born 3 0.39 0.39 0.38 0.37
Man_UK_Born 4
Man_NonUK_Born 2 0.25 0.25 0.25 0.25
Man_NonUK_Born 3 0.39 0.39 0.39 0.39
Man_NonUK_Born 4
Woman_UK_Born 2 0.23 0.23 0.23 0.23
Woman_UK_Born 3 0.23 0.23 0.23 0.23
Woman_UK_Born 4
Woman_NonUK_Born 2 0.23 0.23 0.23 0.23
Woman_NonUK_Born 3 0.23 0.23 0.23 0.23
Woman_NonUK_Born 4
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
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
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
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)
MDUDevelopment UnitModel
Questions?
Genesis Information:
Or any member of the Model Development Unit
Two presentations in the next session
LIAM2 information:
http://liam2.plan.be/
Questions Further Information