Introduction - a100.gov.bc.caa100.gov.bc.ca/.../r53038/UsersGuide_1515007905695… · Web viewFor...
Transcript of Introduction - a100.gov.bc.caa100.gov.bc.ca/.../r53038/UsersGuide_1515007905695… · Web viewFor...
PVR_invas.R User’s Guide
Brett van PoortenBritish Columbia Ministry of Environment, Conservation Science
Section
2202 Main Mall, Vancouver, BC, V6T 1Z4
December, 2017
Table of Contents
Introduction.............................................................................................................................. 3
Model description................................................................................................................... 3
Parameters and controls.................................................................................................... 11
Running the model............................................................................................................... 12
Evaluating a single removal strategy..........................................................................................12
Evaluating multiple removal strategies....................................................................................14
References............................................................................................................................... 20
Introduction
PVA_invas.R is a population viability analysis simulator designed to quickly and
accurately reflect uncertainty in the fate of invasive populations. Specifically, the
model evaluates how candidate removal strategies targeting different life stages will
affect population persistence. Further, given a list of potential removal strategies
and removal gears or combination of gears, the model can run each and provide a
multicriteria utility decision table where factors such as probability of eradication,
cost and probabilistic range of abundance after nT years is reported. Each model
evaluation is relatively rapid (~ 6 seconds for 1000 simulations of the smallmouth
bass simulation described here), so the model can be used in a workshop-type
discussion to evaluate different options in real-time, promoting effective
communication among stakeholders as to the efficacy of all methods.
The model can be used for any species or population with indeterminate growth
(e.g. most fish, reptiles, amphibians and invertebrates). Populations are separated
into two life stages: pre-recruits and juveniles/adults. Pre-recruits are subject to
density-dependent mortality and can in turn be separated into multiple stanzas,
where the strength of density dependence in each stanza is user defined. Recruited
animals are age-structured; mortality of these animals decreases with length. Age at
recruitment can be adjusted and the number of stanzas can be increased to
represent prolonged density dependent mortality over multiple juvenile ages.
This user’s guide first describes the biological model so user-provided inputs can be
understood within the context of the model. User-provided parameters and controls
are then defined. Finally, a step-by-step guide to using the functions is provided
with examples to show users how to evaluate new populations with the model.
Model descriptionAll model controls, indices, parameters and derived variables are listed in Table 1;
equations are listed in Table 2. The model begins by establishing stock-recruitment
parameters from calculations of equilibrium population structure when
unexploited. Length- (T1.1), weight- (T1.2) and fecundity-at-age (T1.3) are first
calculated. Instantaneous mortality of recruited animals is assumed to be inversely
related to length, following the Lorenzen (2000) model. Asymptotic mortality rate is
calculated from A, the maximum age observed in the population, which is assumed
to have a lifetime survivorship of 1% (i.e. 1% of recruited animals live to A). Back-
calculation of M∞ proceeds similar to the method of Hoenig (1983; T1.4). Survival in
each time-step follows Lorenzen (2000; T1.5), which is used to calculate
survivorship (T1.6) to each age. The product of survivorship and fecundity-at-age
for females provides equilibrium spawners per recruit (T1.7), which is used to
calculate Beverton-Holt recruitment parameters (Walters and Martell, 2004).
Beverton-Holt parameters are modified by relative mortality and habitat capacity
for each pre-recruit stanza (T1.8-T1.9) to give stanza-specific Beverton-Holt
recruitment parameters (which scale mortality by density of competitors within a
cohort; Walters and Korman 1999, Pine et al. 2013). If cannibalism is thought to
occur in pre-recruit stanzas (i.e. pcann>0), the maximum survival of each stanza is
modified as a log-linear relationship with cannibal abundance (where cannibalistic
ages are specified by the user; T1.12-13). This formulation is based on the
reformulation of the Beverton-Holt model of the form (Walters and Korman, 1999)
(1)R=
N 0 e−M 0
1+M1
M 0 (1−e−M 0 )
where e−M 0 is maximum survival at low spawning stock and M 1
M 0(1−e−M 0 ) is the
carrying capacity parameter. In the case of cannibalism, M 0 can be modified as a
function of likely cannibalistic age-classes:
(2) M 0=ρ+τC
Table 1: Model controls, indices, parameters and derived variables used in PVA_invas. Parameter values shown are biological parameters used for the smallmouth bass example.Symbol Value
Spreadsheetname Description
Controlsdt 0.25 dt Length of time-step (years)nT 50 nT Number of time-stepsns 2 nS Number of stanzasAR 1 AR Age-at-recruitmentng 2 n.gear Number of capture gears for recruited animalsnsim 1,000 n.sim Number of population simulationssampt 1 samp.t Time-step when each control gear for recruited animals is usedr 0.05 r Standard economic discount rateG 20 G Human generation time (set large to ignore inter-generational discounting
qR 0.1; 0.1 q.R Maximum catchability of each pre-recruit gear (proportion of stanza captured per unit sampling effort at low abundance)
qA 0.1, 0.1 q.A Maximum catchability of each size-selective gear for recruited animalststart 1 t.start Time-step when sampling begins (allows for delayed start time)EfR,s 0; 0 E.R Sampling effort per time-step for pre-recruit stanzasEfA,g 0; 0 E.A Sampling effort per time-step for recruited animals
va 25; 15 v.a Proportional to rate of increase of ascending limb of dome-shaped selectivity function
vb 0.7; 0.5 v.b Proportional to length at 50% selectivity on ascending limb of selectivity functionvc 0; 0.5 v.c Proportional to rate of decline on descending limb of selectivity function (0 < vc < 1)Cf,R 2,000; 2,000 C.F.R Annual fixed cost of using each pre-recruit removal gearCf,A 2,000; 2,000 C.F.A Annual fixed cost of using each post-recruit removal gearCE,R 100; 100 C.E.R Cost per unit effort for each pre-recruit removal gearCE,A 100; 100 C.E.A Cost per unit effort for each post-recruit removal gear
Indicest {1, 2, …, nT/dt} Time-step (can be sub-annual if dt < 1)a {AR/dt,…,A/dt}dt Age from age at recruitment to oldest age-class in dt stepsi {1, 2, …, Et} Individual numbers {1, 2, …, ns} Recruitment stanzag {1,2,…,ng} Capture gear for recruited animals
Model parametersR0 1000 R0 Unexploited recruitsκ 9.24 reck Compensation ratio in recruitmentpcann 0.2 p.can proportion of pre-recruit mortality at equilibrium due to cannibalismK 0.25 K Metabolic rate parameter of von Bertalanffy functionA 15 A Maximum age (e.g. probability of survival to age A=1%)a f 6,000 afec Fecundity multiplier on weightwm 0.4 Wmat Weight at maturity relative to asymptotic weightt spn 0.0; 0.1 t.spn Start and end of spawning time as proportion of yearM s
¿5; 8 Ms Maximum survival for each pre-recruit stage (relative values)
Bs¿ 10; 9 Bs Available habitat for each pre-recruit stage (relative values)
V 1 200 V1 Initial number of vulnerable animalscanna {5,…,15} cann.a Ages that may be cannibalistic on pre-recruits (if pcann>0)σ R 0.5 sd.S Standard deviation in recruitment
Derived variablesla Lengthwa WeightM∞ Minimum instantaneous mortalityf a Fecundityspnt Time-steps when spawning occurs (0/1 flag)
spna Ages when spawning occurs (0/1 flag)Sa Survivalva ,g Selectivity of gear-glxa Survivorshipφ0 Unexploited eggs-per-recruitα ¿ Maximum survival of Beverton-Holt recruitment functionβ¿ Carrying capacity parameter of Beverton-Holt recruitment function for each stanza-sα s
¿ Maximum survival of Beverton-Holt recruitment functionβ s
¿ Carrying capacity parameter of Beverton-Holt recruitment function for each stanza-sRt Annual recruitment to age-AR
N t ,s Population abundance for pre-recruited animals in year-t and stanza-sN t ,a Population abundance for recruited animals in year-t and age-aEt Annual egg productionC t , g Annual catch by gearqN Density-dependent catchabilityF t , a Instantaneous sampling mortality rate by age-class
Table 2: Functions used to initialize the population viability analysis model
T2.1 la=1−e−Ka
T2.2 wa=la3
T2.3 f a=af (wa−wm )
T2.4M∞=
ln (0.01 ) K
ln (l a=A R )− ln [la=A R+e
K (A−AR )dt −1]
T2.5 Sa=( lala+e
K ∙ dt−1 )M∞
K
T2.6 lxa={ 1 a=AR
∏a=A R
a−1
Sa a>AR
T2.7 φ0=∑a=1
A lxa f a spna2
T2.8 α s=κφ0e( M s
∑ M s)
T2.9βs=B s
¿ κ−1
R0φ0∑s'
( βs'¿ ∏s' '=0
s' '=s'−1
α s' ')T2.10 M s
0=− ln (α s )=ρ s+τ s[R0 ∑a=canna
(lx a spna ) ]T2.11 M s
1=βsM s
0
1−α s
T2.12 ρ s=M s0 (1−pcann )
T2.13 τ s=M s0 pcannR0 ∑
a=canna(lx a spna )
T2.14 Et=1=∑i=1
N t=1
f a
where ρ is mortality independent of cannibals, τ is the cannibalism-dependent
parameter and C is the sum of animals in age-classes where cannibalism may occur
(user defined). This altered formulation results in approximately Ricker-type
recruitment (e.g. overcompensation at high spawner abundance).
Abundance of recruited animals in the first year is determined in one of two ways. If
the population is close to carrying capacity (i.e. V 1≥0.9 R0∑ lxa), abundance is
randomly allocated among age-classes assuming a multinomial distribution
(3) N t=1, a MN (V 1 ,lx aeε a );εa N (0 , σR )
where random year-class strength is given by ε a. This approximation is useful if the
population is close to carrying capacity but will under-represent early year-classes
if the population is still growing because of the steady-state assumption.
Additionally, if initial abundance is low, there is a chance that all mature year-
classes will be empty, causing a lag in egg production in early years; this will result
in population growth being low in the first several years (depending on generation
time). Therefore, if the initial abundance is below 90% of carrying capacity, initial
age-structure is established by deterministically simulating the population from a
low abundance (starting with 10e-15 recruits) until the population reaches the user
defined starting abundance (V1). This initialization proceeds by first calculating the
abundance of each age-class
(4) N t ,a¿ =N t−1 ,a−1
¿ Sa−1
where N* refers to numbers in the initialization. Eggs (Et ,a¿ ) in each initial time-step
are calculated as the product of numbers-at-age and fecundity-at-age (T1.3) and
recruitment is calculated using the stage-independent Beverton-Holt function
(5)N t ,a=1
¿ =E t−1
¿ e−(ρ+τ C t )
1+ e−( ρ+τ C t )
M 1(1−e−(ρ+τ C t) ) ,
where
ρ=−ln( κφ0 )(1−pcann ),
τ=−ln ( κφ0 )pcann
R0 ∑a=canna
(lx a spna)
and
M 1=
(κ−1 ) ln( κφ0 )R0 (κ−φ0 )
.
These parameters are the stage-independent analogues to T1.11-T1.13. Regardless
of how the population is initiated, egg production in the first year will be given by
T1.14.
Recruitment in subsequent years is based on survival through each pre-recruit
stanza. Survival from one stanza to the next is given by the product of focused
removals and the stanza-specific stock-recruitment function
(6) N t ,s+1 BIN ¿,
where
(7) M s , t0 = ρs+τ s ∑
a=canna(N t , a )
and
(8) F s=qs Es;
that is, the product of capture efficiency of gear focused on stanza-s and the units of
effort used each time-step. Survivors from the last pre-recruit stanza become
N t+AR−1 ,a=AR.
Survival of each recruited age-class each time-step is given by the Baranov equation
(Ricker, 1975)
(9) N t+1 ,a+1 BIN (N t ,a , e−Z t ,a )
where
(10) Zt ,a=M a+Ft ,a
and
(11) F t , a=∑g=1
ng
qN , gE t , g va , g.
Et , g is set to zero except for time-steps corresponding with time of year that gear is
used, which is specified by the user.
Each control gear is described by a density-dependent constant of proportionality
(termed catchability in fisheries literature) that relates catch-per-unit effort to
abundance, or equivalently, removal effort to instantaneous removal mortality
(Arreguin-Sanchez, 1996). Catchability may be density dependent for a number of
reasons, but a likely mechanism in aquatic invasive species in due to the change in
individual home range size as the population grows (e.g. the population is more
densely packed as it fills the population spatial range). This results in non-linear
increase in invaded area with abundance. The area occupied by the population is
determined by
(12) AN=γ N β,
where γ is the density-independent rate of increase in the area occupied by the
population as the population grows and β is the rate at which animals reduce their
density with population abundance. Catchability is the proportion of area affected
by the removal gear
(13) qN=δAN
,
where δ is the area swept by one unit of removal gear. These two equations can be
combined into the standard equation for hyperstability:
(14) qN=q N−β.
The q parameter is probability of capture at low abundance. To determine the two
unknown parameters φ and β , it is best to think about how catch per unit effort
would change as the population grows. For example if fishing with a single unit of a
gear at population abundances N1=50 and N2=200 were to yield CPUE1=5 and
CPUE2=15, β could be calculated as
(15) β=1− ln (5 )−ln (15 )ln (50 )−ln (200 )
=0.207.
Noting that qN=CPUEN , Eq. 15 can be substituted into Eq. 14 to give q=0.225.
Equations 6-11 are repeated for nT years. This entire procedure is repeated n¿
times; The proportion of n¿ simulations that resulted in eradication by the end fo the
simulation (nT) gives the probability of extirpation given the sampling procedures
and removal effort specified by the user.
Parameters and controlsThe biological population viability function in the R script (the PVA() function) runs
given inputs of controls and parameters. Parameters for the population being
modelled are set in a .csv file with the naming convention “species parameters.csv”
(e.g. “SMB parameters.csv”); Controls are similarly set in a separate .csv file (e.g.
“SMB controls.csv”). The prefix to these file names (“SMB” in this example) are used
to differentiate populations/species. This prefix is called when running the R script.
Parameters define the biology of the population being modeled and are described in
Table 1. Parameter values listed in Table 1 are those used for the smallmouth bass
(Micropterus dolomieu) case study shown below, but another population or species
could be quickly substituted. In cases where multiple values are indicated for a
single parameter, they must be separated in the spreadsheet using a semi-colon (e.g.
Ms: 5;8). The number of values provided for Ms and Bs must equal the number of
pre-recruit stanzas (nS). Any number of age-classes can be provided for canna as long
as they are between AR and A.
Controls are used to define important indices (e.g. nT, ns, etc.) and provide important
changes to the model associated with removal intensity and cost of removal (Table
1). As in parameters, multiple values in the spreadsheet must be separated using a
semi-colon (e.g. q.R: 0.1; 0.1). The number of values provided for q.R, E.R, C.F.R and
C.E.R must equal the number of stanzas (nS); the number of values provided for q.A,
E.A, C.F.A and C.E.A must equal the number of gears used to sample recruited age-
classes (ng).
Running the model
Evaluating a single removal strategyThere are two functions of importance to most users of PVA_invas.R:
heat.proj() and decision(). Other functions (getLHpars(), set.pars(),
init(), PVA(), show.vuln() and vwReg2()) support the main functions (e.g.
reading values from .csv files), but understanding them is not needed to run the
model.
The first step in running the model is providing parameters in the .csv files. Use
the .csv files provided as a guide. The naming conventions are important, especially
within the files themselves. For example, all names provided in column A of the
controls and parameters .csv files must be maintained, as they correspond to
parameters and indices called within the R code. Controls should be relatively easy
to determine and multiple control options can be evaluated in the Scenarios .csv file.
Parameters may be more difficult to determine, but most can can be obtained from
either the literature or a good biological understanding of the species.
To begin running the PVA_invas.R script, open an R console (or an R user interface
like RStudio) and source the program PVA.R (source('C:/PVA_invas.R')).
This loads the script into memory so R can be run quickly.
A simple model run can be completed and visually evaluated by entering
heat.proj(species=”SMB”). This calls the heat.proj() function using baseline
controls and parameters provided in ‘SMB controls.csv’ and ‘SMB parameters.csv’,
respectively. An optional vector of R0 values of length nsim can also be entered if the
asymptotic recruitment density (carrying capacity) is uncertain (e.g
heat.proj(species=”SMB”,R0s=runif(1000,1000,10000)). The
heat.proj() function (details below) calls the init() and PVA() functions, which
calculate the population initial parameters and size-structure and subsequent
trajectories across each of nsim simulations. The probability of population extirpation
is reported and results are sent to vwReg2(), which plots the distribution of
population projections over T years. Model output and plot can be saved to an object
such as pva by entering pva<-
heat.proj(species=”SMB”,R0s=runif(1000,1000,10000). pva is now a
list with entries: dat and plot. The population projection plot can be drawn by
entering pva$plot. pva$dat is also a list including objects described in Table 3.
To view any of these objects, simply enter pva$dat$NAME where NAME is the
object name.
> source('~/Dropbox/Invasive removal/PVA_invas.R')New species or populations can be evaluated by changing parameters.To update parameters, controls, effort, etc., update your csv filesType 'heat.proj(species,R0.vec) to plot results for a single parameter.Type 'decision(species,R0.vec)' to run all scenarios and evaluate.
> pva<-heat.proj(species="SMB",R0.vec=runif(1000,1000,10000),set.ymax=50000)Initializing populations ...Time difference of 0.6698229 secsCalculating population projections ...Time difference of 5.941278 secsProbability of extirpation after: 12.5 years - 0 % 25 years - 0 % 50 years - 0 %Computing density estimates for each vertical cut ... |===========================================================================| 100%Build ggplot figure ...>
Controls can be varied to evaluate different removal strategies. For example, q.R is
used to set the proportion of each pre-recruit stanza that can be removed with each
unit of sampling effort; E.R sets the number of sampling units used per year and
C.f.R and C.E.R set the fixed annual costs and effort-based costs of using each
sampling gear each year. Setting E.R=0 means no removal strategy is used on the
stanza being referred to. Likewise, q.A sets the proportion of vulnerable recruited
animals that can be removed per unit of each sampling gear focused on recruited
animals. The number of different gears (or the same gears used at different times of
year (samp.t)) is set using n.gear. Similar to pre-recruit gear, E.A, C.f.A and C.E.A set
the amount of effort, as well as fixed and effort-based costs for each gear focused on
recruited animals. The dome-shaped length-based selectivity function is set for each
gear using v.a, v.b and v.c. Finally, a time delay in control measures can be examined
by using t.start > 1, which allows users to evaluate how delayed response may affect
the final abundance.
Evaluating multiple removal strategiesTo evaluate a new removal strategy, values in the control.csv file must be updated,
saved and heat.proj() re-ran. Alternately, multiple removal strategies can be
compared against one another using decision(). The decision() function will
evaluate as many combinations of sampling methods as necessary and provide a
multi-attribute decision table that shows annual cost, net present value of sampling
until the time series is complete or the population is eradicated, time to eradication
and final abundance (if the population persists). Running decision() requires
creating a scenarios.csv (using the same naming convention as above, i.e. ‘SMB
scenarios.csv’). The scenarios.csv contains only controls that differ between
scenarios. For example, if only effort varies across scenarios, that is all that needs to
be included. The controls.csv must indicate the maximum number of gears that will
be used (even if some are not used in some scenarios) and include catchability (q.R;
q.A), effort, fixed and effort-based costs for all gears.
Now you are ready to run your own invasive species eradication evaluation. I have
purposely left my raw code online so users with more advanced R skills can
customize the functions to suit their needs.
Table 3: Objects returned in PVA$datObject DescriptionA.s Stage-specific maximum survival of Beverton-Holt function
B.s Stage-specific carrying capacity parameter of Beverton-Holt function
cost.1 Annual cost of sampling
cost.T Total cost of sampling up to end of time series or time to 100% eradication
Et Matrix of eggs produced per year for each simulation
NPV Net present value of sampling, accounting for intergenerational discounting
Nt Abundance array (dimensions: time-steps, ages, simulations)
NT Abundance in the final time-step (reported as 5th percentile, mean and 95th percentile of distribution)
p.extinct Vector of proportion of simulations eradiated for each time-stepp.extinct.50 Proportion of simulations eradicated by 50th time-step
p.extinct.100 Proportion of simulations eradicated by 100th time-step
p.extinct.200 Proportion of simulations eradicated by 200th time-step
phie Equilibrium eggs-per-recruit
R.A Beverton-Holt maximum survival parameter (stage-independent)
R.B Beverton-Holt carrying capacity parameter (stage-independent)runtime Time to complete simulationt.extinct Years to 100% eradicationVfin Vector of total abundance in the final year across simulations
Figure 1: Smallmouth bass trajectory distribution plot using values described in
Table 1. Hot colours indicate higher density of population abundance probability.
The first column is a list of scenario names, and all subsequent columns are controls
that will change among scenarios. As an example, Figure 2 shows a scenarios.csv file
created for smallmouth bass removal. In this example, there are two pre-recruit
stanzas and two gear to remove recruited fish (the vulnerabilities for each are
defined in the controls.csv file). In this example, 24 units of removal effort will be
applied, but which gear and stanza is targeted is varied. Additionally, I compare
starting removal immediately with delaying for 5 years (20 time-steps). The
decision() function runs each scenario in turn and produces a decision table
(Figure 3).
> decision(species="SMB",R0.vec=runif(1000,1000,10000))Initializing populations ...Time difference of 0.267473 secsScenario: now juv1Calculating population projections ...Time difference of 5.390681 secsScenario: now juv2Calculating population projections ......Scenario: wait allCalculating population projections ...Time difference of 6.116888 secsDrawing decision table>
Figure 2: Screenshot of SMB scenarios.csv, where the only factors that differ among
scenarios is relative effort applied to each of four removal gears (targeting two pre-
recruit stanzas and two methods for recruited animals) and a time delay.
Figure 3: Decision table produced from smallmouth bass removal scenarios shown
in Figure 2. Labels on left refer to scenarios named in column A of ‘SMB
scenarios.csv’. Total cost is net present value to the end of the time series or total
100% eradication (whichever comes first).
ReferencesArreguin-Sanchez, F., 1996. Catchability: assessment a key parameter for fish stock.
Rev. Fish Biol. Fish. 6, 221–242.
Hoenig, J.M., 1983. Empirical use of longevity data to estimate mortality rates. Fish.
Bull. 82, 898–903. doi:10.2307/1940001
Lorenzen, K., 2000. Allometry of natural mortality as a basis for assessing optimal
release size in fish-stocking programmes. Can. J. Fish. Aquat. Sci. 57, 2374–
2381.
Pine, W.E.I., Healy, B., Smith, E.O., Trammell, M., Speas, D., Valdez, R., Yard, M.,
Walters, C., Ahrens, R., Vanhaverbeke, R., Stone, D., Wilson, W., 2013. An
individual-based model for population viability analysis of humpback chub in
Grand Canyon. North Am. J. Fish. Manag. 33, 626–641.
Ricker, W.E., 1975. Computation and interpretation of biological statistics of fish
populations. Bull. Fish. Res. Board Canada 1913890, 382pp.
Walters, C., Korman, J., 1999. Linking recruitment to trophic factors: revisiting the
Beverton-Holt recruitment model from a life history and multispecies
perspective. Rev. Fish Biol. Fish. 9, 187–202.
Walters, C., Martell, S., 2004. Fisheries ecology and management. Princeton
University Press, Princeton.