INAscene: Evaluates scenarios in an impact network analysis (INA)

Description Usage Arguments Details Examples

View source: R/INAscene.R

Description

This function implements and summarizes multiple simulations across a designated range of parameter values

Usage

 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
INAscene(
  nreals,
  ntimesteps,
  doplot = F,
  outputvol = "more",
  readgeocoords,
  geocoords = NA,
  numnodes = NA,
  xrange = NA,
  yrange = NA,
  randgeo = NA,
  readinitinfo,
  initinfo = NA,
  initinfo.norp = NA,
  initinfo.n = NA,
  initinfo.p = NA,
  initinfo.dist = NA,
  readinitbio,
  initbio = NA,
  initbio.norp = NA,
  initbio.n = NA,
  initbio.p = NA,
  initbio.dist = NA,
  readseam,
  seam = NA,
  seamdist = NA,
  seamrandp = NA,
  seampla = NA,
  seamplb = NA,
  readbpam,
  bpam = NA,
  bpamdist = NA,
  bpamrandp = NA,
  bpampla = NA,
  bpamplb = NA,
  readprobadoptvec,
  probadoptvec = NA,
  probadoptmean = NA,
  probadoptsd = NA,
  readprobestabvec,
  probestabvec = NA,
  probestabmean = NA,
  probestabsd = NA,
  maneffdir = NA,
  maneffmean = NA,
  maneffsd = NA,
  usethreshman,
  maneffthresh = NA,
  sampeffort = NA
)

Arguments

nreals

number of realizations to be evaluated

ntimesteps

number of time steps to be evaluated

doplot

if true, plots of resulting presence of information and bioentity are generated

outputvol

output volume, where outputvol='less' excludes the list element $multdetails from output, and outputvol='more' includes it in output. $multdetails becomes large quickly for many realizations for large matrices so outputvol='less' would be desirable for extensive analyses

readgeocoords

if T, read in geocoords - otherwise, generate it in each realization

geocoords

matrix of x,y coordinates of nodes

numnodes

(genlocs:nodenum) the number of nodes, can be a vector of different numbers of nodes for scenario comparisons

xrange

(genlocs:extx) range of x coordinates, e.g., c(0,50)

yrange

(genlocs:exty) range of y coordinates, e.g., c(0,20)

randgeo

(genlocs:rand) if TRUE then locations are randomly generated (the only location generation option for the moment)

readinitinfo

info (setup2) if T, the initial values for the vector of starting locations for the presence of information are read in rather than generated

initinfo

info (setup2) the vector of initial values read in if readinitinfo == T, a vector with lenth equal to the number of nodes and entries 1s or 0s with 1s indicating the initial presence of information

initinfo.norp

info (initvals:numorpropi) 'num' indicates initial number for presence, 'prop' indicates initial proportion

initinfo.n

info (initvals:numiniti) the number of initial locations for presence

initinfo.p

info (initvals:propiniti) the proportion of initial locations for presence

initinfo.dist

info (initvals:loctypei) the type of locations where initial presence occurs: 'random' indicates all equally likely, 'upedge' indicates that nodes closest to the upper edge have presence, 'rightedge' indicates that nodes closest to the right edge have presence

readinitbio

bio (setup2) if T, the initial values for the vector of starting locations for the presence of the bioentity are read in rather than generated

initbio

bio (setup2) the vector of initial values read in if readinitbio.s == T, a vector with lenth equal to the number of nodes and entries 1s or 0s with 1s indicating the initial presence of the bioentity

initbio.norp

estab (initvals:numorprope/b) 'num' indicates initial number for presence, 'prop' indicates initial proportion

initbio.n

estab (initvals:numinite/b) the number of initial locations for presence

initbio.p

estab (initvals:propinite/b) the proportion of initial locations for presence

initbio.dist

estab (initvals:loctypee/b) the type of locations where initial presence occurs: 'random' indicates all equally likely, 'upedge' indicates that nodes closest to the upper edge have presence, 'rightedge' indicates that nodes closest to the right edge have presence

readseam

if T, the socioeconomic network adjacency matrix is read in rather than being generated from the outset

seam

socioeconnomic network adjacency matrix, read in if readseam=T (assumed to be structured so that rows are sources and columns are sinks)

seamdist

com (genmovnet) the function of distance used to estimate movement probability - 'random' (not related to distance) or 'powerlaw'

seamrandp

(genmovnet) probability of link existence in random network generated for the socioeconomic network

seampla

com (genmovnet) power law parameter a in ad^(-b)

seamplb

com (genmovnet) power law parameter b in ad^(-b)

readbpam

if T, the biophysical network adjacency matrix, describing dispersal likelihoods, is read in rather than being generated from the outset

bpam

biophysical adjacency matrix, read in if readbpam=T (assumed to be structured so that rows are sources and columns are sinks)

bpamdist

disp (genmovnet) the function of distance used to estimate movement probability - 'random' (not related to distance) or 'powerlaw'

bpamrandp

(genmovnet) if bpamdist='random', the probability a link exists in the biophysical network adjacency matrix

bpampla

disp (genmovnet) power law parameter a in ad^(-b)

bpamplb

disp (genmovnet) power law parameter b in ad^(-b)

readprobadoptvec

if T, read in a vector of probabilities of adoption for each node in socioeconomic network - if F, generate this vector

probadoptvec

vector of probabilities of adoption for each node in socioeconomic network, read in if readprobadoptvec=T

probadoptmean

(makedec) mean probability of adopting management if informed

probadoptsd

(makedec) sd in truncated normal distribution of probability of adoption

readprobestabvec

if T, read in a vector of probabilities of establishment for each node in biophysical network - if F, generate this vector

probestabvec

vector of probabilities of establishment for each node in biophysical network, read in if readprobestabvec=T

probestabmean

(estab) mean probability of establishment (new or CONTINUED) in absence of management

probestabsd

(estab) sd of probability of establishment in absence of management in truncated normal distribution

maneffdir

if maneffdir='decrease_estab', the management reduces the probability of establishment; if maneffdir='increase_estab', the management reduces the probability that establishment does NOT occur

maneffmean

(estinfo, estab) the underlying mean change in establishment probability (as a proportion) resulting from management technology

maneffsd

(estinfo, estab) the standard deviation of the management technology effect

usethreshman

() if T, the threshold for management is used, so that information is never present anywhere unless the management effect estimate exceeds the threshold

maneffthresh

(estinfo) the threshold effect size for communicating about management

sampeffort

(estinfo) the sampling effort, where increasing sampling effort results in a more precise estimate of the management effect size

Details

Updated 2020-10-06

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
j25.readgeocoords <- INAscene(nreals=3, ntimesteps=3, doplot=F, readgeocoords=T, geocoords=matrix(c(1,1, 1,2, 1,3, 2,1, 2,2, 2,3),byrow=T,ncol=2), numnodes=NA, xrange=NA, yrange=NA, randgeo=F, readinitinfo=T, initinfo=c(1,1,1,0,0,0), initinfo.norp=NA, initinfo.n=NA, initinfo.p=NA, initinfo.dist=NA, readinitbio=T, initbio=c(0,0,0,1,1,1), initbio.norp=NA, initbio.n=NA, initbio.p=NA,  initbio.dist=NA, readseam=F, seam=NA, seamdist='random', seamrandp=c(0.01,0.05,0.1,0.5), seampla=NA, seamplb=NA, readbpam=F, bpam=NA, bpamdist='random', bpamrandp=0.1, bpampla=NA, bpamplb=NA, readprobadoptvec=F, probadoptvec=NA, probadoptmean=0.1, probadoptsd=0.1, readprobestabvec=F, probestabvec=NA, probestabmean=0.1, probestabsd=0.1, maneffdir='decrease_estab', maneffmean=0.5, maneffsd=0.1, usethreshman=F, maneffthresh=NA, sampeffort=NA) 
j25.baseline <- INAscene(nreals=3, ntimesteps=3, doplot=F, readgeocoords=F, geocoords=NA, numnodes=50, xrange=c(0,10), yrange=c(0,20), randgeo=T, readinitinfo=F, initinfo=NA, initinfo.norp='num', initinfo.n=5, initinfo.p=NA, initinfo.dist='random', readinitbio=F, initbio=NA, initbio.norp='num', initbio.n=5, initbio.p=NA,  initbio.dist='random', readseam=F, seam=NA, seamdist='powerlaw', seamrandp=NA, seampla=1, seamplb=0.5, readbpam=F, bpam=NA, bpamdist='powerlaw', bpamrandp=NA, bpampla=1, bpamplb=0.5, readprobadoptvec=F, probadoptvec=NA, probadoptmean=0.5, probadoptsd=0.2, readprobestabvec=F, probestabvec=NA, probestabmean=0.5, probestabsd=0.2, maneffdir='decrease_estab', maneffmean=0.5, maneffsd=0.2, usethreshman=T, maneffthresh=0.5, sampeffort=2) 
j25.baseline$multout
j25.readseam <- INAscene(nreals=3, ntimesteps=3, doplot=F, readgeocoords=T, geocoords=matrix(c(1,1, 1,2, 1,3, 2,1, 2,2, 2,3),byrow=T,ncol=2), numnodes=NA, xrange=NA, yrange=NA, randgeo=F, readinitinfo=T, initinfo=c(1,1,1,0,0,0), initinfo.norp=NA, initinfo.n=NA, initinfo.p=NA, initinfo.dist=NA, readinitbio=T, initbio=c(0,0,0,1,1,1), initbio.norp=NA, initbio.n=NA, initbio.p=NA,  initbio.dist=NA, readseam=T, seam=matrix(c(1,0,0,0,1,0, 0,1,0,0,1,0, 0,0,1,0,1,0, 0,1,0,1,0,0, 0,0,0,0,1,1, 0,1,0,0,0,1),byrow=T,nrow=6), seamdist=NA, seamrandp=NA, seampla=NA, seamplb=NA, readbpam=F, bpam=NA, bpamdist='random', bpamrandp=0.1, bpampla=NA, bpamplb=NA, readprobadoptvec=F, probadoptvec=NA, probadoptmean=0.1, probadoptsd=0.1, readprobestabvec=F, probestabvec=NA, probestabmean=0.1, probestabsd=0.1, maneffdir='decrease_estab', maneffmean=0.5, maneffsd=0.1, usethreshman=F, maneffthresh=NA, sampeffort=NA) 
sens.probadoptmean <- INAscene(nreals=15, ntimesteps=3, doplot=F, readgeocoords=F, geocoords=NA, numnodes=50, xrange=c(0,10), yrange=c(0,20), randgeo=T, readinitinfo=F, initinfo=NA, initinfo.norp='num', initinfo.n=5, initinfo.p=NA, initinfo.dist='random', readinitbio=F, initbio=NA, initbio.norp='num', initbio.n=5, initbio.p=NA,  initbio.dist='random', readseam=F, seam=NA, seamdist='powerlaw', seamrandp=NA, seampla=1, seamplb=0.5, readbpam=F, bpam=NA, bpamdist='powerlaw', bpamrandp=NA, bpampla=1, bpamplb=0.5, readprobadoptvec=F, probadoptvec=NA, probadoptmean=seq(0,1,0.1), probadoptsd=0.2, readprobestabvec=F, probestabvec=NA, probestabmean=0.5, probestabsd=0.2, maneffdir='decrease_estab', maneffmean=0.9, maneffsd=0.2, usethreshman=T, maneffthresh=0.3, sampeffort=2) 
jt <- sens.probadoptmean$multout
plot(jt$probadoptmean, jt$mestab, xlab='Mean probability of adopting technology if informed', ylab='Proportion nodes with bioentity', xlim=c(0,1), ylim=c(0,1))
plot(jt$probadoptmean, jt$mdec, xlab='Mean probability of adopting technology if informed', ylab='Proportion nodes with technology adoption', xlim=c(0,1), ylim=c(0,1))
sens.seamplb <- INAscene(nreals=15, ntimesteps=3, doplot=F, readgeocoords=F, geocoords=NA, numnodes=50, xrange=c(0,50), yrange=c(0,50), randgeo=T, readinitinfo=F, initinfo=NA, initinfo.norp='num', initinfo.n=5, initinfo.p=NA, initinfo.dist='random', readinitbio=F, initbio=NA, initbio.norp='num', initbio.n=5, initbio.p=NA,  initbio.dist='random', readseam=F, seam=NA, seamdist='powerlaw', seamrandp=NA, seampla=1, seamplb=seq(0,2,0.1), readbpam=F, bpam=NA, bpamdist='powerlaw', bpamrandp=NA, bpampla=1, bpamplb=0.5, readprobadoptvec=F, probadoptvec=NA, probadoptmean=0.7, probadoptsd=0.2, readprobestabvec=F, probestabvec=NA, probestabmean=0.5, probestabsd=0.2, maneffdir='decrease_estab', maneffmean=0.9, maneffsd=0.2, usethreshman=T, maneffthresh=0.3, sampeffort=2) 
jt2 <- sens.seamplb$multout
plot(jt2$seamplb, jt2$mestab, xlab='Power law parameter b in ad^(-b) for communication links', ylab='Proportion nodes with bioentity', xlim=c(0,2), ylim=c(0,1))
plot(jt2$seamplb, jt2$mdec, xlab='Power law parameter b in ad^(-b) for communication links', ylab='Proportion nodes with technology adoption', xlim=c(0,2), ylim=c(0,1))
plot(jt2$seamplb, jt2$mcom, xlab='Power law parameter b in ad^(-b) for communication links', ylab='Proportion nodes with information about technology', xlim=c(0,2), ylim=c(0,1))
j25.seamrandp <- INAscene(nreals=3, ntimesteps=3, doplot=F, readgeocoords=F, geocoords=NA, numnodes=50, xrange=c(0,10), yrange=c(0,20), randgeo=T, readinitinfo=F, initinfo=NA, initinfo.norp='num', initinfo.n=5, initinfo.p=NA, initinfo.dist='random', readinitbio=F, initbio=NA, initbio.norp='num', initbio.n=5, initbio.p=NA,  initbio.dist='random', readseam=F, seam=NA, seamdist='random', seamrandp=c(0.01,0.05,0.1,0.5), seampla=NA, seamplb=NA, readbpam=F, bpam=NA, bpamdist='random', bpamrandp=0.1, bpampla=NA, bpamplb=NA, readprobadoptvec=F, probadoptvec=NA, probadoptmean=0.1, probadoptsd=0.1, readprobestabvec=F, probestabvec=NA, probestabmean=0.1, probestabsd=0.1, maneffdir='decrease_estab', maneffmean=0.5, maneffsd=0.1, usethreshman=F, maneffthresh=NA, sampeffort=NA) 
sens.exp2a <- INAscene(nreals=10, ntimesteps=10, doplot=F, readgeocoords=F, geocoords=NA, numnodes=50, xrange=c(0,50), yrange=c(0,50), randgeo=T, readinitinfo=F, initinfo=NA, initinfo.norp='prop', initinfo.n=NA, initinfo.p=0.05, initinfo.dist='random', readinitbio=F, initbio=NA, initbio.norp='prop', initbio.n=NA, initbio.p=0.05,  initbio.dist='upedge', readseam=F, seam=NA, seamdist='powerlaw', seamrandp=NA, seampla=1, seamplb=0.5, readbpam=F, bpam=NA, bpamdist='powerlaw', bpamrandp=NA, bpampla=1, bpamplb=0.5, readprobadoptvec=F, probadoptvec=NA, probadoptmean=0.5, probadoptsd=0.2, readprobestabvec=F, probestabvec=NA, probestabmean=0.5, probestabsd=0.2, maneffdir='decrease_estab', maneffmean=0.5, maneffsd=0.2, usethreshman=F, maneffthresh=NA, sampeffort=2) 
sens.exp2a <- INAscene(nreals=10, ntimesteps=10, doplot=F, outputvol='less', readgeocoords=F, geocoords=NA, numnodes=50, xrange=c(0,50), yrange=c(0,50), randgeo=T, readinitinfo=F, initinfo=NA, initinfo.norp='prop', initinfo.n=NA, initinfo.p=0.05, initinfo.dist='random', readinitbio=F, initbio=NA, initbio.norp='prop', initbio.n=NA, initbio.p=0.05,  initbio.dist='upedge', readseam=F, seam=NA, seamdist='powerlaw', seamrandp=NA, seampla=1, seamplb=0.5, readbpam=F, bpam=NA, bpamdist='powerlaw', bpamrandp=NA, bpampla=1, bpamplb=0.5, readprobadoptvec=F, probadoptvec=NA, probadoptmean=0.5, probadoptsd=0.2, readprobestabvec=F, probestabvec=NA, probestabmean=0.5, probestabsd=0.2, maneffdir='decrease_estab', maneffmean=0.5, maneffsd=0.2, usethreshman=F, maneffthresh=NA, sampeffort=2) 

GarrettLab/INApreliminary documentation built on June 7, 2021, 10:59 a.m.