Learn R Programming

capm (version 0.9.1)

SolveSI: Modelling of sterilization and immigration of comapnion animals.

Description

System of ordinary differential equations to simulate the effect of sterilization and immigration on population dynamics.

Usage

SolveSI(pars = NULL, init = NULL, time = NULL, dd = "b", im = 0, s.range = NULL, ...)

Arguments

pars
vector of length 4. The values are point estimates of birth rate, death rate, carrying capacity and sterilization rate. The names of this values must be "b", "d", "k" and "s", respectively.
init
vector of length 2. The values are initial population size and initial proportion of sterilized animals. The names of this values must be "n" and "q", respectively.
time
time sequence for which output is wanted; the first value of times must be the initial time.
dd
string equal to b or d to define if density-dependece act on birth or death rartes respectively.
im
a number representing the total of immigrants per time unit.
s.range
optional sequence (between 0 and 1) of the sterilization rates to be simulated.
...
further arguments passed to ode function.

Value

list. The first element, name, is a string with the name of the function, the second element, model, is the model function. The third, fourth and fifth elements are vectors (pars, init, time, respectively) containing the pars, init and time arguments of the function. The sisxth element results is a data.frame with up to as many rows as elements in time. First column contains the time, second column the population size and third column the proportion of sterilized animals. If s.range is specified, fourth column contains its specific instances.

Details

The implemented model is described by Amaku, et. al., 2009 and the function is a wrapper around the defaults of ode function, whose help page must be consulted for details.

References

Amaku M, Dias R and Ferreira F (2009). Dinamica populacional canina: potenciais efeitos de campanhas de esterilizacao. Revista Panamericana de Salud Publica, 25(4), pp. 300-304.

Soetaert K, Cash J and Mazzia F (2012). Solving differential equations in R. Springer.

http://oswaldosantos.github.io/capm

See Also

ode.

Examples

Run this code
# Parameters and initial conditions from estimates   
# obtained in examples section from svysumm function but
# estimating a proportion insted of a total for births.
pars.solve.si = c(b = 0.245, d = 0.101, 
                 k = 98050, s = 0.048)
init.solve.si = c(n = 89137, q = 0.198)

# Solve for a specific sterilization rate.
solvesi.pt = SolveSI(pars = pars.solve.si, 
                     init = init.solve.si, 
                     time = 0:15, dd = 'b',
                     im = 100, method = 'rk4')

# Solve for a range of sterilization rates.
solvesi.rg = SolveSI(pars = pars.solve.si,
                     init = init.solve.si,
                     time = 0:15, dd = 'b', im = 100, 
                     s.range = seq(0, .4, l = 50),
                     method = 'rk4')

Run the code above in your browser using DataLab