Actuarial Workflows¶
Everything you can build with gaspatchio, driven by natural language. Describe what you need — the tooling generates the code and runs it.
How to read this page
Each section shows example prompts you can use in your editor. You don't need to use these exact words — describe your task naturally and the tooling will match it to the right workflow.
Start a New Project¶
What you want: Get from zero to a running model.
"I just installed gaspatchio. What should I do first?"
"Set me up with the Level 1 tutorial."
"I have model_points.parquet — help me build a model for it."
"Create a new project folder for a term life model with monthly projections."
What happens: Your installation is verified, your data files are inspected, and you get guidance on your first model. If you're starting fresh, the tooling surfaces the right tutorial level based on your experience.
Inspect Your Data¶
What you want: Understand what's in your data files before modelling.
"What's in model_points.parquet? Show me the columns and some sample rows."
"How many policies are in this file? What products?"
"Is this data ready for a monthly projection model?"
"Compare the columns in my data file to what the Level 4 model expects."
What happens: Your parquet files are read, the schema is summarised, sample rows are shown, and anything unusual is flagged — missing columns, unexpected types, nulls. If you're building a model, you'll see what's present and what needs to be added.
Build a Projection Model¶
What you want: Create a model from scratch or modify an existing one.
"Build me a term life projection model with mortality and lapse decrements."
"Add a surrender charge to my model — 5% in year 1, declining 1% per year."
"Convert my annual rates to monthly using compound conversion."
"I need to calculate present value of future cashflows at 3.5% discount rate."
"Add a GMDB guarantee to my variable annuity model."
What happens: Model code is written following gaspatchio's three-phase pattern (setup, timeline, calculations). The model is validated against a single policy first, the output is checked for correctness, and the cycle continues until the results are right. You review the output at each step.
Set Up Assumptions¶
What you want: Load and configure assumption tables.
"Load the mortality table from assumptions/mortality.parquet and look up by attained age."
"I have a select-and-ultimate mortality table — set it up with age and duration dimensions."
"Add a lapse rate table that varies by product type and policy year."
"My mortality rates are annual but my model projects monthly. Handle the conversion."
What happens: Table objects are created with the correct lookup dimensions, data is loaded from your parquet files, and the lookups are wired into your model. The table dimensions are checked against your model point data for consistency.
Run and Debug Your Model¶
What you want: Execute the model and investigate results.
"Run my model for policy 12345 and show me the cashflows."
"Run the full model and save the results."
"Why is the death benefit negative in month 37?"
"Show me the lapse rates for the first 24 months of policy 12345."
"The account value drops to zero too early — help me figure out why."
What happens: Single-policy or full-model executions run, the output variables you care about are displayed, and calculations are traced step by step when something looks wrong. For debugging, the specific period where results diverge from expectations is isolated.
Reconcile Against a Reference¶
What you want: Match your gaspatchio model to an existing Excel, lifelib, or vendor implementation.
"My model needs to match this lifelib output. Start the reconciliation process."
"The PV of premiums is off by 2.3%. Help me find where the difference comes from."
"Compare my death benefit calculation to the Excel model in reference/source.xlsx."
"Run the reconciliation for all 1,000 policies and show me which ones fail."
"I'm stuck on the AV rollforward — it matches for month 1 but drifts after that."
What happens: A strict variable-by-variable reconciliation process is followed. One calculation is compared at a time, starting from inputs and working through the dependency chain. When differences appear, diagnostic techniques — scatter plots, regression analysis, cohort breakdowns — isolate the root cause. The Level 4 tutorial was reconciled to 0.0000% using exactly this workflow.
Run Scenarios¶
What you want: Stress test your model under different assumptions.
"Run a 50bps interest rate shock and show me the impact on BEL."
"Set up three scenarios: base, adverse, and favourable with different mortality and lapse assumptions."
"Run a sensitivity sweep on lapse rates from -20% to +20% in 5% steps."
"Generate a regulatory stress test report comparing all scenarios."
"What happens to the GMDB liability if equity returns drop 30%?"
What happens: Scenarios are configured using gaspatchio's with_scenarios() and Table.with_shock(), the model runs under each scenario, and results are presented with comparison charts. For sensitivity analysis, sweep grids and heatmaps show how outputs change across assumption ranges.
Review Model Quality¶
What you want: Check your model before using it for production or regulatory work.
"Review my model for quality issues."
"Check if my model follows ASOP 56 standards."
"Are there any performance problems in my model?"
"Generate documentation for this model."
"What would an auditor flag in this model?"
What happens: Your model code is reviewed against gaspatchio best practices and actuarial standards. Common antipatterns are checked (unnecessary loops, missing edge cases, hardcoded assumptions), along with performance issues and audit readiness. A structured report with findings and suggested fixes is produced.
Working Through the Tutorials¶
What you want: Learn gaspatchio progressively, at your own pace.
"Start me on the Level 1 Hello World tutorial."
"I've finished Level 2. What should I learn next?"
"Guide me through Level 3 step by step."
"I want to learn scenario analysis — which tutorial level?"
"Show me the reconciliation exercise in Level 3 Step 06."
Tutorial Map¶
| Level | Name | What You Learn |
|---|---|---|
| 1 — Hello World | ActuarialFrame, column arithmetic, conditionals |
Core concepts in 60 lines |
| 2 — Assumptions | Table.lookup(), multi-dimension tables, loading from files |
Separating assumptions from logic |
| 3 — Mini VA | Full variable annuity: mortality, lapse, AV, claims, discounting | Complete model built incrementally in 6 steps |
| 4 — Reconciled Lifelib | Production model matched to lifelib at 0.0000% across 1,016 policies | Reconciliation workflow and production quality |
| 5 — Scenarios | Shocks, sensitivities, sweeps, regulatory reports | Scenario analysis and stress testing |
What happens: The tutorial content is loaded, each step is explained in actuarial terms, and you run and modify the models at your own pace. You control the pace — go faster, skip ahead, or dive deeper into any concept.
Tips for Better Results
- Be specific about what you want. "Term life with monthly projections and lapse decrements" works better than "build a model."
- Name your data files. "Use model_points.parquet in the data folder" removes ambiguity.
- Name the reference when reconciling. "Match the lifelib IntegratedLife output" tells the tooling exactly what to compare against.
- Validate after each step. "Run that for policy 1 and show me the output" catches problems early.
- Describe the actuarial intent. "I need a cumulative survival function" is clearer than "multiply all the previous values together."
- Every output is yours to verify. Inspect any step, any policy, any timestep. Reconcile against your existing models.