Tutorials
This tutorial series walks you through the Ergodic Insurance Limits framework, from installation to advanced optimization. The goal is to help you understand how time-average (ergodic) analysis changes insurance purchasing decisions compared to traditional expected-value approaches.
Note
New here? Start with Getting Started with Ergodic Insurance Limits for installation and a first simulation.
Tutorial Overview
The tutorials are split into two groups.
Foundations (Tutorials 1–2):
Getting Started – Installation, environment setup, and running your first simulation
Basic Simulation – The Widget Manufacturer model, step-by-step year simulation, and loss processing
Applied Workflow (Tutorials 3–6):
Tutorials 3 and 4 follow NovaTech Plastics, a fictional $10M plastics manufacturer with an 8% operating margin, as the running example. The same manufacturer parameters carry through Tutorials 5 and 6.
Configuring Insurance – Building single-layer and multi-layer insurance towers for NovaTech
Optimization Workflow – Using
BusinessOptimizerto find data-driven insurance strategies as NovaTech plans its expansionAnalyzing Results – Comparing time-average vs. ensemble-average growth rates with
ErgodicAnalyzerAdvanced Scenarios – Monte Carlo simulations, market cycle modeling, and scenario analysis
Quick Start Paths
You do not need to complete every tutorial. Pick a path based on what you want to learn:
- Actuaries and Risk Managers:
Start with the foundations, then focus on insurance structure and results interpretation.
- Financial Analysts and CFOs:
Focus on the business case for insurance and the optimization workflow.
- Developers and Researchers:
Dive into the simulation engine and advanced techniques.
Tutorials
Step-by-Step Tutorials:
- 1. Getting Started with Ergodic Insurance Limits
- 2. Basic Simulation
- 2.1. The Widget Manufacturer Model
- 2.2. Running a Year Step-by-Step
- 2.3. Processing Insurance Claims
- 2.4. Understanding Claim Development
- 2.5. The Simulation Class
- 2.6. Analyzing Simulation Results
- 2.7. Visualizing Results
- 2.8. Handling Insolvency
- 2.9. Multiple Simulations with Different Seeds
- 2.10. Next Steps
- 3. Tutorial 3: Configuring Insurance
- 3.1. A Quick Insurance Refresher
- 3.2. Creating a Simple Insurance Policy
- 3.3. Building a Multi-Layer Tower
- 3.4. Processing Claims Through the Policy
- 3.5. Insured vs. Uninsured: The Simulation Comparison
- 3.6. Advanced Features: InsuranceProgram
- 3.7. Premium Loading Analysis
- 3.8. Exercises
- 3.9. Next Steps
- 4. Tutorial 4: Optimization Workflow
- 4.1. The Story So Far
- 4.2. 1. Setting Up the BusinessOptimizer
- 4.3. 2. Defining Objectives and Constraints
- 4.4. 3. Running Optimization
- 4.5. 4. Sensitivity Analysis
- 4.6. 5. Strategy Backtesting
- 4.7. 6. Walk-Forward Validation
- 4.8. 7. Market Cycle Considerations
- 4.9. 8. Best Practices
- 4.10. 9. Exercises
- 4.11. 10. Next Steps
- 5. Analyzing Results: The Ergodic Advantage
- 5.1. The Board Presentation Problem
- 5.2. Ergodic vs Non-Ergodic Systems
- 5.3. Running Paired Simulations
- 5.4. Using ErgodicAnalyzer.compare_scenarios()
- 5.5. Time-Average vs Ensemble-Average Growth
- 5.6. Understanding Ergodic Divergence Over Time
- 5.7. Survival Analysis
- 5.8. Growth Rate Analysis
- 5.9. Visualizing Ergodic Effects
- 5.10. Convergence Analysis
- 5.11. Full Analysis Pipeline
- 5.12. Interpreting Results
- 5.13. Exercises
- 5.14. Next Steps
- 6. Tutorial 6: Advanced Scenarios
- 6.1. The Story So Far
- 6.2. 1. Monte Carlo Simulation with MonteCarloEngine
- 6.3. 2. Parallel Processing for Speed
- 6.4. 3. Configuration Profiles and Presets
- 6.5. 4. Insurance Market Conditions
- 6.6. 5. Complex Insurance Structures
- 6.7. 6. Stochastic Processes for Revenue Modeling
- 6.8. 7. Scenario Analysis
- 6.9. 8. Generating Reports
- 6.10. 9. Performance Tips
- 6.11. 10. Exercises
- 6.12. 11. Further Resources
Support Resources
Help & Support:
Learning Objectives
After working through these tutorials you should be able to:
Install the framework and run a simulation end-to-end
Configure multi-layer insurance programs with deductibles, attachment points, and limits
Use the optimizer to search for insurance strategies that maximize time-average growth
Interpret the difference between ensemble-average and time-average growth rates
Run Monte Carlo simulations and analyze survival probabilities, ROE, and final equity distributions
Prerequisites
- Required:
Python 3.12 or higher
Comfort with Python basics: importing packages, running scripts, reading tracebacks
Familiarity with probability concepts (distributions, expected value, variance) at the level of Actuarial Exam P
- Helpful:
Working knowledge of insurance terms – deductible, retention, limit, attachment point, premium
Exposure to financial metrics such as ROE, operating margin, and asset turnover
Experience with NumPy arrays and Matplotlib (used throughout the code examples)
Getting Help
If you get stuck:
Check the Troubleshooting Guide guide for common errors and fixes
Consult the ../api/modules for detailed function and class documentation
Open an issue on GitHub