CalculatePopChange: Population change.

Description Usage Arguments Value References Examples

View source: R/CalculatePopChange.R

Description

Calculate the change in population size between two times. When only one time is specified, the population size at that time is returned.

Usage

1
2
CalculatePopChange(model.out = NULL, variable = NULL, t1 = NULL,
  t2 = NULL, ratio = TRUE)

Arguments

model.out

an output from one of the following functions or a list with equivalent structure: SolveIASA, SolveSI or SolveTC.

variable

string with the name of the the output variable for which the change are to be calculated (see the variable argument for PlotModels.

t1

value specifying the first time.

t2

value specifying the second time.

ratio

logical. When TRUE, the calculated change is based on poulation size at t2 divided by population size at t1. When FALSE, the calculated change is based on poulation size at t2 minus population size at t1.

Value

Value representing the ratio (if ratio is TRUE) or the difference (if ratio is FALSE) between population size at time t2 and t1. If only one time is specified, the value is the population size at that time.

References

http://oswaldosantos.github.io/capm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## SI model

# Parameters and initial conditions.
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.
solve_si_pt = SolveSI(pars = pars_solve_si, 
                             init = init_solve_si, 
                             time = 0:15, dd = 'b',
                             im = 100, method = 'rk4')

# Calculate the population change (ratio) between times 0 and 15.
CalculatePopChange(solve_si_pt, variable = 'n', t2 = 15, t1 = 0)

# Calculate the population change (difference) between times 0 and 15.
CalculatePopChange(solve_si_pt, variable = 'n', t2 = 15,
                   t1 = 0, ratio = FALSE)

# Calculate the population zises at time 15.
CalculatePopChange(solve_si_pt, variable = 'n', t2 = 15)

capm documentation built on May 29, 2017, 12:34 p.m.

Search within the capm package
Search all R packages, documentation and source code