simulate_ms_pva: Run a stochastic simulation for a count-based multi-site...

Description Usage Arguments Value Examples

Description

See Morris & Doak 2002, p. 423-431

Usage

1
2
3
4
simulate_ms_pva(n_years = 100, n_runs = 1000, leaving_prob = 0,
  reaching_prob = 1, with_progress_bar = TRUE, growth_rate_means,
  growth_rate_vars, initial_pops, growth_rate_corrs, K,
  quasi_extinction_thresholds)

Arguments

n_years

A number. How many years should we simulate?

n_runs

A number. How many simulations should we do?

leaving_prob

A number. The probability of an individual leaving a pop. for another pop.

reaching_prob

A number. The probability of an individual reaching safely another pop.

with_progress_bar

A boolean value, to show a text-based progress bar while the simulation runs

growth_rate_means

A vector of mean log(lambdas), one for each pop.

growth_rate_vars

A vector of variance of log(lambdas), one for each pop.

initial_pops

A vector of initial population sizes.

growth_rate_corrs

A correlation matrix of log(lambdas) between pops.

K

A vector of maximum numbers in each pop. (carrying capacity)

quasi_extinction_thresholds

A vector of near extinction threshold for each pops.

Value

A list-based S3 object of class msPVARes containing elements CDFExt, lam0, logLam and stochLam.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## @knitr msExample

res <- simulate_ms_pva(
 leaving_prob = 0.2,
 reaching_prob = 0.5,
 growth_rate_means = c(0.043, -0.002, 0),
 growth_rate_vars = c(0.051, 0.041, 0.051),
 initial_pops = c(70, 26, 33),
 growth_rate_corrs = {matrix(
   c(	1.000,	0.995,   0.896,
   0.995,	1.000,   0.938,
   0.896,	0.938,   1.000),
   nrow = 3,
   ncol = 3,
   byrow = TRUE
 )},
 K = c(286, 60, 58),
 quasi_extinction_thresholds = c(20, 20, 20),
 n_years = 50,
 n_runs = 100,
 with_progress_bar = FALSE

)

print(res)
hist(res)
plot(res)

cmartin/PopulationViabilityAnalysis documentation built on May 13, 2019, 8:23 p.m.