13
martin@spielauer .ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts of the Generic Microsimulation Programming Language Modgen Martin Spielauer

[email protected] Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

Embed Size (px)

Citation preview

Page 1: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

Microsimulation Conference 2007

The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source

Code and Basic Concepts of the Generic Microsimulation Programming Language

Modgen

Martin Spielauer

Page 2: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

LifeCourse Model: Background & Aims

- Developed at Max Planck Institute for Demographic Research alongside a study on fertility decline in Bulgaria and Russia

- It was also developed and used as a teaching tool for the European Doctoral School for Demography

- LifeCourse is a very simple continuous time cohort MSM- LifeCourse is programmed in Modgen, a generic MS

language developed at Statistics Canada: efficient (few pages), readable (C++), modular, user-friendly GUI

- LifeCourse serves as template for other models; e.g. it was recently extended and adapted for the study of the effect of union dissolution on fertility in France (Vienna Institute for Demography, Stockholm University)

Page 3: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

LifeCourse Step by Step

- The statistical model- The Modgen/C++ programming environment- Programming:

- Simulation Engine- Parameter handling- Events- Table Output

- The resulting Modgen Application LifeCourse- User Interface- Graphical display of individual histories

Page 4: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

The Statistical Model

- 6 Piecewise constant hazard regression models for first and second births, first and second union formations, and first and second union dissolutions.

- Simple (easy to interpret) models including interactions with calendar time to study changes over time.

- E.g. Model for First Births:

Page 5: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

The Modgen programming environment

- Integrated into MS Visual Studio NET C++: Modgen code translated into C++ before being compiled

- Efficient programming of MSM applications:- Event handling (event queue)- Handling of input parameters and output tables of any

dimension- Efficient multilingual cross-referenced model

documentation and input/output labeling- Modgen graphical user-interface- All output automatically includes information on Monte

Carlo variability- Graphical visualization of individual life-courses by

BioBrowser tool

Page 6: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

The Modgen programming environment

Page 7: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

Programming: 1) Simulation Engine

Page 8: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

Programming: 2) Parameter Handling

Page 9: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

Programming: 3) Events

Page 10: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

Programming: 4) Table Output

Page 11: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

The resulting Modgen Application LifeCourse

Page 12: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

The resulting Modgen Application LifeCourse

Page 13: Martin@spielauer.ca Microsimulation Conference 2007 The “LifeCourse” Model, a Competing Risk Cohort Microsimulation Model: Source Code and Basic Concepts

[email protected]

Conclusion

- I hope that „LifeCourse“ and its technical documentation is useful also for others as - Information resource introducing into Modgen- Model template for first steps into MSM development using

Modgen

- Modgen:- Mostly known in connection with extremely complex

models (Lifepaths, POHEM), the strengths of Modgen unfold also for very simple models

- NOTE: this presentation only covered a small fraction of the concepts and strengths of Modgen