Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Discrete-time individual-based modeling in R i)Write a function that simulates a fixed number of generations of a discrete time individual-based SIR model. Your function should
Discrete-time individual-based modeling in R
i)Write a function that simulates a fixed number of generations of a discrete time individual-based SIR model. Your function should have the following user-specified arguments: initial vector of individual labels (e.g., (S, S, S, I,S)), infection probability p, and number of generations.
ii. Assuming that initially, the population of interest has 9 susceptible individuals, 1 infectious individual, and 0 removed individuals, print 5 realizations of label vectors at each generation, usingp=0.3andr=5.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started