Professional Documents
Culture Documents
Moderator:
Warren A. Manners, FSA, MAAA
Presenters:
Jeff T. Heaton
Anand Rao
Session 183 PD: Predictive
Modeling for Actuaries
Machine Learning, Predictive Modeling
and Insurance Risk Management
Using agent-based models
with Python and Repast
Overview of agent-based models (ABM),
with a short introduction to the Repast
framework and an explanation of how to
define agent actions with Python.
What is an agent-based model?
Simulates complex systems of interacting
agents.
These agents might be customers,
companies, insurance agents or even
nations.
Agents must act inside of an environment.
Agents can deal with each other either
cooperatively, competitively or obliviously.
3
How are ABMs Used?
Used to simulate large complex systems.
ABMs might be used to simulate and
model:
Interactions between policy holders and
competing agents.
Forecast effects of dynamic market conditions
on portfolios.
Butterfly effect interactions too hard to
predict without simulation.
4
History of ABM
Cellular automata
1970 John Conway
introduces Game of Life
1996: Growing artificial
societies from the
ground up.
1997- Several implementations of
sugarscape from the book Growing
Artificial Societies from the Ground Up by
5
Epstein & Axtell.
History of ABM (cont.)
ABM is used widely in
the video game
industry.
SimCity cities are
semi-autonomous.
9
Repast, continued
Repast was originally developed by David
Sallach, Nick Collier, Tom Howe, Michael
North and others at the University of
Chicago.
Repast is widely used.
Google Scholar lists 50K citations and
references to Repast.
Used by the SOA for the research project
Simulating health behavior, by Alan Mills.
10
Repast Architecture
Structure of
Repast ABM
Also typical
structure other
ABM systems.
Some systems
combine
Environment and
Model.
11
What are Models & Environments?
Repast environment holds
system level information.
Repast models are what
some other systems call
the environment.
There is one instance of the model.
Fields hold data. Actions hold instructions.
Model fields & actions are global to all
agents.
12
Example Model Design
The following field is defined at the model
level:
probNewProduct The probability that an
insurer will retool if it cannot fulfill 50% of its share
of the consumer demand.
consumersNumAgents The number of
consumer agents to use.
insuerersNumAgents The number of insurer
agents to use.
All three are configurable in that you can
modify them on the start model dialog,
without changing the code.
13
Interpreting the Results
An agent model is very different than other
supervised models, such as linear
regression.
You are not training on input, with expected
outcome.
The outcome from an ABM is often a time
series prediction from the agents.
The outcome might be patterns in a time
series.
How you interpret these results is up to you.
14
What is an Agent?
Agents are the central unit
of work in an ABM.
Models have one or more
agent types.
Many agent instances are
created for each agent type.
Fields define attributes unique to each agent
instance.
Actions define how agents update their
15
fields and interact with other agents.
Consumer Agent Design
Consumer agents have the following
fields:
productDesired The product number 0-4,
that the consumer desires.
requestFilled Tracks how many requests
were filled.
requestFailed Tracks how many requests
failed.
One step action, to perform consumer
interactions with insurers.
16
Insurer Agent Design
Insurer agents have the following fields:
currentProduct The current product the
insurer offers.
filledRequests The number of requests that
this insurer could fill this tick.
failedRequests The number of requests
that this insurer failed to fill this tick.
One step action, to perform insurer
interactions with consumers.
17
Passage of Time
19
Example Actions
All actions were programmed in Repasts
Not Quite Python (NQPy) scripting
language.
The following actions are defined.
Model Setup
Consumer Step
Insurer Step
Visualization Step
20
Model Setup Action
# Cause the customers to demand random products.
for consumer as ConsumerAgent in self.consumers:
product_num = Random.uniform.nextIntFromTo(0, 4)
consumer.setProductDesired(product_num)
21
Consumer Step Action
# Choose a random insurer to obtain the product from.
insurer_num = Random.uniform.nextIntFromTo(0,
self.model.insurers.size()-1)
insurer = (InsurerAgent)self.model.insurers.get(insurer_num)
# Do we want to retool?
if refit<self.model.probNewProduct:
self.currentProduct =
Random.uniform.nextIntFromTo(0, 4)
self.cash = self.cash - 5
23
Visualizer with 10 Insurers
26
Contact Details
JeffHeaton
DataScientist,RGA
Email:jheaton@rgare.com
Twitter:@jeffheaton
27
Behavioral simulation of
policyholder behavior
Overview of how agent-based models
(ABM) can be combined with behavioral
economics to better understand investment
decisions made by consumers
What is behavioral simulation?
ArtificialIntelligence AgentBasedModeling
Cognitivethoughtthrough
machines BehavioralSimulation
ComplexSystems
Emergentsystem
behaviorfromindividual
actions
Sophisticated,computationally
ComputationalPower intensivemodelingtechniquethat
Rapidcycletime reliesuponadecentralizedsetof
forintensivecalculations behavioralrulesandstudies
emergentbehaviors
ClassicalEconomics BehavioralEconomics
Individualdecisionmaking
drivenbyselfinterestand Simulationofhowindividualsreally
utilitymaximization makedecisionsandtheiremergent
groupbehaviorsbasedonmodeling
Psychology individualbehaviorsasagents.
Scientificstudyofmental Studyofindividualdecisionmaking
functionsandbehaviorsof basedoncognitive,heuristic,
individualsandgroups emotionalandsocialfactors
29
SimCity for Financial Services
30
What is modelled?
Households FinancialAdvisors
Economy Health
PlanSponsors FSIs
31
Data Fusion
Narrow & Broad & Synthetic
Deep Datasets Shallow Data Population
+ =
Surveys e.g., SBIs Market Data e.g., US HHBS/IE Data for Synthetic US
MacroMonitor Data Census Population
4,000-5,000 households 320 Million households Millions of households
100s of variables 10s of variables 100s or 1000s of variables
Deterministic Stochastic
Non-Parametric Parametric
32
Data Sources
SupportingHHBSDataSources:
1. BureauofLaborStatistics(BLS) ConsumerExpenditure
Survey(CES)ofUShouseholdsannualexpendituresforfood,
clothing,shelter,health,utilities,transportation,supplies,
entertainment,etc.
2. StrategicBusinessInsights(SBI)MacroMonitor
ComprehensiveprojectablesurveyofUShouseholdsfinancial
needs,demographics,products,services,channels,and
attitudeswithnearly4,000variables.
3. EmployeeBenefitsResearchInstitute(EBRI)
4. NationalBureauofEconomicResearch(NBER)
5. RetirementIncomeIndustryAssociation
6. Othersources SocialSecurity,andothersourcesofsocio
economic,healthcare,andretirementdata.
33
Data and Behaviors
IncomeStatement Households BalanceSheet
Income Assets
Salary Home
BusinessOwnership Car
Annuities SavingsAccount
Dividends IRA
CapitalGains 401(K)
SocialSecurity Annuity
Inheritance Pension
Etc. Etc.
Behaviors
Consumption Liabilities
Discretionary clothes, Buyingahome Mortgage
restaurants,vacations, Findingajob Carloans
privateschool,etc. Spending Consumerloans
Nondiscretionary Saving Creditcarddebts
mortgage,basic Investing Otherrealestateloans
groceries,healthcare, Planning Educationdebts
insurance,etc. Retiring Healthcaredebts
34
Dynamic Cradle-to-Grave Simulations
Thesystemmodels:
IndividualLifeCycle
Interactionofindividualswith AssetCycle
theiradvisors;
Stages
Changesingovernmentsocial
programssuchasSocial Dependent
Single& Growing
PreRetiree Retiree
New
Rich Family Generation
SecurityandMedicare;and
Changesinthetaxsystem. LiabilityCreation AssetDepletion
35
Life-cycle Stages
WehavedividedthelifecycleofAn
individualintosixstages:
IndividualLifeCycle
AssetCycle
1. Dependents
Stages
2. Single&Rich
3. GrowingFamily Single& Growing New
Dependent PreRetiree Retiree
Rich Family Generation
4. Preretiree
5. Retiree
LiabilityCreation AssetDepletion
6. NewGeneration
Advice AssetCreation AssetCreation
Ourgoalistomodelhowthelifeevents
andthechoicesoftheindividualschange AssetProtection AssetTransfer
overtimetoreflectvariouslifestages
suchaswhen: AssetPreservation
36
Consumer Behavior Model
ACTIONABLEINSIGHTS
ANALYSIS&SYNTHESIS
Population Simulation
Household Whatif?
ScenarioBuilding
Fundedness
DATAINPUTS
HHDemographic LifeEvents HealthcareCost
37
Modeling Home Purchase Decisions
Familysize Savingsversusdownpayment
Rentversusmortgage Desiredhousesize
Startafamily
1 Anindividualbeginsthinkingabout
Stableemploymentprospect Taxeffects
purchasingahome,withmanyfactors
influencingthedecision.
2 Whentheconditionsareright,theperson
willpurchaseahome.Hewilldrawfromhis 1 Rent
savingstopayforthedownpaymentand
fees.Hisrentalexpensesgoingforwardare
replacedbymortgagepayments.
2 Ownhome
3 Ashiswealthincreasesandchildrenare
born,hemaydecidetobuyalargerhome.
3
4 Ifacashneedarises(e.g.medicalexpenses),
hemaydecidetosellthehouseandreturn
torenting. Upsize Downsize
4 Sell Reversemortgage
38
Modeling Employment Decisions
1 Consideranindividualwhojustretired,buthisincome
barelycovershisexpenses.
5
2 Ifhisexpensesincrease(e.g.,becausehiswifehas
unexpectedhealthcarecosts),thenhemaybeforced Employed
tolookforajob.
3 Hewillbeconsideredunemployedwhilehesearches
forajobtocoverhisextraexpenses.
4 6
4 Hewillthenfindanewjobwithaprobabilitybasedon
hisage,occupationandthecurrentstateofthe
economy. Unemployed Retired
2
5 Whileheisemployed,hewillhaveenoughincometo 3 1
coverthesenewhealthcarecosts.
6 Onceherillnesspassesandthehealthcarecostsdrop
orhebecomestooilltowork,hewillreturnto
retirement.
39
Simulating Individuals and Households
40
Life-event impacts
HouseholdEvents
IndividualEvents
41
Macro-view of household structures
42
Where can we use Behavioral
Simulations?
Products, Capital,
Strategy& Customer& Sales& Process& Inforce
Pricing& Risk&
Growth Marketing Distribution Operations Management*
Underwriting Finance
Howcanweimprovepolicyholder
Howwillchangingconsumer persistency?
demographicandsocio
economicforcesimpactdemand Doourproductdesignsreflect
forourproducts? theevolvingneedsofour
customerbase?
43
Example #1: Withdrawal
Considerwhenthereisacashneed,andthe
individualmustmakeadecisionofwhetherornot
tomakeawithdrawalfromtheirvariableannuity Savings
contract.Thisdecisionwilldependon:
1. Theirfamilysituation;
CDs
2. Theirfinancialliteracy;
3. Howtheproductwasframedwhenitwassold Whichasset
tothem; doImakea
withdrawal MutualFunds
4. Whatothertypeoffinancialassetstheyown; from?
5. Whatarethetaxconsequences;and
VariableAnnuity
6. Howmuchthevariableannuitycontractisin
themoney. Individual
Withregardstothelastcriteria,consideration 401(k)
mayalsobegiventovariouscontractprovisions
suchasthesurrenderpenaltyandwhetherthe
guaranteedminimumbenefitofthevariable
annuitycontractisstillinthewaitingperiod.
44
Withdrawal decision process
Cashneedfulfilled
6
Cashneed Otheraccounts
2 unfulfilled (CD,mutual
Event
funds,401k)
(i.e.,healthissue)
Needcash Account
1 4 withdrawal
Policyholder Consideration hierarchy PartialVA
dormant 3 ofwithdrawal withdrawal
Usedisposable 5
income
Cashneed FullVA
covered withdrawal
Whileheisretiredandhisfixedincomecovershis Ifhedoesnotbelievehissourcesofincomewillcoverhis
1 expenses,hewillremaindormantwithnofinancial 4
expenseduringthetimeheisjobsearching,hewillbeginto
concerns. worryandconsiderwithdrawingcashfromhisinvestments.
Whenhiswifegetssick,hewillcalculatehowmuch Ifhedecidestowithdraw,hewillfollowawithdrawal
2 5
moneyhewillneedtocoverhermedicalbills. hierarchy,tappingintooneaccountatatimeuntilhehas
fulfilledhiscashneed.
Whileheislookingforajobtocoverhermedicalbills,he Oncehiscashneedisfulfilled,hewillreturntothedormant
3 6
willcalculatehowlongtheycanliveoffoftheircurrent state.
incomesources.
45
Annuity Lapses & Withdrawals
46
Examples #2: Retirement Readiness
MacroEnvironment Decisionmaking
Economy Householdstructure
Inflation Assetallocation
Unemployment Indebtedness
Returnonfinancial Health
assets SocialSecurity
Homevalues Retirementage
Health
Lifeexpectancy
Outofpocket Fundedness
healthcarecosts
Highereducationcost Fundedness: RatioofExpectedRetirementSavingsVs.
anddebt ExpectedRetirementExpenses(Overfunded:>110%;
SocialSecurityoutlays Constrained:70110%;Underfunded:<70%)
GlidePath:Portfoliomixchangesthroughlifestagesand
economicconditions
47
Uses of Retirement Readiness
FitnessMaps OpportunityMaps GlidePathAnalysis
48
Scenario Analysis
BaseScenarioResults Percentagesaddupto100%acrosseachsegment
Household(%) MedianNetWorth($K)
LifeStage UF C OF UF C OF
Starters 83% 15% 2% $21 $868 $5,581
Builders 80% 7% 13% $195 $1,086 $4,123
PreRetired 66% 13% 21% $150 $601 $2,691
Retired 64% 9% 27% $213 $1,422 $2,429
Wealth UF C OF UF C OF
Marginal 90% 9% 1% $38 $333 $915
MassMarket 65% 16% 19% $392 $957 $1,335
Affluent 25% 10% 65% $2,733 $2,416 $5,356
Wealthy 3% 5% 92% $6,131 $5,459 $11,118
Acrossalllifestages,64%to83%areUnderfunded
evenamongtheRetired,amajorityofthepopulationisunderfunded.
MedianNetWorthofHHsinsamewealthsegmentishigherforoverfunded...
anddifferenceofnetworth forunderfundedandoverfundedrangesfrom900Kto5Mn.
49
Retirement Heatmap
50
Conclusion
Dynamicsimulationofconsumerfinancialbehaviorof
representativeUSpopulationfromcradletograve
Exploitsmacrolevelandmicrolevelmodeling
Granularindividualandhouseholdlevelbigdataasopposed
toaggregates
Builtusingcommercialstrengthsoftware(i.e.,AnyLogic)
capableofrunning500,000+consumeragents
Platformthatallowsanumberofbehavioralandmacro
economicpoliciestobeanalyzedandevaluated
51
Contact Details
Dr.AnandS.Rao
Partner,PwCAdvisoryServices
InnovationLead,AnalyticsGroup
Email:anand.s.rao@us.pwc.com
Twitter:AnandSRao
52