Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
BillRand AssistantProfessorofBusinessManagement
PooleCollegeofManagementNorthCarolinaStateUniversity
An Introduction to Agent-Based Modeling
Unit 9: Advanced Topics
Using Big Data and Agent-Based Modeling to Understand Social Media Diffusion
William Rand
in collaboration withDavid Darmon, Jimpei Harada, Jared Sylvester, and Michelle Girvan
The Beauty of Big Data
• Individuals leave their footprints (and fingerprints) in the digital sand.
• These traces represent digital / social signals of human behavior.
• We can use these signals to explore the complexity of individuals and digital environments.
The Challenge of Big Data
• What do we do with all this data?
• Aggregation of the data eliminates the richness of it
• The real benefit is when the data is used at the individual level
• How to make sense of that individual-level information?
Agent-Based Modeling
• Agent-Based Modeling provides a way to understand individual-level interactions
• Traditionally, agent-based models use simple rules derived from theory
• If we could create ABMs directly from big data we would have an individual-level detailed model derived directly from digital traces
The Solution
• Use Machine Learning to derive individual-level rules for agents automatically
• Then use the resulting ABM to understand the overall emergent properties of agent interactions
Creating Epsilon Machines
Assume was generated by a conditionally stationary stochastic process.
Explicitly learn the predictive distribution by grouping together pasts x that give equivalent predictions.
The Computational Mechanics Framework
Causal State Model (CSM) built for each user usingCausal State Splitting Reconstruction (CSSR)
Begin with one state and divide as necessary.
Computational Mechanics
Call the model learned the
causal state model (CSM)
for each user. CSM has the unique property of being “maximally predictive and minimally complex”
Learn this state-space representation of the process using
Causal State Splitting Reconstruction (CSSR).
Predicting Twitter Engagement Using ML
Two Case Studies
• Predicting Twitter Behavior
• Identifying Optimal Timing for Messaging
Understanding the Predictive Power of Computational Mechanics and Echo State Networks in Social Media
David Darmon, Jared Sylvester, Michelle Girvan, and William Rand
SocialCom 2013
Predicting Twitter Engagement Using ML
Opportunity: Social Media is a great marketing channel. Challenge: However, there is a lot of noise, and its not
apparent when users are paying attention. Solution: Understand when users are active. Goal: Create a tool that can accurately predict when
different segments will post content.
Motivation
Twitter users embedded in a 15k user follower network.
Statuses of all users collected over 7 weeks.
Select 3k subset of most frequently tweeting users.
The Dataset
Predicting Twitter Engagement Using ML
2013-08-22 12:54:06 Is Your Gmail Social? How to Use Gmail Daily to Build an Engaged Community | Socially Sorted http://t.co/WVprF4bLPa via 2013-08-22 13:11:22 Facebook's Embedded Posts Now Available to Everyone http://t.co/Cc0q3cSTt62013-08-22 13:14:06 The Credible Hulk http://t.co/q17VrcSdBs2013-08-22 13:29:02 25 Things You Didn’t Know About Ninjas http://t.co/CcJz92sRyy2013-08-22 13:32:59 Twitter Users: Revoke and Reestablish Third Party App Access Now http://t.co/qL9LbnGO6e via @ShellyKramer2013-08-22 13:48:46 10 Brilliant Facebook Marketing Tactics to Increase Reach and Engagement http://t.co/Z4YsudlJ35 via @kathikruse2013-08-22 14:17:11 Google Now Adds Cards for NCAA Football Scores, Concert Tickets, Car Rentals and More http://t.co/BG6Yz2zDyU2013-08-22 15:18:03 What is the NSA Really Up To? [COMIC] http://t.co/hakoq1mFNX2013-08-22 15:39:04 6 Things Every Good Business Blog MUST Have http://t.co/KRGzZRCrbm
Tweet TextTimestamp
User: DanielZeevi
The Setup
Predicting Twitter Engagement Using ML
Bin (in time) Twitter data, giving a discrete time series for each user v at time t:
The Setup
0 1 0 1 1 1 0 1 1 1… …
— user v doesn’t tweet— user v tweets
Time
Predicting Twitter Engagement Using ML
User: HadiJayaPutra
Results
Testing Procedure
• Build model for each user separately
• Training: 45 days
• Testing: 4 days
• Look back 10 steps
• Predict ahead 1 step
• 0-1 Loss
• Compare to “majority vote” baseline
Predicting Twitter Engagement Using ML
CSM vs. ESN
CSM vs. ESN
User: DanielZeevi
Base Rate:
CSM Rate:
ESN Rate:
0.4506
0.9477
0.9419
Forecasting High Tide:Predicting Times of Elevated
Activity in Online Social MediaDavid Darmon, Jimpei Harada, William Rand,
and Michelle GirvanASONAM, 2015
Conclusions
• Machine Learning plus Agent-Based Modeling provides a robust and powerful solution to harnessing the power of big data
• This method can provide predictive power that exceeds traditional aggregate methods
• Limitation: Requires high-resolution time series data
Future Work
• Construction of a software platform that would automatically generate agent-based models in a uniform way
• Implementation on GPGPU architectures
• Tests of the long-range predictive power of these models
ElaboratedandRealisticModels
• ManyABMsareverysimple• ElaboratedandRealisticmodelsaretheopposite
• varietyofmechanisms• useempiricaldata• matchavarietyofoutcomes• moreeasilyfalsifiable
• ImagineaSchellingmodelthatmatchedChicago’surbanpatterning
CriticismsofERModels
• Highlycontingent• Maynotbegeneralizable• Verydifficulttounderstand
FalseDichotomy?
• WedonotneedtochoosebetweensimpleandERmodels
• PatternOrientedModeling(POM;Grimmetal.,2006)arguesthatonemodelshouldbeabletoreplicatepatternsatmultiplelevelsofgranularity
• ThiscouldentailamodelthatisbothERandgeneralizable
• However,suchasingularperfectmodelmightbedifficulttocreate
FullSpectrumModeling
• FullSpectrumModelingistheideathatweshouldcreateasuiteofmodelsatdifferentlevelsofgranularity
• Youcanconstructsimplemodelsandelaborateandrealizethemasnecessarytocreatespecificmodels
• Simplemodelsexplorethenecessityandimportanceofmechanisms
• ERmodelscanexplorespecificinstancesandmakeparticularforecasts
ASuiteofModels
• Ratherthanthinkingofmodelsassingularmodels,thinkofthemassuites
• “…killyourdarlings.”-Faulkner
TypicalModelingSetup
• TwoGroupsofResearchers• SubjectMatterExperts• ModelImplementers
• TypicalModelingLifecycle1. SMEsdesignmodel2. Modelimplementersbuildmodel3. ImplementerspresentresultstoSMEs
ProblemswithTypicalSetup
• Modeldesignsarerarelycomplete• Earlyresultscouldhavedramaticimplicationsformodeldesign
• Lackofcommunicationresultsinlackofunderstanding
• Saying“That’swhatthemodelshows.”isneverenough,modeldesignersneedtounderstandwhythemodelshowsthat
IterativeModeling
• Itisimportantformodeldesignerandimplementertocommunicateoften
• NewModelingLifecycle1. SpecifyMinimalModel2. ImplementMinimalModel3. CommunicateResults
A. ReviseModelDesignB. Collectadditionaldataasnecessary
4. ExpandMinimalModelMinimally,goto#1• FailFast• Just-In-TimeModel(JIT)Construction
ABMsthatarenotforResearch
• MostofwhatwehavediscussedisABMsinthecontextofscientificresearch
• ButABMcanbeusedinothercontextsaswell• Communication• Persuasion• Education• DecisionSupport
TheProblemwithComplexSystems
• ComplexSystemsoftenrequireknowledgeformultiplesubjectareas,butalsoknowledgefromdifferentbackgrounds
• e.g.,Urbanplanning• scientists• policymakers• citizens• businesses• citymanagers• emergencyservices
ABMasCommunication
• AnABMcanbecreatedasan“objecttothinkwith”(SeymourPapert),i.e.,asharedfocalobject
• Thiscanthenbepotentiallyunderstoodandexaminedbyallstakeholdersasacommunicationtool
• UsingalanguagelikeNetLogofacilitatesthisbyprovidingasimplelanguagetounderstand
• ImagineCitySimasasolutiontooururbanplanningproblem
ABMsasPersuasion
• Nowthatthemodelhasbeenconstructedandcommunicated
• StakeholderscanuseCitySimtoarguefortheirownpolicies
• “policyflightsimulator”-Holland,1996
ABMasEducation
• Thesamemodelcouldalsobeusedtoeducatestudentsabouthowcomplexsystemswork
• ABMhasbeenusedforchemistry,materialsscience,electromagnetism,andevolutionamongmanyothersubjects
• ABMenableslearningbecausemicro-rulesareofteneasiertounderstandthanmacro-behaviors
• ABMencouragesagenerativeunderstandingofphenomenon
ABMasDecisionSupport
• ABMcanbeusedtoexploretheeffectofawidevarietyofstrategies
• Forinstance,explorehowtouseABMtoidentifyoptimalword-of-mouthmarketingdecisions(inpress,JMR,ChicaandRand)
AnonymousProcedures
• AnonymousProceduresarebitsofcodethatwedonotgivenamestoandthenwecanpasstheseprocedurestootherprocedurestosolvecomplexproblems
• SETSETUP1[[]->RANDOM4]• SETSETUP2[[]->BLUE]• ASKPATCHES[SETPCOLORRUNRESULTSETUP1(orSETUP2)]
RUN/RUNRESULT
• RUNandRUNRESULTbothtakestrings,setsofcommandsoranonymousprocedures,i.e.,“code”andrunthem
• Thisallowsyoutodynamicallycreatecodeduringtherunofthemodel
• ThedifferenceisthatRUNRESULTreturnsaresult,i.e.,areporter
• RUN[BK1LT90RT90]• SETHEADINGRUNRESULT[90+45*2]
MAP
• MAPtakesareporterandalistandappliesthereportertoallelementsofthelist
• map[val->round(val/1000)][34678125000758902500035123]
• (companyrevenuein1000s)• (map[[revemp]->round((rev/emp)/1000)][34678125000758902500035123][10100203050])
• (companyrevenueperemployeeinthousands)• fromElFarol
• sum(map[[weightweek]->weight*week]butfirststrategysubhistory)
REDUCE
• REDUCEtakesalistandappliesonereportertoeachiteminthelistfromlefttoright• (reduce+[35104542835])/5
• Average• reduce[[input1input2]->ifelse-value(input2=35)[input1+1][input1]][035104542835]• Countsnumberofoccurrencesof35
ParticipatorySimulation
• ParticipatorySimulationisthecreationofsimulationthatincorporateinputfromhumanagentsalongwithsimulatedagents
• InNetLogo,thisisimplementedviaHubNet• Forinstance,intheHubNetDiseasemodelyoucancontrolhumanstryingtoavoidcatchingadisease
CreatingaHubNetModel
• Basicarchitecture• Onecomputeristheserver(host)• Othercomputers/terminalscanconnecttothiscomputer(clients)
• Steps1. InitializeHubNet(HUBNET-RESET)2. Listentoclients(HUBNET-MESSAGE-WAITING?,HUBNET-FETCH-MESSAGE)3. Processmessages(HUBNET-ENTER-MESSAGE?,HUBNET-EXIT-MESSAGE?,
HUBNET-MESSAGE-SOURCE,HUBNET-MESSAGE-TAG,HUBNET-MESSAGE)
BasicTechniques
• Manyapplicationsmapaclienttoaturtle• Oftendonebysettingaturtles-ownvariable
• Needtoprogrammaticallysendmessagesfromhosttoclients• Addelementstoclientinterface• HUBNET-SEND
• Customizewhataclientsees• ClientPerspectivesandClientOverrides
SystemDynamicsModeling
• SDMrepresentscomplexsystemsusingnumericalstatesoftheworldcalledstocksandchangesinthosestatescalledflows
• InNetLogothereisatoolcalledSystemsDynamicsModeler,whichissimilartoothertoolkits,e.g.,STELLA
• SDMcanbeusedincombinationwithABM
Wolf-SheepPredation(docked)
• ThismodelshowshowyoucancompareABMandSDMmodels
• ABMhasdiscreteunits,whileSDMtendstorepresentthingsincontinuousvariablessotheresultscanbedifferent
Tabonuco-YagrumoHybridModel
• ThismodelcontainsahybridofABMandSDM• TheABMcontrolsthelocationoftrees,whileSDMcontrolsthedeathandbirthoftrees
ExtensionsAPI
• TheextensionsAPIinNetLogogivesyoutheabilitytocreatenewcommandsfortheNetLogolanguage
• OftenthisisdonetogiveNetLogoaccesstoexternalsoftwarepackages
• e.g.,GISandNetworktools
GISExtension(gis)
• Givesyoutheabilitytoread,writeandinteractwithGISdatainNetLogo• gis:load-dataset• gis:envelope,gis:envelope-union-of,gis:intersecting
• gis:feature-list-of• gis:property-value• gis:draw,gis:set-drawing-color
NetworkExtension(nw)
• Givesyoutheabilitytogeneratestandardnetworksandcalculatestatisticsaboutthem• nw:generate-preferential-attachment• nw:generate-random• nw:betweenness-centrality
LevelSpaceExtension(ls)
• TheLevelSpaceExtensiongivesyouthepossibilitytocallothermodelsfromyourmodel• ls:reset• ls:create-models• ls:ask• ls:models
TheControllingAPIandtheMathematicaLink
• NetLogocanbeinvokedbyanotherprogramifthatprogramisrunningontheJavaVirtualMachine
• ThismeansyoucancallNetLogocodefromJava,Scala,Clojure,Groovy,JRuby,Jython,etc.
• TheMathematicaLinkoperatessimilarlyallowingyoutocallNetLogocodefrominsideMathematica
FutureofABM
AutomaticGenerationofAgentRules
• Moreworkneedstobedoneabouthowtocreaterulesfromdatasourcesautomatically
• Theserulesalsoneedtobevalidated• CausalStateModelingisoneexampleofthis• Newsourcesofdata:bigdata,administrativedata,naturallanguagedata,socialdata,appdata
ImprovedMethodsofValidationandCalibration
• Weneedrigorousguidelinestofollowtoshowthatourmodelshavebeenvalidatedappropriately
• A“statistics-like”suiteoftests• MaketoolslikeBehaviorSearcheasiertousesothatuserscaneasilycalibratemodels
ModelsUsingStreamingData
• Ifwecanbuildmodelsautomatically,andcontinuouslyvalidatethemthenwecouldconstructamodelthatwascontinuallyupdatingonthebasisofstreamingdata
• Wecouldthenusethistosupportdecision-makinginrealtime
Unit9Overview
• BigData+ABM• DesignGuidelinesofABM
• OtherUsesofABM• AdvancedProgrammingConstructs
• ParticipatorySimulation
• SystemDynamicsModeling
• Extensions• FutureofABM• Unit9Slides• Unit9Test