[R-sig-dyn-mod] Individual-based modelling

Sibylle Mohr Sibylle.Mohr at glasgow.ac.uk
Mon Jul 3 13:49:34 CEST 2017


Dear all,

I want to implement an individual-based model and am unsure how to go about this - here’s to hoping someone can point me in the right direction..

I created a simple model (predator-prey like equations) which predicts the number of scab mites from serological data (i.e. immune response) on a **single** animal (see code below).
Immune response grows with mite count here.
Now I would like to extend the model from a single sheep towards an individual-based model representing the flock of animals with two initial states, “clinical” and "sub-clinical” depending on the how large the immune response is (i.e. small immune response = infested but no clinical signs).
So I guess I have to questions:

(a) How can I go from a single animal model to an individual-based population model?
(b) How can I integrate this into a two-stage model?

Any thoughts are most welcome.

Many thanks & best wishes,

Sibylle

-------------------------------------------------------------------------------------------------------------------------
The code:

## Immune response model 

require(simecol)
require(deSolve)

# P = number of scab mites,
# E = ‘amount’ of protective immunity,
# W = mites in environment
# nu = intrinsic mite growth rate,
# mu*E = per-capita mite death rate,
# epsilon*P = per-capita growth of the immune response
# alpha =  rate of decline of the immune response in the absence of antigenic stimulation
# lambda = parasite environmental production
# gamma= = parasite environmental death
# beta = transmission rate

ImmRespode <- {new("odeModel",
                     main = function(time, init, parms){
                       with(as.list(c(init, parms)),{

                         dP <- P*(nu - mu*E)
                         dE <- -E*(alpha - epsilon*P)
                         dW <- (lambda*E) - (gamma*W) - (beta*W*P)

                         list(c(dP, dE, dW))
                       })
                     },
                     times = c(from = 0, to = 365, by = 0.01),
                     init = c(P = 2, E = 2, W = 0),
                     
                     parms = c(nu = .11, mu = .01, epsilon = .00024, alpha = .00024, lambda = .05, gamma = .05, beta=.05),
                     solver = "lsoda")
}
ImmRespode <- sim(ImmRespode)

print(ImmRespode, all=TRUE)
ImmRespodedata <- out(ImmRespode)	# ?simecol::out

par(mfrow = c(1, 3))
plot(ImmRespodedata[,1], ImmRespodedata[,3], type="l", xlab = "Time Period", ylab = "Immune response", col=2)
plot(ImmRespodedata[,1], ImmRespodedata[,2], type="l", xlab = "Time Period", ylab = "Mite Density")
plot(ImmRespodedata[,1], ImmRespodedata[,4], type="l", xlab = "Time Period", ylab = "Environment")



--
Sibylle Mohr, Ph.D.
Institute of Biodiversity, Animal Health, and Comparative Medicine
College of Medical, Veterinary and Life Sciences
University of Glasgow
464 Bearsden Rd. Glasgow G61 1QH


More information about the R-sig-dynamic-models mailing list